> ## Documentation Index
> Fetch the complete documentation index at: https://sdk.qfapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WeChat H5 Payment (Third-Party Browser)

> This guide helps merchants integrate WeChat H5 payment for non-WeChat browser environments, including scene configuration and redirect handling.

<Frame>
  <img src="https://mintcdn.com/qfpay-8e347952/0qBGs20OGxD96olb/images/online-shop/wechat-h5.png?fit=max&auto=format&n=0qBGs20OGxD96olb&q=85&s=aae626cc1e0ca893e2e3601df9b52bdd" alt="Wechat H5" width="1648" height="1394" data-path="images/online-shop/wechat-h5.png" />
</Frame>

***

## HTTP Request

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

***

## Request Parameters

| Field Name            | Field Code    | Required | Type   | Description                                                     |
| --------------------- | ------------- | -------- | ------ | --------------------------------------------------------------- |
| Common Payment Params | —             | Yes      | —      | See [Request Format](/integration/api-reference/request-format) |
| Extended Info         | `extend_info` | Yes      | Object | See structure below                                             |

### `extend_info` Structure

```js theme={null}
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](https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=15_5)

### Extended Info Parameters

| Field Code         | Subfield Code | Sub-subfield Code | Required | Type   | Description            |
| ------------------ | ------------- | ----------------- | -------- | ------ | ---------------------- |
| `scene_info`       |               |                   | Yes      | Object | Scene information      |
|                    | `h5_info`     |                   | Yes      | Object | H5 scene configuration |
|                    |               | `type`            | Yes      | String | Fixed value: `Wap`     |
|                    |               | `wap_url`         | Yes      | String | Mobile website URL     |
|                    |               | `wap_name`        | Yes      | String | Mobile website name    |
| `spbill_create_ip` |               |                   | Yes      | String | Customer’s real IP     |

***

## Response Parameters

| Field Code             | Subfield Code | Type   | Field Name  | Description                                                       |
| ---------------------- | ------------- | ------ | ----------- | ----------------------------------------------------------------- |
| Common Response Params | —             | —      | —           | See [Response Format](/integration/api-reference/response-format) |
| Payment URL            | `pay_url`     | String | Payment URL | URL to redirect the user to complete payment                      |

### Example `pay_url`

```text theme={null}
https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx20161110163838f231619da20804912345&package=1037687096
```

### Appended with `redirect_url`

```text theme={null}
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.
