Skip to content

Search API reference

Find an endpoint or a guide of the Sovgate API reference and jump straight to it.

Expire a checkout session

End an open session now, so it can no longer be paid.

POST/v1/checkout/sessions/{id}/expire

End an open session now, so it can no longer be paid.

Endpoint

http
POST /v1/checkout/sessions/{id}/expire

Path parameters

NameTypeDescription
idstringThe session's ID, cs_....

Example request

bash
curl -X POST https://api.sovgate.com/v1/checkout/sessions/cs_test_8a34998a7056ac775cff7b78/expire \  -H "Authorization: Bearer sov_sk_test_your_key" \  -H "Idempotency-Key: 3fc40152-4b2a-4c1d-9e3f-393427327799"

Example response

json
{  "id": "cs_test_8a34998a7056ac775cff7b78",  "object": "checkout_session",  "livemode": false,  "mode": "payment",  "status": "expired",  "payment_status": "unpaid",  "ui_mode": "hosted_page",  "currency": "usd",  "amount_total": 4000,  "line_item_count": 1,  "customer": null,  "client_reference_id": "order_8812",  "metadata": {    "cart": "c_1042"  },  "url": null,  "payment_link": null,  "payment": null,  "attempts": 0,  "created": "2026-11-27T14:00:00Z",  "expires_at": "2026-11-28T14:00:00Z",  "completed_at": null,  "expired_at": "2026-11-27T14:20:00Z"}

Errors

CodeWhen
invalid_stateThe session isn't open, or a payment is being attempted in it right now.