
Overview
WeChat JSAPI enables payments inside an Official Account web page viewed within WeChat. This method is ideal for:- Official Account H5 stores
- In-app service flows
- QR campaigns opening inside WeChat
For merchants in Canada, refer to
Alipay Web Payments
wherepay_type = 800207.
Integration Methods
Method 1 — Merchant’s Own Official Account
Merchants use their verified WeChat Official Account. Requirements- Official Account verified & linked to QFPay
- Obtain user
openid - Domain added to JSAPI whitelist
- https://developers.weixin.qq.com/doc/offiaccount/en/Getting_Started/Overview.html
- https://pay.weixin.qq.com/wiki/doc/api/jsapi.php
Method 2 — QFPay Official Account (Indirect Settlement)
For merchants without a verified account, QFPay provides an Official Account.Payment Flow Overview
- User opens payment page inside WeChat
- Retrieve OAuth code
- Exchange code → obtain
openid - Submit payment request
- Redirect to WeChat JSAPI payment module
- Verify payment result via backend
Step 1 — Obtain WeChat OAuth Code
Request GET/tool/v1/get_weixin_oauth_code
This endpoint must be opened inside WeChat.
app_code and sign must be sent as query parameters, not headers.Parameters
Step 2 — Exchange Code for openid
Request
GET /tool/v1/get_weixin_openid
Parameters
Headers required:
X-QF-APPCODEX-QF-SIGN
A new OAuth code and openid must be obtained for each payment attempt.
Do not cache or reuse.
Do not cache or reuse.
Step 3 — Submit Payment Request
Endpoint POST/trade/v1/payment
PayType: 800207 (WeChat JSAPI)
Required Fields
Refer to:
pay_params Response
Step 4 — Redirect to WeChat Payment Module
Redirect the user’s browser to:GET https://o2-hk.qfapi.com/q/direct
Required Parameters
This request is sent directly from the user’s browser.
No authentication headers are required.
No authentication headers are required.
Additional Notes
- JSAPI flow must be executed sequentially
- Do not reuse OAuth codes or openid
- If payment result is delayed, verify via
Transaction Enquiry API - Real-name verification is optional and depends on merchant configuration

