Skip to navigation

Retrieve a Checkout Session

Returns a Checkout Session’s current state. Use it to confirm the outcome when the Customer lands on your successUrl with session_id, or to check a webhook you missed. Only sessions created with a key of the same Merchant and mode are visible; anything else is 404.

Authentication

AuthorizationBearer

Your secret key: sk_test_… in Test mode, sk_live_… in Live mode.

Path parameters

idstringRequired
Checkout Session identifier.

Response

The Checkout Session's current state.
idstring
Checkout Session identifier.
statusenum

pending until the Customer pays or the session ends. succeeded: paid, safe to fulfil. failed: the payment was declined or didn’t go through. cancelled: you cancelled it or it expired unpaid. Only pending ever changes, and each change sends the matching checkout_session.* webhook.

Allowed values:
modeenum

test for a session made with an sk_test_ key, live for an sk_live_ key. Webhook endpoints each hear one mode, and the payload says which it came from.

Allowed values:
amountinteger

Amount to charge, in FJD cents (minor units).

currencyenum
Always FJD in v1.
Allowed values:
hostedUrlstring

Transxact-hosted URL to redirect the Customer to.

metadatamap from strings to strings

Your own key/value data from creation; empty object if none was set.

expiresAtinteger

Unix ms timestamp after which no payment can start; a still-pending session is then cancelled.

invoiceNumberstringOptional

The Invoice number, such as INV-0007, when the session pays one of your Invoices; absent otherwise. Also in the webhook payload.

quoteobjectOptional

Present when you created the session with a quote: the USD or AUD price you sent, the FJD rate it was converted at (a decimal string), and the Unix ms time the rate was taken. amount is the FJD that is charged. Never shown to the Customer.

Errors

401
Unauthorized Error
404
Not Found Error