跳转到主要内容

创建结账会话

POST/api/v1/bank/wallet/checkout/Bearer Token

请求头

请求头必填
AuthorizationBearer {A55_ACCESS_TOKEN}
Content-Typeapplication/json
Idempotency-Key(幂等键)UUID v4建议

请求体

字段类型必填说明
wallet_uuidstring (UUID)接收资金的钱包
merchant_idstring (UUID)商户标识符
amountnumber收款总金额(例如 250.00
currencystringISO 4217 货币代码
descriptionstring显示在结账页面的收款描述
redirect_urlstring支付完成后的重定向 URL
cancel_urlstring付款人取消时的重定向 URL
due_datestring过期日期 YYYY-MM-DD
payer_emailstring在结账页面预填付款人邮箱
allowed_methodsarray限制支付方式(例如 ["credit_card", "pix"]
max_installmentsinteger允许的最大分期数(默认:钱包配置)
webhook_urlstring覆盖默认 webhook URL
reference_external_idstring您的内部订单 ID
is_checkoutbooleantrue(此 endpoint 的默认值)

响应字段

字段类型说明
checkout_uuidstring唯一结账会话标识符
checkout_urlstring托管结账页面 URL——将付款人重定向至此
statusstringactive——会话已准备好接受支付
amountnumber结账金额
currencystring货币代码
expires_atstringISO 8601 会话过期时间
charge_uuidstring付款人完成支付后创建

HTTP 状态码

状态码说明
200结账会话已创建
400请求体无效或缺少必填字段
401Bearer Token(持有者令牌)无效或已过期
403该钱包权限不足
404钱包或商户未找到
422验证错误(无效货币、金额)
429超出速率限制
500服务器内部错误 - 请使用指数退避重试

代码示例

curl -s -X POST https://core-manager.a55.tech/api/v1/bank/wallet/checkout/ \
-H "Authorization: Bearer $A55_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 990e8400-e29b-41d4-a716-446655440004" \
-d '{
"wallet_uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"merchant_id": "11111111-1111-1111-1111-111111111111",
"amount": 250.00,
"currency": "BRL",
"description": "高级计划——月度",
"redirect_url": "https://your-app.com/payment/success",
"cancel_url": "https://your-app.com/payment/cancel",
"due_date": "2026-12-31",
"payer_email": "zhangwei@example.com",
"allowed_methods": ["credit_card", "pix"],
"max_installments": 6,
"webhook_url": "https://your-app.com/webhooks/a55",
"reference_external_id": "ORDER-2048"
}'

错误响应示例

{
"status": "error",
"message": [
{
"code": "INVALID_REDIRECT_URL",
"source": "validation",
"description": "redirect_url must be a valid HTTPS URL"
}
]
}