API REFERENCE
Get trade_id
Get trade_id using invoice_id.
Tip
After a successful transaction, use this API to obtain the corresponding
trade_idfor subsequent operations, such as increasing or decreasing authorization, capture, querying, reversal, or refund.
API URL (production): https://mapi.yabandpay.com/Payments
API URL (test): https://acc-mapi.yabandpay.com/Payments
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | Cashier account UID | Required |
| sign | String | Signature | Required |
| method | String | v3.GetTradeId | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| invoice_id | String | Order number | Required |
Signature example:
Sorted parameters concatenated into a URL-style query string
"invoice_id=1234567&method=v3.GetTradeId&time=1546588959&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.GetTradeId",
"time": 1546588959,
"data": {
"invoice_id": "1234567"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"trade_id": "2312e8b0-8ed5-6a66-293e-29efc206c599"
},
"message": ""
}
Additional information:
Response result:
-
A successful request returns "status": true.
-
A failed request returns "status": false.
Response codes:
| Status | Code | Message |
|---|---|---|
| true | 200 | |
| false | -1000 | Internal error |
| false | -403 | The signature Error |
| false | -4006 | Order number does not exist |
Notes
trade_id is generally available approximately 1 minute after transaction completion.
If the error "Order number does not exist" is returned, wait approximately 1 minute before trying again.
