API REFERENCE
Authorization Capture
Applies to: capture after authorization
Capture the order after successful authorization. Capture must occur within 30 days of authorization completion; otherwise, the authorization expires automatically.
The capture currency must match the authorization currency, and the amount must not exceed the original authorized amount.
Only one capture is accepted for each authorized transaction. Multiple captures are not supported.
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | Cashier account UID | Required |
| sign | String | Signature | Required |
| method | String | v3.Capture | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| trade_id | String | trade_id of the authorization | Required |
| amount | String | Amount as a numeric string. For example, enter 24.99 for € 24.99. | Required |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Required |
| description | String | Order description | Required |
| notify_url | String | Asynchronous notification URL after payment | Required |
| request_id | String | Unique request ID; a combination of digits and letters at least 24 characters is recommended | Required |
Signature example:
Sorted parameters concatenated into a URL-style query string
"amount=1¤cy=EUR&description=test&method=v3.Capture¬ify_url=https://www.yabandpay.com/notify&request_id=ca51f2fas3i0f8uiw7efj6oe4i2w1ghj&time=1720684254&trade_id=160899f3-f6d9-a8d8-ab5b-82eacdab9c5b&user=YOUR_CASHIER_UID"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.Capture",
"time": 1720684254,
"data": {
"description": "test",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1",
"currency": "EUR",
"notify_url": "https://www.yabandpay.com/notify",
"request_id": "ca51f2fas3i0f8uiw7efj6oe4i2w1ghj"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1",
"currency": "EUR",
"state": "paid"},
"message": "",
"response_id": "202407111550570060848432"
}
Additional information:
Response result:
-
A successful request returns "status": true.
-
A failed request returns "status": false.
We strongly recommend using both Query Order and Asynchronous Notifications to keep payment statuses accurate and up to date.
Response codes:
| Status | Code | Message |
|---|---|---|
| true | 200 | |
| false | -1000 | Internal error |
| false | -403 | The signature Error |
| false | -2001 | The user not exist |
| false | -3001 | Required field is missing |
| false | -4118 | Incorrect request ID |
| false | -4089 | Exceed capture window |
| false | -4084 | The captured amount exceeds the original authorized amount |
| false | -4085 | The captured currency is different from the original authorization currency |
| false | -4024 | The original trade ID is incorrect |
