Charges: Create

Application token secret is required for this route

Request

POST https://api../charges

Parameters:

Parameters
transaction_token_idstring (UUID) [Required]
The identifier of the token that contains the payment information.
amountnumber [Required]
Amount to charge.
currencystring (ISO-4217) [Required]
Currency code in ISO-4217.
only_direct_currencyboolean
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.
captureboolean
Whether to capture the payment. If false, the charge will only be authorized. Defaults to true.
capture_atstring (ISO-8601)
When the provided transaction token payment_type is:
payment_type=card
 - If capture is true, 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.
merchant_transaction_idstring
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)
metadataobject
See metadata for more information.

Headers:

Content-Type: application/json
Authorization: Bearer {secret}.{jwt}

Body:

curl --request POST \
--url https://api../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"
  }
}'

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",
  "created_on": 1491212455774
}