关闭 Checkout
商户路由已确认。 查看适用范围。
POST /v1/checkouts/{id}/close
仅允许商户服务端主动关闭会话,请求体为 {}。
open、processing:进入failed,failure_reason=closed。- 已
failed:返回当前对象,不修改原失败原因。 - 已
succeeded:拒绝关闭,返回400 checkout_invalid_state。
关闭后仍识别后续到账,但按资金异常处理,不重新开放付款,也不转为成功。
Attributes
| 属性 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
Idempotency-Key | header | string | 是 | 本次操作的唯一键;重试沿用原值 |
id | path | string | 是 | Checkout 的唯一标识 |
请求示例
POST /v1/checkouts/checkout_example/close
Authorization: Bearer inv_test_...
Content-Type: application/json
Idempotency-Key: ec3a7e90-673e-41a1-94d0-6724fba6a339
{}
返回示例
200 OK,返回完整的 Checkout 对象。
{
"id": "checkout_example",
"amount": "10",
"currency": "usdc",
"transaction_speed": "low",
"status": "failed",
"failure_reason": "closed",
"exception_status": null,
"order_id": "ORDER_001",
"description": "Order payment",
"metadata": {},
"url": "https://pay.example.com/c/checkout_example",
"return_url": "https://merchant.example.com/orders/ORDER_001",
"expires_at": "2026-10-28T08:30:00Z",
"created_at": "2026-10-28T08:00:00Z",
"updated_at": "2026-10-28T08:05:00Z"
}