跳到主要内容

关闭 Checkout

商户路由已确认。 查看适用范围。

对象与完整字段 · 认证、金额与错误 · 接入指南

POST /v1/checkouts/{id}/close

仅允许商户服务端主动关闭会话,请求体为 {}。

  • open、processing:进入 failed,failure_reason=closed。
  • 已 failed:返回当前对象,不修改原失败原因。
  • 已 succeeded:拒绝关闭,返回 400 checkout_invalid_state。

关闭后仍识别后续到账,但按资金异常处理,不重新开放付款,也不转为成功。

Attributes​

属性位置类型必填说明
Idempotency-Keyheaderstring是本次操作的唯一键;重试沿用原值
idpathstring是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"
}

业务错误码