Skip to main content

Checkout Session Object

A checkout session represents a temporary payment intent created when you redirect customers to Gale’s hosted checkout page. When the customer completes payment, the session converts to an Order.
All monetary amounts are integers in cents (e.g., 4995 = $49.95).
Checkout sessions are ephemeral β€” they expire after 24 hours. The Order object is your permanent payment record.

The Checkout Session Object

Attributes

Line Item Attributes

Checkout Session Status

Checkout Type

Gale automatically determines the type based on product eligibility:

Lifecycle

When status becomes paid:
  • An Order is created
  • order_id field is populated
  • order.created webhook fires
  • Customer redirects to success_url

Tracking Checkout Status

Response when open:
Response when paid:
Once paid, query the Order for full payment details:

Amounts Object

Gale automatically calculates how much can be paid with HSA/FSA vs regular payment methods based on product eligibility.

Subscription Sessions

For subscription checkouts, include subscription details:
When paid, creates both an Order and a Subscription object.
Subscription checkout is currently in Beta.

Webhooks

Checkout sessions trigger these webhooks:
  • order.created β€” Payment succeeded, order created (this is what you should listen to)
  • order.failed β€” Payment failed
Note: Listen to order.created to confirm payment.

Best Practices

Don’t poll for status β€” Use webhooks instead:
Sessions expire β€” Don’t store checkout URLs. Create new sessions for each purchase attempt. Order is your source of truth β€” Once paid, always reference the Order object, not the checkout session.