API REFERENCE
Initiate Payment or Authorization
Applies to in-person POS payments
This API sends payment or authorization instructions to a POS device through the cloud.
Before calling this API, ensure that the POS device is online and available so that instructions 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.POS | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| pay_method | String | offline | Required |
| sub_pay_method | String | point_of_sales | Required |
| operation | String | 1.Sales 2.Authorisation; | Required |
| tid | string | Device TID | Required |
| order_id | string | Order number consisting entirely of digits and fewer than 20 characters | Required |
| amount | String | Amount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1. | Required |
| tip_amount | String | Tip included in the total amount, as a numeric string; for example 1.02 | Optional |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Required |
| description | String | Order description, within 64 characters | Required |
| demo | String | Custom field | Optional |
| 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=12.5¤cy=EUR&description=YabandPay test&method=v3.POS¬ify_url=https://www.yabandpay.com/notify&operation=1&order_id=202586556498441613&pay_method=offline&request_id=a7z1lox4l6z6mdx1udgn5gtezasze1x0&sub_pay_method=point_of_sales&tid=T125119061&time=1555498137&tip_amount=0.5&user=T125119061"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "T125119061",
"sign": "YOUR_SIGNATURE",
"method": "v3.POS",
"time": 1555498137,
"data": {
"operation": "1",
"tid": "T125119061",
"amount": "12.5",
"currency": "EUR",
"tip_amount": "0.5",
"description": "YabandPay test",
"notify_url": "https://www.yabandpay.com/notify",
"order_id": "YOUR_ORDER_ID",
"pay_method": "offline",
"sub_pay_method": "point_of_sales",
"request_id": "a7z1lox4l6z6mdx1udgn5gtezasze1x0"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "4552eeea-1ae8-1e40-3b4b-802dc2f56458",
"amount": "12",
"currency": "EUR",
"tip_amount": "0.5",
"state": "processing"
},
"message": ""}
Additional information:
Tip
Important: When an asynchronous notification returns "state": "paid", the user has completed payment. Check whether the returned data contains "cvmTypeList": ["SIGNATURE"].
If the response contains "cvmTypeList": ["SIGNATURE"], the customer must sign the receipt;
Prompt the cashier to request the customer's signature and print a receipt with a signature field;
After the customer signs, the cashier selects “Confirm signature” or “Invalid signature” based on the signature.
If “Confirm signature” is selected, the transaction completes normally;
If “Invalid signature” is selected, immediately call the transaction reversal API to reverse this transaction;
For unattended or self-service payments, signature verification may be omitted because amounts are generally small, but this carries a chargeback risk.
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 | Success |
| false | -1000 | Internal error |
| false | -3001 | Required field is missing |
| false | -3002 | duplicate request_id |
| false | -403 | The signature Error |
| false | -4011 | Not support the payment method |
