Skip to content

Search API reference

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

The checkout session object

A visit to Sovgate's hosted checkout page, opened by your server or by a payment link.

A checkout session is one visit to Sovgate's hosted payment page. Your server opens it with what it sells, sends the customer to its url, and learns it was paid from the checkout.session.completed event. A session stays open until the customer pays or it expires.

Attributes

NameTypeDescription
idstringUnique identifier, starting cs_live_ or cs_test_.
objectstringAlways checkout_session.
livemodebooleantrue in live mode.
modeenumpayment: a one-time payment. subscription: its first payment starts a subscription. setup: sells nothing and saves the customer's card to charge later.
statusenumopen, complete or expired.
payment_statusenumpaid, unpaid or no_payment_required (a setup session).
ui_modeenumhosted_page: Sovgate's checkout page.
currencystringusd.
amount_totalintegerWhat the customer pays, in cents: the lines' total.
line_item_countintegerHow many lines it sells.
customerstring or nullThe customer it was opened for, cust_..., or null for a guest.
client_reference_idstring or nullYour own reference, such as an order number, as you sent it.
metadataobjectYour own key-value data, as you sent it.
urlstring or nullThe page to send your customer to. Returned only when the session is created; null after.
payment_linkstring or nullThe payment link that opened it, or null.
paymentstring or nullThe payment that completed it, pay_..., or null until one does.
attemptsintegerHow many payments were attempted in it. A declined card leaves it open for the next try.
createdtimestampWhen it was opened.
expires_attimestampWhen it stops taking a payment.
completed_attimestamp or nullWhen it was paid.
expired_attimestamp or nullWhen it expired unpaid.

Read a session from your server to check it was paid: Sovgate answers from its own record of the payment, so a session read as paid was paid. Fulfil the order once, by client_reference_id: the same event can arrive more than once.

Example

json
{  "id": "cs_test_8a34998a7056ac775cff7b78",  "object": "checkout_session",  "livemode": false,  "mode": "payment",  "status": "complete",  "payment_status": "paid",  "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": "pay_baa7f53c0bc0867df75250d9",  "attempts": 1,  "created": "2026-11-27T14:00:00Z",  "expires_at": "2026-11-28T14:00:00Z",  "completed_at": "2026-11-27T14:03:41Z",  "expired_at": null}

Endpoints

EndpointWhat it does
POST /v1/checkout/sessionsOpen a session with what you sell, and send your customer to its url.
GET /v1/checkout/sessions/{id}Get a session by the ID its creation returned, to check it was paid.
GET /v1/checkout/sessionsList your checkout sessions, newest first.
POST /v1/checkout/sessions/{id}/expireEnd an open session now, so it can no longer be paid.