API Explanation

Request Type

POST

Request URI

/api/v1/pay/weixin/inapp-pay

Request

ParameterTypeRequiredDescriptionRemark
appIdStringYesWeChat appId
amountStringYesTransaction Amountcent is the unit, “100” means a dollar
callbackURLStringYesCallback URLSend notifications to this URL when an order is complete (Maximum length 255 English characters)
saleNumberStringNoMerchant Order Number
remarkStringNoRemarkRemark(Maximum length with 128 English characters)

Request Example:

{
  "appId": "wx2f194e1f2a4e1645",
  "amount": "1000",
  "callbackURL": "https://your.callback.url",
  "remark": ""
}

Response

ParameterTypeDescriptionRemark
appIdStringWeChat appId
timeStampStringToken Expiration TimeUnix timestamp expressed in milliseconds
nonceStrStringNonce String
packageStrStringPackage StringFixed value=“Sign=WXPay”
signTypeStringsignature algorithmReturned by WeChat Pay
paySignStringSignatureReturned by WeChat Pay
prepayIdStringPrepay IdReturned by WeChat Pay
partnerIdStringPartner IdReturned by WeChat Pay
wxApiKeyStringAPI KEYReturned by OTT PAY
amountStringTransaction Amount
paymentIdStringPayment 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.