Checkout Sessions

Checkout Types

CheckoutSession — the response shape returned by every Checkout Sessions API endpoint.

Schemas returned by the Checkout Sessions API and embedded inside Webhook payloads.

CheckoutSession

FieldTypeDescription
idCheckoutSessionIdUnique session identifier.
urlstringHosted checkout page URL. Redirect your customer here.
statusCheckoutSessionStatusThe session's lifecycle state. See CheckoutSessionStatus.
activebooleanDeprecated — prefer status. true if the session has not expired.
customerIdCustomerId / nullDecal customer ID if one is attached.
orderOrderThe full order object.
failedAttemptsintegerNumber of times a payment-processor failed to capture the payment on this session.
requireFromCustomerCheckoutRequireFromCustomer / nullInputs the customer must provide before payment, or null if none were required.
successUrlstring/nullWhere the customer is sent after a successful payment.
callbackUrlstring/nullWebhook URL for payment events.
expiresAtDateTimeWhen the session expires.
createdAtDateTimeWhen the session was created.
updatedAtDateTimeWhen the session was last modified.

failedAttempts only counts payment-processor rejections — card declined, insufficient funds, on-chain transaction failure, or processor API error. It does not count validation errors (e.g. malformed card details) or user-cancelled flows. Per-attempt detail (reason, timestamp, method) is not currently exposed via the public API.

CheckoutSessionStatus

The lifecycle state of a checkout session, returned as the status field on every CheckoutSession. It is a string union:

type CheckoutSessionStatus =
  | "pending"
  | "processing"
  | "completed"
  | "failed"
  | "expired"
  | "completed_externally";
ValueTerminalDescription
pendingNoSession created and awaiting payment. This is the initial state.
processingNoA payment has been submitted and is being confirmed (e.g. awaiting on-chain settlement).
completedYesPayment was received through Decal and the order is paid.
failedYesA payment attempt failed and the session was not completed.
expiredYesThe session passed its expiresAt window without a completed payment.
completed_externallyYesThe order was paid outside Decal (e.g. at the register via a connected POS) and the session was reconciled as such.

Terminal states are final — a session in completed, failed, expired, or completed_externally will not transition again. The deprecated active boolean is true only while status is pending or processing and the session has not yet expired.

CheckoutRequireFromCustomer

Declares which inputs the hosted checkout page must collect from the customer before it will accept payment. Set the flags you need to true when creating a session via the requireFromCustomer request field; the same object is echoed back on the CheckoutSession response, or null if no inputs were required. Every field is optional and defaults to false.

interface CheckoutRequireFromCustomer {
  phone?: boolean;
  shippingAddress?: boolean;
  location?: boolean;
}
FieldTypeWhen true, the customer must provide
phonebooleanA phone number. Returned on the paid order as order.customer.phone.
shippingAddressbooleanA full shipping address. Returned on the order as order.shippingAddress.
locationbooleanMinimal location data — country and postal code — used for compliance and jurisdiction screening. Returned on the order as order.customer.location.

A value you already supply at session creation pre-satisfies the matching requirement, so the customer is not prompted for it again — e.g. passing customer.phone satisfies phone, and passing a shippingAddress satisfies both shippingAddress and location. When a flag is omitted or false, that input is simply optional on the checkout page.