跳到主要内容

公众号请求下单

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支付方式stringY枚举值 可填入 OFFICIAL
merchant_order_id商户订单号string(32)Y用于唯一确定商户下单ID
order_amount订单金额stringY传入金额 例如 "1.25"
order_currency订单币种stringY订单标价币种
settle_currency结算币种stringYHKD / USD
order_description订单描述stringY订单的描述信息
notify_url支付结果回调通知stringN
success_url支付成功后跳转页面stringN
failed_url支付失败后跳转页面stringN
canceled_url支付取消后跳转页面stringN
expired_time订单过期时间intN单位为秒,默认为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订单创建时间