Taypay v1
创建订单接口
Taypay v1 创建订单接口说明与示例。
创建订单接口
POST /api/payment/open/v1/order/create
Content-Type: application/json
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| app_id | string | 是 | 商户应用 ID。 |
| merchant_order_no | string | 是 | 商户侧订单号。 |
| amount | string | 是 | 订单金额, 单位为元。 |
| channel | string | 是 | 支付通道编码, 如 epay_alipay。 |
| subject | string | 是 | 订单标题。 |
| body | string | 否 | 订单附加说明, 建议用于用户提示。 |
| notify_url | string | 否 | 支付结果异步通知地址。 |
| return_url | string | 否 | 支付完成后的页面返回地址。 |
| timestamp | integer | 是 | 秒级时间戳。 |
| nonce | string | 是 | 请求随机串, 用于防重放。 |
| sign_type | string | 是 | 签名算法。 |
| sign | string | 是 | 签名值。 |
请求示例:
{
"app_id": "your_app_id",
"merchant_order_no": "M202605220001",
"amount": "99.00",
"channel": "epay_alipay",
"subject": "VIP会员月卡",
"body": "用户购买 VIP 会员月卡",
"notify_url": "https://merchant.example.com/payment/notify",
"return_url": "https://merchant.example.com/payment/return",
"timestamp": 1779465600,
"nonce": "random_string_16_32",
"sign_type": "HMAC-SHA256",
"sign": "generate_by_app_secret"
}
响应参数
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 业务响应码, 0 表示成功。 |
| message | string | 响应说明。 |
| data.merchant_order_no | string | 商户订单号。 |
| data.platform_order_no | string | 平台订单号。 |
| data.amount | string | 订单金额。 |
| data.fee_amount | string | 手续费。 |
| data.settlement_amount | string | 结算金额。 |
| data.channel | string | 支付通道。 |
| data.status | integer | 订单状态码。 |
| data.payment_status | string | 支付状态文本。 |
| data.payment_status_code | integer | 支付状态码。 |
| data.lifecycle_status | string | 生命周期状态。 |
| data.paid_after_closed | boolean | 订单关闭后是否仍可支付。 |
| data.pay_url | string | 收银台跳转地址。 |
| data.pay_params.pay_type | string | 收款方式参数类型。 |
| data.pay_params.qrcode | string | 二维码内容。 |
| data.pay_params.img | string | 二维码图片地址。 |
响应示例:
{
"code": 0,
"message": "success",
"data": {
"merchant_order_no": "M202605220001",
"platform_order_no": "EP202605220001",
"amount": "99.00",
"fee_amount": "1.49",
"settlement_amount": "97.51",
"channel": "epay_alipay",
"status": 0,
"payment_status": "unpaid",
"payment_status_code": 0,
"lifecycle_status": "active",
"paid_after_closed": false,
"pay_url": "https://pay.example.com/checkout/EP202605220001",
"pay_params": {
"pay_type": "h5",
"qrcode": "",
"img": ""
}
}
}
