post https://app.ecwid.com/api/v3//billing/transactions
Access scope required: charge
Headers
Name | Type | Description |
---|---|---|
Authorization | string | oAuth token with mandatory Bearer before it. Example: Bearer e***s0 , where e***s0 should be replaced with your oAuth token. |
Request
Mandatory fields are in bold.
Field | Type | Description |
---|---|---|
amount | number | The amount user will be charged. Could be rounded to hundredths |
currency | string | Accepted currencies: USD , RUB , EUR , MXN , INR , GBP , AUD . You can charge in any currency from the list, even if it's different from the one used in store owner's subscription to Ecwid plans or apps. |
description | string | Describe why the charge is made. Max: 255 characters. |
idempotencyKey | string | UUID key that guarantees there is no double charge, must be unique for each transaction |
metadata | array | A JSON object for reference, for example, for passing an ID of a bought product |
Errors
In case of error, Ecwid responds with an error HTTP status code and, optionally, JSON-formatted body containing error description
HTTP codes
HTTP Status | Description | Code (optional) |
---|---|---|
400 | Charge amount is not rounded to hundredths or less than 0 | CHARGE_AMOUNT_INVALID |
400 | Invalid currency code used | CHARGE_CURRENCY_INVALID |
400 | Description is empty or exceeds 255 characters limit | CHARGE_DESCRIPTION_INVALID |
400 | Invalid UUID key | CHARGE_IDEMPOTENCY_KEY_INVALID |
400 | The same UUID key was used for another request with different parameters | CHARGE_IDEMPOTENCY_KEY_NOT_UNIQUE |
402 | The card couldn't be charged | CHARGE_DECLINED |
402 | No chargeable payment method is connected with the store | CHARGE_PAYMENT_SOURCE_MISSING |
402 | Charge limit exceeded | CHARGE_LIMIT_EXCEEDED |
403 | Token doesn't exist or the charge scope is missing | CHARGE_LIMIT_EXCEEDED |
Error response body (optional)
Field | Type | Description |
---|---|---|
errorMessage | string | Error message |
errorCode | string | Error code |
Charge limits:
— Per transaction: $500
— Per owner ID in a day: $5000