### Pagination - Getting Started Source: https://docs.univapay.com/docs/api/general/pagination All resources returned as lists are paginated and sorted in descending order of creation date. The default number of items per page is 10. ```APIDOC ## Pagination - List Format ### Description This describes the format of a paginated list response. ### Response Body - **items** (array) - A list of resources. - **has_more** (boolean) - Indicates if there are more resources beyond the current list. ### Response Example ```json { "items": [], "has_more": false } ``` ``` -------------------------------- ### Example GET Request for Tokens with URL Parameters Source: https://docs.univapay.com/docs/api/transaction_tokens/request/list Example of a GET request to list transaction tokens for a specific store, demonstrating the inclusion of query parameters for filtering. The response will be a JSON object containing a list of tokens. ```curl curl --request GET \ --url https://api.univapay.com/stores/11edf541-c42d-653c-8c3d-dfe0a55f95c0/tokens \ --header 'Authorization: Bearer {secret}.{jwt}' ``` -------------------------------- ### Installment Payment Parameters Source: https://docs.univapay.com/docs/guide/implement/link/param-sabs_n_inst Parameters for enabling and configuring installment payment options. ```APIDOC ## POST /websites/univapay/installments ### Description Parameters for enabling and configuring installment payment options for consumers. ### Method POST ### Endpoint /websites/univapay/installments ### Parameters #### Request Body - **allowCardInstallments** (boolean) - Optional - If `true`, displays a dropdown menu for selecting the number of installments. This is only effective if a credit card is selected, `checkout=payment` is specified, and the `type` is NOT `subscription`. - **cardInstallmentOptions** (string) - Optional - When `allowCardInstallments` is `true`, this controls the options available in the dropdown. Accepts a comma-separated string of selectable values, e.g., `1,3,5,6,10,12,15,18,20,24,revolving`. ### Request Example ```json { "allowCardInstallments": true, "cardInstallmentOptions": "3,6,12" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Example of Listing Charges for a Specific Store Source: https://docs.univapay.com/docs/api/charges/request/list This is a practical example of the cURL command to list charges for a specific store, demonstrating the inclusion of a concrete store ID. ```bash curl --request GET \ --url https://api.univapay.com/stores/11edf541-c42d-653c-8c3d-dfe0a55f95c0/charges \ --header 'Authorization: Bearer {secret}.{jwt}' ``` -------------------------------- ### Bearer Authentication Examples (JWT) Source: https://docs.univapay.com/docs/api/general/authentication Illustrates how to format the Authorization header for Bearer authentication using JWT. Includes examples for both scenarios: with and without a secret. ```text // シークレットなし Bearer {jwt} // シークレットあり Bearer {secret}.{jwt} ``` -------------------------------- ### Installment Payment Parameters Source: https://docs.univapay.com/docs/guide/implement/widget/param-insrallment Parameters for enabling and configuring installment payment options within the Univapay widget. ```APIDOC ## Parameters (Installment Payments) This section details the parameters to be specified when you want consumers to select installment payments in the widget. In addition to the basic operation, please specify the following. ### Field Naming Conventions * Fields starting with `data-` and written in kebab-case are for HTML. * Fields written in lowerCamelCase on the second line are for JavaScript. * If only one is listed, it can only be used as that one. ### Fields * **Bold** indicates required. * *Italics* indicates conditionally required. | Field | Field Name (JavaScript) | Allowed Values | Notes | Default Value | |----------------------------------------|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------| | `data-allow-card-installments` | `allowCardInstallments` | Boolean (`true`/`false`) | When `true` is specified, a dropdown menu for selecting the number of installments is displayed. Valid only when a credit card is specified or selected, and `data-checkout="payment"` and `data-token-type!="subscription"` are specified, and installments are possible under the contract. Usable in inline forms. ``` -------------------------------- ### Merchant GET Request using cURL Source: https://docs.univapay.com/docs/api/merchant/request/get This snippet demonstrates how to make a GET request to the merchant endpoint using cURL. It requires a secret and an app token, which are included in the Authorization header. The example shows the basic structure for both https and http URLs. ```shell curl --request GET \ --url https://api.univapay.com/me \ --header 'Authorization: Bearer {secret}.{jwt}' ``` ```shell curl --request GET \ --url http://api.univapay.com/me \ --header 'Authorization: Bearer {secret}.{jwt}' ``` -------------------------------- ### Handle Univapay Callback Events with JavaScript Source: https://docs.univapay.com/docs/guide/implement/widget/install This script demonstrates how to listen for and handle various success, token creation, charge creation, subscription creation, and validation error events from Univapay using JavaScript's event listeners. It logs relevant information to the console for each event. ```javascript window.addEventListener("univapay:success", (e) => { console.info("Success event", e) }, false); window.addEventListener("univapay:token-created", (e) => { console.info("Token event", e) }, false); window.addEventListener("univapay:charge-created", (e) => { console.info("Charge event", e) }, false); window.addEventListener("univapay:subscription-created", (e) => { console.info("Subscription event", e) }, false); window.addEventListener("univapay:validation-error", (e) => { console.error("Validation error event", e) }, false); ``` -------------------------------- ### Subscription Object Response Structure Source: https://docs.univapay.com/docs/api/subscriptions/request/get This is an example JSON response received after a successful GET request for a subscription object. It includes details such as the subscription ID, store ID, payment amounts, currency, schedule settings, current status, and information about the next payment. ```json { "id": "11ef335e-9aa5-c54a-8313-7f9847da313a", "store_id": "11edf541-c42d-653c-8c3d-dfe0a55f95c0", "transaction_token_id": "11ef32a7-3a71-8662-803f-1bc27702eeec", "amount": 1250, "currency": "USD", "amount_formatted": 12.50, "initial_amount": null, "initial_amount_formatted": null, "subsequent_cycles_start": null, "schedule_settings": { "start_on": null, "zone_id": "Asia/Tokyo", "preserve_end_of_month": null, "retry_interval": null, "termination_mode": "immediate" }, "only_direct_currency": false, "first_charge_capture_after": null, "first_charge_authorization_only": false, "status": "current", "metadata": { "ServiceId": 78435694 }, "mode": "test", "created_on": "2024-06-26T01:51:28.627023Z", "period": "monthly", "next_payment": { "id": "11ef335e-9ae2-8322-8e79-e7ba4b56234e", "due_date": "2024-07-26", "zone_id": "Asia/Tokyo", "amount": 1250, "currency": "USD", "amount_formatted": 12.50, "is_paid": false, "is_last_payment": false, "created_on": "2024-06-26T01:51:29.025129Z", "updated_on": "2024-06-26T01:51:29.025129Z", "retry_date": null } } ``` -------------------------------- ### JavaScript Inline Payment Form Setup Source: https://docs.univapay.com/docs/guide/implement/iframe/js This snippet demonstrates how to set up an inline payment form using Univapay's JavaScript library. It includes the necessary script tag, form structure, button styling, and JavaScript to initialize and handle the payment process. Ensure you replace placeholder values like '<アプリトークンID>' with your actual application token. ```html
``` -------------------------------- ### Webhook GET API Response Body Example Source: https://docs.univapay.com/docs/api/webhooks/request/get This JSON object represents a successful response (HTTP 200) when retrieving a webhook object. It includes details such as the webhook's ID, associated merchant and store IDs, configured triggers, URL, active status, and creation/update timestamps. ```json { "id": "11ef1809-ad25-f160-9093-4f3cee241eb0", "platform_id": "11e7a7eb-0ef8-b0c6-bd54-f7a2646e6c47", "merchant_id": "11edf541-548f-ad70-8bc2-d34ca468c664", "store_id": "11edf541-c42d-653c-8c3d-dfe0a55f95c0", "triggers": [ "charge_finished", "refund_finished" ], "url": "https://webhook.URL/", "active": true, "created_on": "2024-05-22T07:05:31.049021Z", "updated_on": "2024-05-22T08:15:49.488255Z" } ``` -------------------------------- ### Payment Parameters Comparison Source: https://docs.univapay.com/docs/migration/parameters This section details the parameter mapping for various payment functionalities, including general settings, subscription details, and installment plans, comparing the old system with the new system's widget, inline, and API approaches. ```APIDOC ## Payment Parameters Comparison This table outlines the parameters used for payment processing, comparing the old Univapay system with the new system's implementations via widget, inline, and API methods. ### Parameters | Item | Old System | New System (Widget/Inline) | New System (API) | |---|---|---|---| | Store ID | `sid` | `data-app-id` | `Authorization: Bearer {secret}.{jwt}` | | Job Type | `job` (AUTH, SALES, CHECK) | `data-capture`, `data-cvv-authorize` | `capture`, `cvv_authorize.enabled` | | Service Type | `svid` (1 for credit) | `data-payment-methods` (card) | `payment_type` (card) | | Processing Type | `ptype` (Token, Gateway, 3DS, Link) | None | None | | Token Type | None | `data-token-type` (one_time, recurring, subscription) | `type` (one_time, recurring, subscription) | | Checkout Type | None | `data-checkout` (token, payment) | None | | Store Order Number (Customer ID) | `sod` | `data-univapay-reference-id` | `univapay-reference-id` | | Token ID | `upcmemberid` | None | `transaction_token_id` | | Item Amount | `siam1` | `data-amount` | `amount` | | Currency | None | `data-currency` | `currency` | | Auto Billing Cycle | `actp1` (various codes for frequency) | `data-subscription-period` (daily, weekly, monthly, etc., `P●D`, `P●M`) | `period` (daily, weekly, monthly, etc.), `cyclical_period` (`P●D`, `P●M`) | | Auto Billing Date | `acdc1` (specific codes for date settings) | `data-subscription-start` (yyyy-mm-dd) | `schedule_settings.start_on` (yyyy-mm-dd) | | Auto Billing Interval | `acmc1` (codes for interval settings) | None | None | | Auto Billing Amount | `acam1` | `data-amount`, `data-subscription-initial-amount`, `data-subscription-qty` | `amount`, `initial_amount`, `subscriptiont_plan.fixed_cycle_amount` | | Auto Billing Count | `acrm1` (0 for unlimited) | `data-subscription-plan` (fixed_cycles, fixed_cycle_amount) | `subscription_plan.plan_type` (fixed_cycles, fixed_cycle_amount) | | Auto Billing Retry Count | `acrt1` (defaults to 3) | None | None | | Auto Billing Retry Interval | `acrd1` (interval in days) | `data-subscription-retry-interval` | `schedule_settings.retry_interval` | | Installment Payments | `sc` | `data-allow-card-installments`, `data-installment-qty` | `installment_plan.fixed_cycles` | | Store Return URL Code | `sucd` | `data-auto-submit` | None | | Payment ID | `pid` | `charge_id` | None | | Subscription ID | `acid` | `subscription_id` | None | | Email Address | `em` | `data-email` | `email` | | Product Code | `sicd1` | `data-product-codes` | None | ``` -------------------------------- ### Bank Transfer Charge Response Body (JSON) Source: https://docs.univapay.com/docs/api/charges/request/get-transfer This is an example JSON response for a successful GET request to retrieve bank transfer charge objects. It includes a list of bank ledger items, each detailing the type, amount, balance, virtual bank account information, and transaction timestamps. The response also indicates if more items are available and the total number of hits. ```json { "items": [ { "bank_ledger_type": "payment", "amount": 1000, "balance": 0, "virtual_bank_account_holder_name": "test holder name", "virtual_bank_account_number": "1234567", "virtual_account_id": "test account id", "transaction_date": "2024-06-25", "transaction_timestamp": "2024-06-25T07:29:16.367347Z", "mode": "test", "created_on": "2024-06-25T07:29:16.373181Z" }, { "bank_ledger_type": "deposit", "amount": 1000, "balance": 1000, "virtual_bank_account_holder_name": "test holder name", "virtual_bank_account_number": "1234567", "virtual_account_id": "test account id", "transaction_date": "2024-06-25", "transaction_timestamp": "2024-06-25T07:29:16.36731Z", "mode": "test", "created_on": "2024-06-25T07:29:16.368093Z" } ], "has_more": false, "total_hits": 2 } ``` -------------------------------- ### 定期課金イベント Source: https://docs.univapay.com/docs/api/subscriptions/overview 定期課金に関連するイベント通知の概要です。ウェブフックを使用して、支払いの成功、失敗、およびキャンセルのイベント通知を受け取ることができます。 ```APIDOC ## 定期課金イベント通知 ウェブフックを用いて、定期課金イベントの通知を受け取ることを推奨します。 * **SUBSCRIPTION_PAYMENT**: 支払いが成功した時 * **SUBSCRIPTION_FAILED**: 支払いが失敗した時 * **SUBSCRIPTION_CANCELED**: 定期課金がキャンセルされた時 ``` -------------------------------- ### Example Cancel Object Response - JSON Source: https://docs.univapay.com/docs/api/cancels/request/get This JSON object represents a successful response when retrieving a cancel object. It includes details such as the cancel ID, associated charge and store IDs, status, any errors, metadata, mode, and creation timestamp. ```json { "id": "11ef32cc-e895-655e-8e33-e36629277b4f", "charge_id": "11ef32c2-eecd-ed24-abb8-cf4e336a1340", "store_id": "11edf541-c42d-653c-8c3d-dfe0a55f95c0", "status": "successful", "error": null, "metadata": { "order_id": 1234 }, "mode": "test", "created_on": "2024-06-25T08:28:32.859366Z" } ``` -------------------------------- ### Metadata Structure Example Source: https://docs.univapay.com/docs/api/general/metadata This example demonstrates the structure for including metadata within a request body. It shows how to nest metadata under a 'metadata' key, alongside other potential request parameters. This format is applicable when creating or updating resources like transaction tokens, charges, refunds, and subscriptions. ```json { "metadata": { "customer_id": 12345, "shipping_details": "Customer wants it now" } } ``` -------------------------------- ### Charge Object Response Structure Source: https://docs.univapay.com/docs/api/charges/request/get This is an example of a successful JSON response when retrieving a charge object. It includes details such as the charge ID, store ID, transaction type, amounts, status, and creation timestamp. The response may also contain metadata and redirect information. ```JSON { "id": "11ef32c2-4010-a312-aaff-4b63e4d5f92d", "store_id": "11edf541-c42d-653c-8c3d-dfe0a55f95c0", "transaction_token_id": "11ef32a7-3a71-8662-803f-1bc27702eeec", "transaction_token_type": "recurring", "subscription_id": null, "merchant_transaction_id": null, "requested_amount": 1000, "requested_currency": "JPY", "requested_amount_formatted": 1000, "charged_amount": 1000, "charged_currency": "JPY", "charged_amount_formatted": 1000, "fee_amount": null, "fee_currency": null, "fee_amount_formatted": null, "only_direct_currency": false, "capture_at": null, "descriptor": null, "descriptor_phone_number": null, "status": "successful", "error": null, "metadata": { "shipping_details": "Customer wants it now", "order_id": 12345 }, "mode": "test", "created_on": "2024-06-25T07:12:15.16452Z", "redirect": { "endpoint": "https://test.url/", "redirect_id": "11ef32c2-40cf-f772-8325-1798abb1110d" } } ``` -------------------------------- ### Handle Transaction Results with Callbacks - Univapay Source: https://docs.univapay.com/docs/faq/individual/implement Transaction results can be received instantly as callbacks, appended to the redirect URL. This allows merchants to implement different website behaviors based on the error content. Callbacks are crucial for immediate feedback on transaction outcomes. ```html https://your-site.com/redirect?status=success&transactionId=12345 https://your-site.com/redirect?status=error&errorCode=E001&message=Payment+failed ``` -------------------------------- ### JavaScript UnivapayCheckout Update Parameters Source: https://docs.univapay.com/docs/guide/implement/iframe/js This example shows how to use the `UnivapayCheckout.update` function to modify parameters before token creation. It demonstrates updating customer details like email and phone number, optionally forcing the update even if the consumer has entered information in the payment form. ```javascript UnivapayCheckout.update( iFrame, { email: "updated-dummy-email@univapay.com", phoneNumber: { countryCode: "+81", localNumber: "08000000000" } }, ); ``` -------------------------------- ### Embed and Control Univapay Widget using JavaScript Source: https://docs.univapay.com/docs/guide/implement/widget/install Implement the Univapay widget using JavaScript for dynamic control. This involves creating a form and button in HTML, then using JavaScript to initialize the Univapay checkout object and handle events like successful payments, triggering form submission. ```javascript ``` -------------------------------- ### Create Subscription Request Body - cURL Example Source: https://docs.univapay.com/docs/api/subscriptions/request/create This example shows a sample JSON payload for creating a subscription, including essential fields like transaction token ID, amount, currency, and payment period, along with optional metadata. This is sent as the data payload in a POST request. ```bash curl --request POST \ --url https://api.univapay.com/subscriptions \ --header 'Authorization: Bearer {secret}.{jwt}' \ --header 'content-type: application/json' \ --data '{ "transaction_token_id": "11ef32a7-3a71-8662-803f-1bc27702eeec", "amount": 1250, "currency": "USD", "period": "daily", "metadata":{ "ServiceId": 78435694 } }' ``` -------------------------------- ### Localization and Reference Parameters Source: https://docs.univapay.com/docs/guide/implement/widget/param-basic Parameters for setting language and unique identifiers. ```APIDOC ## Localization and Reference Parameters ### `data-locale` (locale) #### Description Specifies the display language for the widget. #### Type String (half-width English characters) #### Allowed Values - `auto` (browser dependent) - `ja` / `ja-jp` (Japanese) - `en` / `en-us` (English) - `zh` (Chinese) - `zh-cn` (Simplified Chinese) - `zh-tw` (Traditional Chinese) - `ko` / `ko-kr` (Korean) - `th` / `th-th` (Thai) - `ru` / `ru-ru` (Russian) #### Notes Usable in inline forms. ### `data-univapay-reference-id` (univapayReferenceId) #### Description A reference ID used as a search key for CSV billing. #### Type String (half-width alphanumeric characters) #### Notes Effective if `data-token-type="recurring"` is specified. Usable in inline forms. ### `data-univapay-customer-id` (univapayCustomerId) #### Description A customer ID defined in UUID format. #### Type String (UUID format) #### Notes Only valid for credit card payments. If set during the initial payment, a checkbox will be displayed allowing the customer to choose to create a recurring token. **Usage:** If `data-univapay-customer-id` is specified: - If `one_time` is specified or omitted: A `one_time` token is created without the checkbox. A `recurring` token is created with the checkbox. - If `recurring` is specified: A `recurring` token is created, requiring the checkbox. Usable in inline forms. ``` -------------------------------- ### Retrieve Transaction Token - cURL GET Request Source: https://docs.univapay.com/docs/api/transaction_tokens/request/get This cURL command demonstrates how to make a GET request to retrieve a specific transaction token. It requires the store ID and token ID in the URL, and the secret and JWT in the Authorization header. The response body contains the details of the transaction token. ```bash curl --request GET \ --url https://api.univapay.com/stores/{storeId}/tokens/{id} \ --header 'Authorization: Bearer {secret}.{jwt}' \ --header 'content-type: application/json' ``` ```bash curl --request GET \ --url https://api.univapay.com/stores/11edf541-c42d-653c-8c3d-dfe0a55f95c0/tokens/11ef32a7-3a71-8662-803f-1bc27702eeec \ --header 'Authorization: Bearer {secret}.{jwt}' ``` -------------------------------- ### Get Issuer Token (3-D Secure) using cURL Source: https://docs.univapay.com/docs/api/transaction_tokens/request/issuer-token-3ds-token This snippet demonstrates how to make a GET request to retrieve the issuer token for 3-D Secure authentication. It includes the necessary URL, HTTP method, and headers required for the request. The `secret` and `jwt` are used for authentication. ```bash curl --request GET \ --url https://api.univapay.com/stores/{storeId}/tokens/{tokenId}/three_ds/issuer_token \ --header 'Authorization: Bearer {secret}.{jwt}' \ --header 'content-type: application/json' ``` -------------------------------- ### Supported SDK Languages Source: https://docs.univapay.com/docs/faq/individual/api Lists the programming languages for which SDKs are available to facilitate integration with the Univapay API. ```APIDOC ## Supported SDK Languages ### Description Lists the programming languages for which SDKs are provided to integrate with the Univapay API. ### Supported Languages - Javascript (Typescript, NodeJS) - JAVA - PHP ``` -------------------------------- ### Get Merchant Information Source: https://docs.univapay.com/docs/api/merchant/request/get Retrieves information about the authenticated merchant. Requires authentication via secret and JWT in the Authorization header. ```APIDOC ## GET /me ### Description Retrieves information about the authenticated merchant. Requires authentication via secret and JWT in the Authorization header. ### Method GET ### Endpoint https://api.univapay.com/me ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash curl --request GET \ --url https://api.univapay.com/me \ --header 'Authorization: Bearer {secret}.{jwt}' ``` ### Response #### Success Response (200) - **Content-Type** (string) - application/json #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### JavaScript UnivapayCheckout Initialization Source: https://docs.univapay.com/docs/guide/implement/iframe/js This JavaScript code initializes the Univapay checkout process for an inline form. It specifies the application ID, amount, currency, and enables CVV authorization and inline mode. The `window.onload` function ensures the checkout process opens when the page loads. ```javascript var checkout = UnivapayCheckout.create({ appId: "<アプリトークンID>", checkout: "payment", amount: 100, currency: "jpy", cvvAuthorize: true, inline: true, inlineItemLabelstyle:, }); window.onload = function () { checkout.open(); } ``` -------------------------------- ### GET Request for Charges using cURL Source: https://docs.univapay.com/docs/api/charges/request/get This snippet demonstrates how to make a GET request to retrieve a specific charge object using cURL. It requires the store ID, charge ID, and authentication credentials (secret and JWT) in the header. The 'polling' parameter can be added to the URL to instruct the API to poll for status changes. ```cURL curl --request GET \ --url https://api.univapay.com/stores/{storeId}/charges/{chargeId} \ --header 'Authorization: Bearer {secret}.{jwt}' ``` ```cURL curl --request GET \ --url https://api.univapay.com/stores/11edf541-c42d-653c-8c3d-dfe0a55f95c0/charges/11ef32c2-4010-a312-aaff-4b63e4d5f92d \ --header 'Authorization: Bearer {secret}.{jwt}' ``` ```cURL curl --request GET \ --url "https://api.univapay.com/stores/{storeId}/charges/{chargeId}?polling=true" \ --header 'Authorization: Bearer {secret}.{jwt}' ``` -------------------------------- ### GET /stores/{storeId} Source: https://docs.univapay.com/docs/api/store/request/get Retrieves a specific store object using its ID. Requires authentication via secret and JWT token in the header. ```APIDOC ## GET /stores/{storeId} ### Description Retrieves a specific store object using its unique identifier. ### Method GET ### Endpoint `/stores/{storeId}` ### Parameters #### Path Parameters - **storeId** (string) - Required - The unique identifier of the store. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --request GET \ --url https://api.univapay.com/stores/11edf541-c42d-653c-8c3d-dfe0a55f95c0 \ --header 'Authorization: Bearer {secret}.{jwt}' ``` ### Response #### Success Response (200) - **Content-Type** (string) - `application/json` #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### 定期課金オブジェクト Source: https://docs.univapay.com/docs/api/subscriptions/overview 定期課金オブジェクトは、定期的な自動課金の設定と管理に使用されます。ID、店舗ID、トランザクショントークンID、金額、通貨、スケジュール設定、ステータス、メタデータ、モード、作成日時、課金間隔、次回の支払い情報、および3Dセキュア情報などのフィールドが含まれます。 ```APIDOC ## 定期課金オブジェクトデータ構造 ### "subscription" オブジェクト | フィールド | データ型 | 備考 | |---|---|---| | id | string (UUID) | 定期課金のユニークID. 作成時に自動付与 | | store_id | string (UUID) | 登録された「店舗」のユニークID. 契約時に自動付与 | | transaction_token_id | string (UUID) | 事前に作成したトランザクショントークン | | amount | number | 課金額 | | currency | string (ISO-4217) | 通貨. 例:日本円はJPY | | amount_formatted | string | 現実的に流通する補助通貨がある場合、通貨額での課金額. 例:`currency`が`USD`で課金額が`110`の場合は`1.1` | | initial_amount | number | 初回の課金. ※`CREATE`時に未指定だと`amount`を参照 | | initial_amount_formatted | string | 現実的に流通する補助通貨がある場合、通貨額での課金額. 例:`currency`が`USD`で課金額が`110`の場合は`1.1` | | schedule_settings.start_on | string (ISO-8601) | 2回目の課金日. 指定日のタイムゾーンの07:00に実行. ※`CREATE`時に指定可能 | | schedule_settings.zone_id | string (IANA Timezone) | タイムゾーン. 例:日本は`Asia/Tokyo` | | schedule_settings.preserve_end_of_month | boolean | 月末固定の指定が、されている(`true`)か否(`false`)か | | schedule_settings.retry_interval | string | 定期課金が失敗したときのリトライ間隔. 存在し得る値(意味):`PxD`(x日)、`PxW`(x週間)、`PxM`(xか月) | | schedule_settings.termination_mode | string | 定期課金の停止リクエストを受理したとき、実際に自動課金のステータスを`suspended`(一時停止)に変更するタイミング. 指定可能な値(意味):`immediate`(即時)、`on_next_payment`(次回課金日) | | status | string | 定期課金のステータス. `unverified`(初回課金の待機中)、`unconfirmed`(初回課金に失敗)、`canceled`(永久停止:リクエストで移行し再開不可)、`unpaid`(リトライ待ち)、`current`(継続中)、`suspended`(一時停止:管理画面で「一時停止」ボタンを押下、リトライ回数の超過、リクエストのいずれかで移行)、`completed`(指定分完了:再開可) | | metadata | object | メタデータ. ※`CREATE`,`UPDATE`時はネストで任意のフィールドと値を指定可能 | | mode | string | 決済のモード. `live`(本番)または`test`(テスト) | | created_on | string (ISO-8601) | データの作成日時 | | period | string | 指定した定期課金の間隔. 存在し得る値(意味):`daily`(毎日)、`weekly`(毎週)、`biweekly`(隔週)、`monthly`(毎月)、`bimonthly`(隔月)、`quarterly`(3ヶ月)、`semiannually`(6ヶ月)、`annually`(毎年) | | cyclical_period | string (ISO8601 duration) | 存在し得る値(意味):`PxD`(x日周期)、`PxW`(x週間周期)、`PxM`(xヶ月周期)、`PxY`(x年周期). ※CREATEで`Period`未指定なら必須 | | next_payment.id | string (UUID) | 支払いのID | | next_payment.due_date | string (YYYY-MM-DD) | 次回課金日 | | next_payment.zone_id | string (IANA Timezone) | タイムゾーン. 例:日本は`Asia/Tokyo` | | next_payment.amount | string | 次回課金額 | | next_payment.currency | string (ISO-4217) | 通貨. 例:日本円はJPY | | next_payment.amount_formatted | string | 現実的に流通する補助通貨がある場合、通貨額での課金額. 例:`corrency`が`USD`で課金額が`110`の場合は`1.1` | | next_payment.is_paid | boolean | 決済結果(未実行のため`false`固定) | | next_payment.is_last_payment | boolean | 最後の支払いかどうか. (回数制限付きの定期課金のみ`true`が出力され得る) | | next_payment.created_on | string (ISO-8601) | データの作成日時 | | next_payment.updated_on | string (ISO-8601) | データの更新日時 | | next_payment.retry_date | string (YYYY-MM-DD) | 次回課金が失敗した場合のリトライ予定日 | | three_ds.redirect_id | string (UUID) | リダイレクトリクエストの一意な識別子. リダイレクトURLが正常に指定された場合当システム側で入力されます。 | | three_ds.redirect_endpoint | string (URL) | 3DS認証後に顧客をリダイレクトするURL. 顧客はGET httpメソッドで指定されたエンドポイントにリダイレクトされます. `univapayChargeId`と`univapayTokenId`に加えて、すべてのメタデータ(課金作成時に指定されたもの、作成後に更新されたメタデータは含まない)が自動的にクエリパラメータの一部として送信されます. 任意でエンドポイントURLに追加のクエリパラメータを追加することができます。 | | three_ds.mode | string | 課金の3D-セキュア認証の種類 `normal`、`require`、`force`、`skip`のいずれか. デフォルトでは`normal`が指定されます. トランザクショントークン作成時に3-Dセキュア認証が完了している場合、3-Dセキュア認証はスキップされ、そうでない場合は3-Dセキュア認証が必要となります. `require`を指定するとトランザクショントークンですでに3-Dセキュア認証が完了していても、3D-セキュア認証を要求します. この時、3-Dセキュアのリスクベース認証によっては本人認証が要求されず決済が完了になる可能性があります. `force`を指定するとトランザクショントークンですでに3-Dセキュア認証が完了していても、強制的に3-Dセキュア認証を行います. この時チャレンジ認証が強制的に行われ、本人認証が必要になります. `skip`を指定すると3-Dセキュア認証をスキップします. これは、消費者が3-Dセキュアを実行できない特定のケースでのみ使用します. 使用するにはアプリトークンのシークレットが必要です. このオプションを有効にするには、サポートにお問い合わせください. 表記ルールについては免責事項を参照してください | ``` -------------------------------- ### Create Refund Request with Body - cURL Example Source: https://docs.univapay.com/docs/api/refunds/request/create This cURL command provides a full example of a refund creation request, including the request body with parameters like amount, currency, reason, message, and metadata. Ensure the currency code follows ISO-4217 standards and the reason is one of the allowed values. ```curl --request POST \ --url https://api.univapay.com/stores/11edf541-c42d-653c-8c3d-dfe0a55f95c0/charges/11ef32c3-3cfe-3bc0-abed-0bb96f792078/refunds \ --header 'Authorization: Bearer {secret}.{jwt}' \ --header 'content-type: application/json' \ --data '{ "amount": 250, "currency": "JPY", "reason": "customer_request", "message": "15 percent off", "metadata": { "coupon": "VIP007" } }' ```