API REFERENCE
Cancel Payment
This API cancels payment orders, including unpaid, paid, and successfully authorized orders.
If you have not received YabandPay's final payment result (success or failure), or want to close a payment order, call this API to cancel it.
Tip
- Time limit: Payment orders can only be cancelled within the specified window, from transaction initiation until 00:30 on the following day (T+1 day 00:30), Central European time.
- Amount restriction: Cancellation must be for the full amount. Partial cancellation is not supported.
- Refund restriction: A payment order cannot be cancelled if any refund operation has been performed on it.
- Settlement and fees: Cancelled payment orders are not cleared or settled, and YabandPay does not charge any transaction fees.
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | Cashier account UID | Required |
| sign | String | Signature | Required |
| method | String | v3.CancelPayment | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| trade_id | String | YabandPay order number | Required |
Signature example:
Sorted parameters concatenated into a URL-style query string
"method=v3.CancelPayment&time=1546588959&trade_id=4a49ffb3-a30f-ba92-9422-1969afb6f121&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.CancelPayment",
"time": 1546588959,
"data": {
"trade_id": "4a49ffb3-a30f-ba92-9422-1969afb6f121"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"type": "payment",
"user": "YOUR_CASHIER_UID",
"amount": "0.10",
"currency": "EUR",
"trade_id": "4a49ffb3-a30f-ba92-9422-1969afb6f121",
"description": "YabandPay test",
"order_id": "YOUR_ORDER_ID",
"createDate": "1706771212",
"demo": "test",
"transaction_id": "",
"state": "cancelled"
},
"message": ""
}
Additional information:
Response result:
- If cancellation succeeds, "status": true is returned.
- If cancellation fails, "status": false is returned.
Call Order Query to check the order status. If the order status state is cancelled, cancellation succeeded.
Response codes:
| Status | Code | Message |
|---|---|---|
| true | 200 | |
| false | -4111 | Exceed cancel window |
| false | -4112 | The transaction has been cleared cannot be cancelled |
| false | -4114 | The trade_id does not exist |
| false | -4115 | The transaction cannot be cancelled |
| false | -4116 | The transaction has been cancelled |
| false | -4117 | The transaction has been Expired |
