API REFERENCE
Mini Program Payments
Tip
Note: Provide your WeChat Mini Program Appid to YabandPay. The feature must be activated before use.
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | Cashier account UID | Required |
| sign | String | Signature | Required |
| method | String | v3.CreatePaymentsWechatMiniPay | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| pay_method | String | online | Required |
| sub_pay_method | String | WeChat Pay | Required |
| order_id | String | Merchant order ID | Required |
| amount | String | Amount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1. | Required |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Required |
| description | String | Order description | Required |
| demo | String | Custom field | Optional |
| timeout | String | Expiration time in minutes (0-1440) | Required |
| notify_url | String | Asynchronous notification URL after payment | Required |
| sub_app_id | String | Mini Program APPID | Required |
| sub_open_id | String | User OpenID obtained by the Mini Program | Required |
Signature example:
Sorted parameters concatenated into a URL-style query string
"amount=1.23¤cy=EUR&description=test&method=v3.CreatePaymentsWechatMiniPay¬ify_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:
-
A successful request returns "status": true.
-
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:
| Status | Code | Message |
|---|---|---|
| true | 200 | Success |
| false | -1000 | Internal error |
| false | -3001 | Required field is missing |
| false | -403 | The signature Error |
| false | -4011 | Not support the payment method |
