API Explanation
Request Type
POST
Request URI
/api/v1/pay/weixin/inapp-pay
Request
Parameter | Type | Required | Description | Remark |
---|---|---|---|---|
appId | String | Yes | WeChat appId | |
amount | String | Yes | Transaction Amount | cent is the unit, “100” means a dollar |
callbackURL | String | Yes | Callback URL | Send notifications to this URL when an order is complete (Maximum length 255 English characters) |
saleNumber | String | No | ||
remark | String | No | Remark | Remark(Maximum length with 128 English characters) |
Request Example:
{
"appId": "wx2f194e1f2a4e1645",
"amount": "1000",
"callbackURL": "https://your.callback.url",
"remark": ""
}
Response
Parameter | Type | Description | Remark |
---|---|---|---|
appId | String | WeChat appId | |
timeStamp | String | Token Expiration Time | Unix timestamp expressed in milliseconds |
nonceStr | String | ||
packageStr | String | ||
signType | String | ||
paySign | String | ||
prepayId | String | ||
partnerId | String | ||
wxApiKey | String | ||
amount | String | Transaction Amount | |
paymentId | String | Payment ID |
Response Example:
{
"status": "SUCCESS",
"result": {
"appId": "",
"timeStamp": "2023030111",
"nonceStr": "DalCfzKOs4ZGmkh3",
"packageStr": "Sign=WXPay",
"signType": null,
"paySign": "06D391876D227CD3185B4CD8B008F16D",
"prepayId": "wx02005945522594c3552b4a9036e65d0000",
"partnerId": "250236060",
"wxApiKey": "0f84fcdfd195751864bee462377fb843",
"amount": "10.00",
"paymentId": "1677689983717708"
}
}
Payment Result
After the OTT Pay API server obtains the payment result from the payment channel, it will immediately send the payment result to the specified callbackURL. Of course, the merchant system can also actively query through Payment Status Query API.