Charges: Create
Application token secret is required for this route
Request
POST https://api.univapay.com/charges
Parameters:
Parameters | |
transaction_token_id | string (UUID) [Required] The identifier of the token that contains the payment information. |
amount | number [Required] Amount to charge. |
currency | string (ISO-4217) [Required] Currency code in ISO-4217. |
only_direct_currency | boolean If true , the system will only attempt to make the charge in the currency specfied and fail if there are no suitable providers avaliable. Default is false . |
capture | boolean Whether to capture the payment. If false , the charge will only be authorized. Defaults to true . |
capture_at | string (ISO-8601) When the provided transaction token payment_type is:– payment_type=card - If capture is , it will authorize the charge first and capture the charge at the specified date time.– payment_type=konbini or payment_type=bank_transfer - This field can be used to specify the exact expiry datetime of the payment. *For “7-Eleven” and “Seicomart”/Other Payments (“Circle K”/”Sunkus”/”Pay-easy”), the time cannot be specified, so the time will not be applied and the payment will be made only until the day of the payment. |
merchant_transaction_id | string Sets the transaction identifier for the actual request to the payment provider. The identifier must be unique and cannot be reused, and must conform to the requirements specified by the provider. Only supported by the following providers: – we_chat (max 32 char alphanumeric)– we_chat_mpm (max 32 char alphanumeric)– we_chat_online (max 32 char alphanumeric) |
metadata | object See metadata for more information. |
redirect.endpoint | string (URL) The absolute URL to redirect the customer after payment competition. The customer will be redirected to the specified endpoint with the GET http method. All metadata key value pairs (those specified at the time of charge creation, any additional metadata that was patched after creation will not be included) in addition to univapayChargeId and univapayTokenId will automatically be sent as part of the query parameters. Additional query parameters may optionally be appended into the endpoint URL.Only supported by the following payment brands: – alipay_online – alipay_plus_online – pay_pay_online |
three_ds.redirect_endpoint | string (URL) The absolute URL to redirect the customer after 3DS authentication. The customer will be redirected to the specified endpoint with the GET http method. All metadata key value pairs (those specified at the time of charge creation, any additional metadata that was patched after creation will not be included) in addition to univapayChargeId and univapayTokenId will automatically be sent as part of the query parameters. Additional query parameters may optionally be appended into the endpoint URL. |
three_ds.mode | string The 3DS authentication mode for the charge. One of normal , requried , force , skip .By default, normal will be set. This will skip 3DS authentication if it has already been completed on transaction token creation. Otherwise, 3DS authentication will be required.Use require to require 3DS authentication even though it has already been completed on the transaction token. Frictionless flow may be used depending on the evaluation by 3DSUse force to force 3DS authentication challenge even though it has already been completed on the transaction token. This will require the customer to authenticate their credentials.Use skip to skip 3DS authentication. This is only if your specific use case does not fall under any regulatory requirement. Requires application token secret to use. Please contact support to enable this option. |
Headers:
Content-Type: application/json
Authorization: Bearer {secret}.{jwt}
Body:
curl --request POST \
--url https://api.univapay.com/charges \
--header 'Authorization: Bearer {secret}.{jwt}' \
--header 'Content-type: application/json' \
--data '{
"transaction_token_id": "9c3b37f8-1851-11e7-9b58-8b8ddbe8f1d1",
"amount": 1000,
"currency": "JPY",
"metadata": {
"order_id": 12345,
"shipping_details": "Customer wants it now"
},
"redirect": {
"endpoint": "https://test.url/path?additionalParams=paramValue"
}
}'
Response
Code: 201
Headers:
Content-Type: application/json
Body:
{
"id": "a29db148-1851-11e7-9b58-4b8e9d783793",
"store_id": "af857264-180c-11e7-9be2-276aea4fed28",
"transaction_token_id": "9c3b37f8-1851-11e7-9b58-8b8ddbe8f1d1",
"requested_amount": 1000,
"requested_currency": "JPY",
"requested_amount_formatted": 1000,
"charged_amount": null,
"charged_currency": null,
"charged_amount_formatted": null,
"status": "pending",
"error": null,
"metadata": {
"shipping_details": "Customer wants it now",
"order_id": 12345
},
"mode": "test",
"redirect": {
"redirect_id": "f1e62f0c-e032-4438-8d0a-34931e942e4e",
"endpoint": "https://test.url/path?additionalParams=paramValue"
}
"created_on": 1491212455774
}