Cancel Payment Order
This API is used to cancel payment orders, including unpaid, paid, or authorized payment orders.
If you have not received the final payment result from YabandPay (success or failure) within the payment expiry time, or want to close the payment order, you can call this API to initiate the cancellation request.
[!TIP|style:flat]
Time Limit: the transaction can only be cancelled within the agreed period, which is from the time when the transaction is initiated to 00:30 of T+1 day (Central European Time).
Amount Limit: The entire amount must be canceled; partial amount cancellation is not supported.
Refund Limit: If the transaction has undergone any refund operations, it cannot be canceled.
Settlement and Fees: Cancelled transactions do not proceed to the settlement stage and are not included in the clearing and settlement files, and YabandPay will not charge any transaction fees.
API URL:https://mapi.yabandpay.com/Payments
Method:POST
POST data type:Json
Parameter | Type | Description | Required |
---|---|---|---|
user | String | the UID of cashier account | Required |
sign | String | signature | Required |
method | String | v3.CancelPayment | Required |
time | Long | timestamp |
- Parameter
Parameter | Type | Description | Required |
---|---|---|---|
trade_id | String | the trade_id from YabandPay | Required |
Signature:
Lexicographical sequence and URL key-value format new string
"method=v3.CancelPayment&time=1546588959&trade_id=4a49ffb3-a30f-ba92-9422-1969afb6f121&user=016683"
Use stringA and secret_key to get stringSign
Get Signature:
"ce35c72989dbda9a3393f4c2810ea71bd7755dd25061f1ae8073aea8e2db6dbe"
Example Request:
{
"user": "016683",
"sign": "ce35c72989dbda9a3393f4c2810ea71bd7755dd25061f1ae8073aea8e2db6dbe",
"method": "v3.CancelPayment",
"time": 1546588959,
"data": {
"trade_id": "4a49ffb3-a30f-ba92-9422-1969afb6f121"
}
}
Example Response:
{
"status": true,
"code": "200",
"data": {
"type": "payment",
"user": "016683",
"amount": "0.10",
"currency": "EUR",
"settlement_amount": "0.10",
"settlement_currency": "EUR",
"exchange_rate": "1",
"trade_id": "4a49ffb3-a30f-ba92-9422-1969afb6f121",
"description": "YabandPay test",
"order_id": "280244567856723026",
"createDate": "1706771212",
"demo": "test",
"transaction_id": "",
"state": "cancelled"
},
"message": ""
}
More information:
Return results:
- If the payment cancellation succeeds, it returns
"status": true
. - If the payment cancellation fails, it returns
"status": false
.
You can check the order status by calling Query payment. If the order status state
is cancelled
, the cancellation was successful.
Result/Error codes:
Status | Code | Message |
---|---|---|
true | 200 | |
fales | -4111 | Exceed cancel window |
fales | -4112 | The transaction has been cleared cannot be cancelled |
fales | -4114 | The trade_id does not exist |
fales | -4115 | The transaction cannot be cancelled |
fales | -4116 | The transaction has been cancelled |
fales | -4117 | The transaction has been Expired |