Documentation/API Reference

API REFERENCE

Quick Payment

POSThttps://mapi.yabandpay.com/Payments
Live API
API PLAYGROUND · Live API

Quick Payment

POSThttps://mapi.yabandpay.com/Payments
Automatically signed with your credentials

Request parameters9

Required fields first

Quick Payment

pay_methodRequiredstringdata.pay_methodoffline
amountRequiredstringdata.amountAmount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1.
currencyRequiredstringdata.currencyISO 4217 currency code, for example EUR or CHF
auth_codeRequiredstringdata.auth_codeAuthorization code from the WeChat Pay or Alipay+ wallet
descriptionRequiredstringdata.descriptionOrder description
Optional parameters 4
sub_pay_methodOptionalstringdata.sub_pay_methodWeChat Pay,Alipay,UnionPay QRcode,通过接口获取sub pay method 获取。如果为空(推荐),将由YabandPay来做支付方式判断。
tip_amountOptionalstringdata.tip_amountTip included in the total amount, as a numeric string; for example 1.02
demoOptionalstringdata.demoCustom field
notify_urlOptionalstringdata.notify_urlAsynchronous notification URL after payment

Credentials stay on this page. Your secret key is never stored or sent to the documentation server.

Parameters

ParameterTypeDescriptionRequired
data.pay_methodstringoffline✓
data.sub_pay_methodstringWeChat Pay,Alipay,UnionPay QRcode,通过接口[获取sub pay method](/yabandpay/docs/v3-cn/payments/simplepay/subpaymethod) 获取。**如果为空(推荐),将由YabandPay来做支付方式判断。**—
data.order_idstringMerchant order ID✓
data.amountstringAmount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1.✓
data.tip_amountstringTip included in the total amount, as a numeric string; for example 1.02—
data.currencystringISO 4217 currency code, for example EUR or CHF✓
data.demostringCustom field—
data.auth_codestringAuthorization code from the WeChat Pay or Alipay+ wallet✓
data.descriptionstringOrder description✓
data.notify_urlstringAsynchronous notification URL after payment—

For in-store payments, supporting WeChat Pay and Alipay+.

FieldTypeDescriptionRequired
userStringCashier account UIDRequired
signStringSignatureRequired
methodStringv3.BarcodePaymentRequired
timeLongTimestampRequired
  • Parameters
FieldTypeDescriptionRequired
pay_methodStringofflineRequired
sub_pay_methodStringWeChat Pay,Alipay,UnionPay QRcode. Obtain it through Get sub pay method. If left empty (recommended), YabandPay identifies the payment method.Optional
order_idStringMerchant order IDRequired
amountStringAmount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1.Required
tip_amountStringTip included in the total amount, as a numeric string; for example 1.02Optional
currencyStringISO 4217 currency code, for example EUR or CHFRequired
demoStringCustom fieldOptional
auth_codeStringAuthorization code from the WeChat Pay or Alipay+ walletRequired
descriptionStringOrder descriptionRequired
notify_urlStringAsynchronous notification URL after paymentOptional

Signature example:

Sorted parameters concatenated into a URL-style query string

"amount=2.1&auth_code=134443133735495918&currency=EUR&demo=test&description=YabandPay test&method=v3.BarcodePayment&notify_url=https://www.yabandpay.com/notify&order_id=202488465489451317&pay_method=offline&sub_pay_method=WeChat Pay&time=1555499083&tip_amount=0.5&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.BarcodePayment",
    "time": 1555499083,
    "data": {
        "amount": "2.1",
        "tip_amount": "0.5",
        "auth_code": "YOUR_AUTH_CODE",
        "currency": "EUR",
        "demo": "test",
        "description": "YabandPay test",
        "notify_url": "https://www.yabandpay.com/notify",
        "order_id": "YOUR_ORDER_ID",
        "pay_method": "offline",
        "sub_pay_method": "WeChat Pay"
    }
}

Response example:

{
    "status": true,
    "code": "200",
    "data": {
        "order_id": "YOUR_ORDER_ID",
        "trade_id": "511444d0-2d91-5396-9e34-f2900e80d715",
        "amount": "2.1",
        "tip_amount": "0.5",
		"sub_pay_method": "WeChat Pay",
        "state": "paid"
    },
    "message": ""}

Additional information:

Response result:

Tip

  1. If the customer does not need to enter a password, the payment result is returned synchronously.
  1. If the customer needs to enter a password after the code is scanned, the payment result is state: processing. The merchant must poll Query Order every 5 seconds to determine the actual payment result.
  1. If the customer cancels or has not paid within 30 seconds, we recommend exiting the query loop and calling Cancel Payment to reverse the payment transaction. If the customer has already paid, the system automatically issues a refund.
Response codes:
StatusCodeMessage
true200Success
false-1000Internal error
false-1007Identity code is invalid
false-4011Not support the payment method
false-4015This order has been closed
false-4028WeChat Pay is not available
false-4029Alipay is not available
false-4086Unknow identity code