Skip to main content
Wechat H5

HTTP Request

POST /trade/v1/payment
pay_type: 800212 (WeChat H5 Payment)

Request Parameters

Field NameField CodeRequiredTypeDescription
Common Payment ParamsYesSee Request Format
Extended Infoextend_infoYesObjectSee structure below

extend_info Structure

extend_info: {
  scene_info: {
    h5_info: {
      type: "Wap",                 // Scene type (fixed value)
      wap_url: "https://qfpay.global/h5/pay", // Mobile site URL
      wap_name: "qfpay"            // Mobile site name
    }
  },
  spbill_create_ip: "192.168.1.10" // User's real IP address
}
For IP acquisition details, see WeChat Docs

Extended Info Parameters

Field CodeSubfield CodeSub-subfield CodeRequiredTypeDescription
scene_infoYesObjectScene information
h5_infoYesObjectH5 scene configuration
typeYesStringFixed value: Wap
wap_urlYesStringMobile website URL
wap_nameYesStringMobile website name
spbill_create_ipYesStringCustomer’s real IP

Response Parameters

Field CodeSubfield CodeTypeField NameDescription
Common Response ParamsSee Response Format
Payment URLpay_urlStringPayment URLURL to redirect the user to complete payment

Example pay_url

https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx20161110163838f231619da20804912345&package=1037687096

Appended with redirect_url

https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx20161110163838f231619da20804912345&package=1037687096&redirect_url=https%3A%2F%2Fwww.wechatpay.com.cn

Additional Notes

  • Suitable for mobile websites, app-embedded browsers, and external mobile browsers.
  • Not supported within the WeChat in-app browser.
  • wap_url and wap_name must match the actual mobile site information or WeChat may reject the request.
  • The IP address submitted must be the real client IP to avoid risk rejection by WeChat.