{
"id": "<string>",
"amount_total": 123,
"currency": "<string>",
"payment_status": "pending",
"created": 123,
"expires_at": 123,
"url": "<string>",
"line_items": [
{
"price_data": {
"currency": "<string>",
"unit_amount": 2,
"product_data": {
"name": "<string>",
"description": "<string>"
}
},
"quantity": 2
}
],
"tax_amount": 123,
"shipping_amount": 123,
"exchange_rate": "<string>",
"target_currency": "<string>",
"target_amount_total": 123,
"rate_locked_at": 123,
"subscription_id": "<string>",
"invoice_id": "<string>",
"metadata": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"decline_code": "<string>",
"request_log_url": "<string>",
"charge": "<string>"
},
"request_id": "<string>",
"timestamp": 123
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"decline_code": "<string>",
"request_log_url": "<string>",
"charge": "<string>"
},
"request_id": "<string>",
"timestamp": 123
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"decline_code": "<string>",
"request_log_url": "<string>",
"charge": "<string>"
},
"request_id": "<string>",
"timestamp": 123
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"decline_code": "<string>",
"request_log_url": "<string>",
"charge": "<string>"
},
"request_id": "<string>",
"timestamp": 123
}支付 API
创建支付会话
创建新的支付会话。服务端会按商户店铺配置解析来源系统,并生成收银台 URL。
POST
/
api
/
v1
/
checkout
/
sessions
/
create
{
"id": "<string>",
"amount_total": 123,
"currency": "<string>",
"payment_status": "pending",
"created": 123,
"expires_at": 123,
"url": "<string>",
"line_items": [
{
"price_data": {
"currency": "<string>",
"unit_amount": 2,
"product_data": {
"name": "<string>",
"description": "<string>"
}
},
"quantity": 2
}
],
"tax_amount": 123,
"shipping_amount": 123,
"exchange_rate": "<string>",
"target_currency": "<string>",
"target_amount_total": 123,
"rate_locked_at": 123,
"subscription_id": "<string>",
"invoice_id": "<string>",
"metadata": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"decline_code": "<string>",
"request_log_url": "<string>",
"charge": "<string>"
},
"request_id": "<string>",
"timestamp": 123
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"decline_code": "<string>",
"request_log_url": "<string>",
"charge": "<string>"
},
"request_id": "<string>",
"timestamp": 123
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"decline_code": "<string>",
"request_log_url": "<string>",
"charge": "<string>"
},
"request_id": "<string>",
"timestamp": 123
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"decline_code": "<string>",
"request_log_url": "<string>",
"charge": "<string>"
},
"request_id": "<string>",
"timestamp": 123
}授权
请求头
请求体
application/json
用于按单笔支付会话覆盖 Merchant Portal 中配置的少付容差。
| API 参数 | 实际生效规则 |
|---|---|
不传 allowed_shortfall | 沿用 Merchant Portal 的少付容差配置 |
allowed_shortfall: 0 | 使用 API 配置,要求全额到账,不允许少付 |
allowed_shortfall > 0 | 使用 API 配置,实际到账金额与目标金额的差额不超过该值时,可判定支付成功 |
- 参数类型必须为
int64,且不能为负数。 - 参数使用实际链上结算币种(USDT 或 USDC)的最小单位,与 Merchant Portal 的固定金额容差语义一致。
allowed_shortfall必须小于汇率锁定后生成的稳定币目标支付金额。- API 参数的优先级高于 Merchant Portal 配置;一旦传入,Portal 的百分比或固定金额少付容差不再参与该笔会话的少付判断。
- 该参数只影响少付判断,多付处理继续沿用 Merchant Portal 配置。
- 使用同一个
order_id重复创建会话时,allowed_shortfall必须与首次请求一致。
必填范围:
x >= 0响应
支付会话创建成功。
此页面对您有帮助吗?
