Documentation/API Reference

API REFERENCE

Mini Program Payments

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

Mini Program Payments

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

Request parameters10

Required fields first

Mini Program Payments

pay_methodRequiredstringdata.pay_methodonline
sub_pay_methodRequiredstringdata.sub_pay_methodWeChat Pay
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
descriptionRequiredstringdata.descriptionOrder description
timeoutRequiredstringdata.timeoutExpiration time in minutes (0-1440)
notify_urlRequiredstringdata.notify_urlAsynchronous notification URL after payment
sub_app_idRequiredstringdata.sub_app_idMini Program APPID
sub_open_idRequiredstringdata.sub_open_idUser OpenID obtained by the Mini Program
Optional parameters 1
demoOptionalstringdata.demoCustom field

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

Tip

Note: Provide your WeChat Mini Program Appid to YabandPay. The feature must be activated before use.

ParameterTypeDescriptionRequired
userStringCashier account UIDRequired
signStringSignatureRequired
methodStringv3.CreatePaymentsWechatMiniPayRequired
timeLongTimestampRequired
  • Parameters
ParameterTypeDescriptionRequired
pay_methodStringonlineRequired
sub_pay_methodStringWeChat PayRequired
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
currencyStringISO 4217 currency code, for example EUR or CHFRequired
descriptionStringOrder descriptionRequired
demoStringCustom fieldOptional
timeoutStringExpiration time in minutes (0-1440)Required
notify_urlStringAsynchronous notification URL after paymentRequired
sub_app_idStringMini Program APPIDRequired
sub_open_idStringUser OpenID obtained by the Mini ProgramRequired

Signature example:

Sorted parameters concatenated into a URL-style query string

"amount=1.23&currency=EUR&description=test&method=v3.CreatePaymentsWechatMiniPay&notify_url=https://imenuapi.yabandpay.com/api/Notify/yabandpay&order_id=202413271095510835&pay_method=online&sub_app_id=wx7a5355d3d2a904a4&sub_open_id=opilP5dyazU7pTpyps8TDc53OGyU&sub_pay_method=WeChat Pay&time=1732672545&timeout=300&user=011844"

Sign stringA using secret_key

The resulting signature is:

"YOUR_SIGNATURE"

Request example:

{
    "user": "011844",
    "sign": "YOUR_SIGNATURE",
    "method": "v3.CreatePaymentsWechatMiniPay",
    "time": 1732672545,
    "data": {
        "description": "test",
        "timeout": "300",
        "pay_method": "online",
        "sub_pay_method": "WeChat Pay",
        "order_id": "YOUR_ORDER_ID",
        "amount": "1.23",
        "currency": "EUR",
        "notify_url": "https://imenuapi.yabandpay.com/api/Notify/yabandpay",
        "sub_open_id": "opilP5dyazU7pTpyps8TDc53OGyU",
        "sub_app_id": "wx7a5355d3d2a904a4"
    }
}

Response example:

{
    "status": true,
    "code": "200",
    "data": {
        "order_id": "YOUR_ORDER_ID",
        "trade_id": "e405c9d5-069f-34f5-9eb2-16919cd7e411",
        "amount": "1.23",
        "currency": "EUR",
        "parameters": {
            "appId": "wx7a5355d3d2a904a4",
            "package": "prepay_id=wx270959141300258779d83459e08e4b0000",
            "paySign": "Av83Y6u+Ua8hkU3VyoAN5MUu7cm9vPfID8OstMkS+3BbbNnl1bax5nRapKoFTz2DUzaGyzPiT+gDUzyGW7DshqPLy+NsmKvQGSQM5vyfSjXsz5F4LKOeI3YaaUBTnVXkKX6qBrzbVUfStyjvYwtqPJUXx0X2zZEiGV5ScEf44IOmWQXeiRKyv8j34KnhMHcSFgSVAPN/B10Z1BnN34VUpak6DyaM/d0zfEkUbtODzD260An9NBSKZqAg1Wh35o/Eebqd5KoPIPX74lfRjUH4O9IZUCXnb2NqTxCR2M8j7Yx5zzz3xiQGhqEPzc7m0vXQTYv3TjD+158LeF993e/c2w==",
            "nonceStr": "0ypozLSDOzutrUA7WUI7eTfWUHtDqO9n",
            "signType": "RSA",
            "timeStamp": "1732672754"
        },
        "state": "processing"
    },
    "message": ""
}

Use the returned value of “parameters” to launch WeChat Mini Program payment.

Additional information:

Response result:
  1. A successful request returns "status": true.

  2. A failed request returns "status": false.

We strongly recommend using both Query Order and Asynchronous Notifications to keep payment statuses accurate and up to date.

Response codes:
StatusCodeMessage
true200Success
false-1000Internal error
false-3001Required field is missing
false-403The signature Error
false-4011Not support the payment method