Payment in WeChat Web Browser

This endpoint generates a link that enables WeChat pay in the WeChat Web Browser (WeChat JSAPI). Merchants can either send the link directly to customer or generate a QR code from the link for the customers to scan.

How it works

API Request




Content-Type: application/x-www-form-urlencoded

! Tip

After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Web Payment in WeChat Testopen in new window to test out the workflow for this functionality. Which may help you when going through the documentation.

Note that the link must be opened in the WeChat browser for this function to work, you can copy the link to a chat window in the WeChat application, and open the link there.


mchIdyString(30)20001222merchant id assigned by IOTPay
mchOrderNoyString(30)20160427210604000490order number in merchant system,need to be unique
currencyyString(3)CAD3 letters representation for currency
QR code_paynint1set this param only in QR code mode
channelIdyString(24)WX_JSAPIFixed to WX_JSAPI
amountyint100payment amount,in cents,eg. $28.56 is 2856
clientIpyString(32) ip
returnUrlyString(200) url after payment
notifyUrlyString(200) will notify this url when payment success
subjectyString(64)product id or titleproduct id or title
bodyyString(255)product descriptionproduct description
param1nString(64)don't pass value in this field,
will return mchOrderNo in notify
param2nString(64)will return original value in notify
jobNoyString(50)merchant login name


When get notify, parameter "mchOrderNo" will be put into "param1",let "param1" empty when sending request.

After payment,merchant backend server still need notifyUrl to judge whether the transaction is successful

Return Result

retCodeyStringSUCCESSSUCCESS/FAIL retCode indicate communication status,
need to check resCode for transaction
urlyStringif success=true, redirect to url
code_urlnStringreturn only when QR code_pay=1 in request

When code_url returned, merchant side should generate QR Code image based on code_url

Parameters of returnUrl and notifyUrl

payOrderIdStringorder id of IOTPay
mchOrderNoStringorder id of merchant
channelOrderNoStringorder id of Alipay/WeChat Pay
statusIntsuccess code: 2 or 3
amountIntin cents
Last Updated: