
Prerequisites
To use WeChat In-App payments, merchants must:- Register on the WeChat Open Platform
- Create an App and obtain an AppID
- Complete WeChat approval and onboarding
WeChat Official In-App Payment Guide
Real-name Verification (Optional)
Merchants may enable real-name verification.- Applies to Mainland China users only
- The WeChat Wallet identity must match submitted details
- Users can still pay without linking a bank card
- Availability depends on merchant configuration and PayType support
SDK Downloads
Download the official SDK: WeChat SDK Download PageAPI Request
HTTP Request
- Method: POST
- Endpoint:
/trade/v1/payment - PayType:
800210
Confirm the PayType with QFPay if your account uses a different code for WeChat In-App payments.
Request Parameters
| Field | Param | Required | Type | Description |
|---|---|---|---|---|
| Merchant ID | mchid | No | String | Store-level merchant ID (if provided) |
| External Order ID | out_trade_no | Yes | String | Unique transaction reference |
| Amount | txamt | Yes | Int | Amount in cents (recommended > 200 to avoid risk flags) |
| Currency | txcurrcd | Yes | String(3) | Currency code. See Currency List |
| RMB Tag | rmb_tag | No | String(1) | Use with txcurrcd=CNY to indicate RMB |
| Transaction Time | txdtm | Yes | String | YYYY-MM-DD hh:mm:ss |
| Device ID | udid | No | String | Mobile device identifier |
| Return URL | return_url | No | String | Required for some channels |
| Real-name Info | extend_info | No | Object | Required only for Mainland China real-name flow |
| … | See Common Parameters for shared request fields |
Real-Name Verification Format (extend_info)
Submit real-name verification information only when required for Mainland China flows.
user_creid— Mainland China ID numberuser_truename— payer’s real name (Unicode or Chinese characters)
Sample Request
API Response
Response Parameters
| Param | Type | Description |
|---|---|---|
syssn | String | QFPay transaction ID |
out_trade_no | String | Merchant order reference |
txdtm | String | Request time |
txamt | Int | Amount |
sysdtm | String | Processing time |
respcd | String | 0000 = success |
respmsg | String | Response message |
resperr | String | Error description |
cardcd | String | Card number (if available) |
txcurrcd | String | Currency |
pay_params | Object | Parameters for WeChat SDK |
Sample Response
Calling the WeChat SDK
After receivingpay_params, pass the values into the WeChat SDK.
Official Documentation
Required Parameter Mapping
appidpartneridprepayidpackagenoncestrtimestampsign
Summary
- Designed for native mobile apps only
- Requires WeChat Open Platform registration & AppID approval
- Payment flow is handled by the official WeChat SDK
- Always confirm final status using the Transaction Enquiry API
