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 Merchant Order Number
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 Nonce String
packageStr String Package String Fixed value=“Sign=WXPay”
signType String signature algorithm Returned by WeChat Pay
paySign String Signature Returned by WeChat Pay
prepayId String Prepay Id Returned by WeChat Pay
partnerId String Partner Id Returned by WeChat Pay
wxApiKey String API KEY Returned by OTT PAY
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.