Skip to main content
Wechat In App

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
More details:
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 Page

API 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

FieldParamRequiredTypeDescription
Merchant IDmchidNoStringStore-level merchant ID (if provided)
External Order IDout_trade_noYesStringUnique transaction reference
AmounttxamtYesIntAmount in cents (recommended > 200 to avoid risk flags)
CurrencytxcurrcdYesString(3)Currency code. See Currency List
RMB Tagrmb_tagNoString(1)Use with txcurrcd=CNY to indicate RMB
Transaction TimetxdtmYesStringYYYY-MM-DD hh:mm:ss
Device IDudidNoStringMobile device identifier
Return URLreturn_urlNoStringRequired for some channels
Real-name Infoextend_infoNoObjectRequired 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": "430067798868676871",
  "user_truename": "\\u5c0f\\u6797"
}
  • user_creid — Mainland China ID number
  • user_truename — payer’s real name (Unicode or Chinese characters)

Sample Request

{
  "goods_info": "test_app",
  "goods_name": "qfpay",
  "out_trade_no": "ORDER_10001",
  "pay_type": "800210",
  "txamt": "10",
  "txcurrcd": "HKD",
  "txdtm": "2019-09-13 04:53:03",
  "udid": "DEVICE123"
}

API Response

Response Parameters

ParamTypeDescription
syssnStringQFPay transaction ID
out_trade_noStringMerchant order reference
txdtmStringRequest time
txamtIntAmount
sysdtmStringProcessing time
respcdString0000 = success
respmsgStringResponse message
resperrStringError description
cardcdStringCard number (if available)
txcurrcdStringCurrency
pay_paramsObjectParameters for WeChat SDK

Sample Response

{
  "respcd": "0000",
  "respmsg": "",
  "pay_params": {
    "appid": "wx3c6896fa9b351f2a",
    "partnerid": "316525492",
    "prepayid": "wx131253044253463a81dc336e1254149882",
    "package": "Sign=WXPay",
    "noncestr": "7786db42d9a245c2b1cfc717ac59376e",
    "timestamp": 1568350384,
    "sign": "[sign string]"
  }
}

Calling the WeChat SDK

After receiving pay_params, pass the values into the WeChat SDK. Official Documentation

Required Parameter Mapping

  • appid
  • partnerid
  • prepayid
  • package
  • noncestr
  • timestamp
  • sign

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