API REFERENCE
Transaction Reversal
Applies to in-person POS payments
This API initiates reversal of successful transactions through the cloud.
Transaction reversal only supports transactions from the current day, and only full reversals are allowed.
For partial reversals or transactions from a previous day, use the refund API.
After a reversal instruction is sent, the POS terminal displays the reversal process and final result in real time so that merchants and users can immediately confirm the reversal status. For a silent reversal (without displaying the process on the POS terminal), use the Cancel Payment API.
Before calling this API, ensure that the POS device is online and available so that the reversal instruction can be delivered and processed successfully.
API URL (production): https://mapi.yabandpay.com/Payments
API URL (test): https://acc-mapi.yabandpay.com/Payments
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | Device TID | Required |
| sign | String | Signature | Required |
| method | String | v3.POSReversal | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| tid | string | Device TID | Required |
| trade_id | String | YabandPay order number | 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
"method=v3.POSReversal&request_id=a7z1lox4l6z6mdx1udgn5gtezasze1x0&tid=T125119061&time=1555498137&trade_id=4a49ffb3-a30f-ba92-9422-1969afb6f121&user=T125119061"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "T125119061",
"sign": "YOUR_SIGNATURE",
"method": "v3.POSReversal",
"time": 1555498137,
"data": {
"tid": "T125119061",
"trade_id": "4a49ffb3-a30f-ba92-9422-1969afb6f121",
"request_id": "a7z1lox4l6z6mdx1udgn5gtezasze1x0"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"type": "payment",
"user": "T125119061",
"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:
-
A successful request returns "status": true.
-
A failed request returns "status": false.
We strongly recommend using both order queries and asynchronous notifications to synchronize and update the payment status and keep payment information accurate in real time.
Response codes:
| Status | Code | Message |
|---|---|---|
| true | 200 | |
| false | -3001 | Required field is missing |
| false | -3002 | duplicate request_id |
| 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 |
