/api/v1/payment-orders
Create a payment order or checkout session
Creates a payment order for the authenticated merchant. When method is omitted, a hosted checkout session is created and checkout_url is returned instead of an order. When method is card, qr or subscription, amount, country and currency are required (subscription create mode uses amount 0.00). Subscription orders return a QR code in pay_url; scan it to complete subscription or payment + subscription binding.
请求头
| 字段 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
X-Merchant-No |
string | 必填 | 商户号(merchant_sn) | M10001 |
X-Timestamp |
integer | 必填 | Unix 秒级时间戳,允许偏差 5 分钟 | 1770000000 |
X-Nonce |
string | 必填 | 16-64 位随机串,防重放 | 8f3c2a1b9d4e6f70 |
X-Sign |
string | 必填 | RSA-SHA256 签名(base64) | base64-signature |
JSON 请求体
| 字段 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
merchant_order_no |
string | 必填 | Merchant-side order number, max 64 chars. Also used as the idempotency key. | ORDER-20261114-001 |
method |
string | 可选 | Acquiring method: card, qr or subscription. Omit to create a checkout session. | card |
amount |
string | 可选 | Positive decimal string, max 2 decimal places. Required for card/qr; subscription pay mode requires > 0 and subscription create mode requires 0.00. | 100.00 |
country |
string | 可选 | ISO 3166-1 alpha-2 country code. Required when method is present; subscription supports RU only. | RU |
currency |
string | 可选 | ISO 4217 three-letter currency code. Required when method is present; subscription supports RUB only. | RUB |
subscription_mode |
string | 可选 | Subscription mode: create (subscription QR, amount 0) or pay (pay then bind subscription). Inferred from amount when omitted. | create |
client_login |
string | 可选 | Merchant user identifier (email, phone or internal user id). Required when method=subscription. | user-10001 |
account_bank |
string | 可选 | Payer bank/operator ID. Required when method=subscription and subscription_mode=pay. | 1000000001 |
description |
string | 可选 | Order description, max 32 chars. Required when method=subscription. | Monthly subscription |
return_url |
string | 可选 | HTTPS return URL after payment. | https://merchant.example/return |
notify_url |
string | 可选 | HTTPS server notification URL. | https://merchant.example/notify |
lang |
string | 可选 | Hosted checkout language: en, zh or ru. Defaults to en when method is omitted. | en |
card |
object | 可选 | Card data. Required when method=card. Card data is never stored in logs. | |
card.card_number |
string | 必填 | 12-19 digits; spaces and hyphens are removed. | 4000000000000000 |
card.cvv |
string | 必填 | 3-5 digits. | 123 |
card.expiry_month |
string | 可选 | Two-digit month, or use expiry. | 11 |
card.expiry_year |
string | 可选 | Two or four digit year, or use expiry. | 2026 |
card.expiry |
string | 可选 | Alternative expiry in MM/YY format. | 11/26 |
card.email |
string | 必填 | Cardholder email. | [email protected] |
card.first_name |
string | 必填 | Cardholder first name. | John |
card.last_name |
string | 必填 | Cardholder last name. | Doe |
card.billing_info |
object | 可选 | Optional billing address. | |
card.billing_info.bill_address |
string | 可选 | Street address. | 155 Osceola Rd |
card.billing_info.bill_country |
string | 可选 | Numeric country code. | 840 |
card.billing_info.bill_state |
string | 可选 | State or region. | FL |
card.billing_info.bill_city |
string | 可选 | City. | Belleair |
card.billing_info.bill_zip |
string | 可选 | Postal code. | 33756 |
card.billing_info.bill_phone |
string | 可选 | Phone number. | 7275109811 |
响应
{
"code": 0,
"message": "OK",
"data": {
"order_no": "P20261114120000ABCDEF",
"merchant_order_no": "ORDER-20261114-001",
"method_code": "card",
"country_code": "RU",
"currency": "RUB",
"amount": "100.00",
"status": 3
},
"request_id": "8f3c2a1b9d4e6f70"
}
{
"code": 1021,
"message": "Unauthorized",
"data": null,
"request_id": "8f3c2a1b9d4e6f70"
}
{
"code": 1001,
"message": "Invalid parameter: amount",
"data": null,
"request_id": "8f3c2a1b9d4e6f70"
}