POST/api/v2/payins
创建自动收款订单 (POST /v2/payins)
ENDPOINT OVERVIEW
调用 POST /api/v2/payins 将动态分配最优收款通道并返回 paypage_url。注意签名中间件会剥离 /api 前缀,请求 /api/v2/payins 时须对 /v2/payins 签名;示例域名为 api.example.com,正式端点将在开户审核通过后下发。
Protocol Rules
- 请求头须包含 X-API-Key、X-Timestamp 与 X-Signature;计算 HMAC-SHA256 时须去掉 /api 前缀(对 /v2/payins 签名)。
- 标准请求字段包含 merchant_ref_id、currency_code、request_amount、customer_id (UUIDv7)、customer_account_id 与 redirect_url。
- 可随时通过 GET /api/v1/payins/{id} 查询权威状态,或通过 POST /api/v2/payins/{id}/cancel 取消未付订单。
Request Examples
# Note: api.example.com is a placeholder — your Sandbox & Production endpoints are issued at onboarding.
# Middleware strips /api before verifying, so compute X-Signature over /v2/payins.
curl -X POST https://api.example.com/api/v2/payins \
-H "Content-Type: application/json" \
-H "X-API-Key: <your-api-key>" \
-H "X-Timestamp: <unix-timestamp>" \
-H "X-Signature: <hmac-sha256-of-path>" \
-d '{
"merchant_ref_id": "unique-order-ref-id-2025001",
"currency_code": "THB",
"request_amount": 1000,
"customer_id": "0198cbc6-fd02-7459-a671-78c306d0a1ad",
"customer_account_id": "0198cbc7-35ec-7c8c-8994-d3ac3e7f5255",
"redirect_url": "https://merchant.example.com/payment/success"
}'Sample JSON Response
{
"id": "0198cbff-db9b-7b6a-9f82-6a55fdfb6575",
"merchant_ref_id": "unique-order-ref-id-2025001",
"status": "pending",
"request_amount": 1000,
"paypage_url": "https://pay.example.com/pay/0198cbff-db9b-7b6a-9f82-6a55fdfb6575"
}