公众号请求下单
POST /mch-api/v1/acq/wechat/create_payment
接口认证请参考 认证说明
- 请求示例
{
"payment_method": "OFFICIAL",
"merchant_order_id": "P147258",
"order_amount": "1.00",
"order_currency": "HKD",
"order_description": "ticket payment",
"notify_url": "https://www.baidu.com",
"success_url": "https://www.success.com/url",
"failed_url": "https://www.failed.com/url",
"canceled_url": "https://www.canceled.com/url",
"expired_time": 300
}
- Request
| 参数 | 说明 | 类型 | 必填 | 示例 |
|---|---|---|---|---|
| payment_method | 支付方式 | string | Y | 枚举值 可填入 OFFICIAL |
| merchant_order_id | 商户订单号 | string(32) | Y | 用于唯一确定商户下单ID |
| order_amount | 订单金额 | string | Y | 传入金额 例如 "1.25" |
| order_currency | 订单币种 | string | Y | 订单标价币种 |
| settle_currency | 结算币种 | string | Y | HKD / USD |
| order_description | 订单描述 | string | Y | 订单的描述信息 |
| notify_url | 支付结果回调通知 | string | N | |
| success_url | 支付成功后跳转页面 | string | N | |
| failed_url | 支付失败后跳转页面 | string | N | |
| canceled_url | 支付取消后跳转页面 | string | N | |
| expired_time | 订单过期时间 | int | N | 单位为秒,默认为300 不填默认为 300 即5分钟 |
- 返回示例
{
"code": 0,
"data": {
"pay_url": "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx3590fbb3213056e4&redirect_uri=https%3A%2F%2Fxxx%2Fwx_pay%2Fpay%3Fpayment_id%3D20202332108222153979490&response_type=code&scope=snsapi_base&state=0#wechat_redirect",
"create_time": "2023-08-31T04:44:05.928696203+08:00",
"merchant_order_id": "C34428245018020000",
"order_amount": "1.00",
"order_currency": "HKD",
"order_id": "C34428245018020000",
"uid": 19291111
},
"message": "ok",
"rid": "d2b810e57d4e4f6aac8387742a6e6582"
}
- Response.Data
| 参数 | 说明 | 示例 |
|---|---|---|
| uid | 平台商户号 | |
| order_id | 平台订单号 | |
| merchant_order_id | 商户订单ID | |
| pay_url | 返回的pay_url 通过微信内跳转至此页面进行支付 | |
| order_amount | 订单金额 | |
| order_currency | 订单币种 | |
| create_time | 订单创建时间 |