Create a checkout session
Creates a checkout session and returns a browser-safe session token plus a hosted checkout URL. Embed the URL with the Alguna Checkout SDK, or redirect the customer to it directly. The session charges a plan’s prices, ad-hoc line items, or a bare amount, and expires after expires_in_seconds.
Authorizations
API key authentication. Pass your API key as a Bearer token.
Headers
2026-04-01 A unique string used to ensure the request is processed exactly once. If you retry a request with the same idempotency key within 24 hours, the original response is returned without re-executing the operation.
255"ik_a1b2c3d4e5f6"
Body
Total amount to charge when neither plan_id nor line_items are provided
"99.00"
payment charges the customer; vault only collects and stores a payment method. Defaults to payment.
payment, vault "payment"
Your own reference for this checkout (order ID, cart ID). Echoed on the session and the checkoutsession.completed webhook.
"order_1234"
ISO 4217 currency code; defaults to the organization currency
"USD"
Details the customer account is created from when checkout completes. When neither this nor customer_id/customer_alias is provided, the embedded checkout collects them from the customer.
Alternative identifier (external ID) for the customer. Used when customer_id is not provided.
"ext_39003209203023902"
Customer the checkout is for. Omit for guest checkout and pass customer instead — the customer account is created when checkout completes.
"cust_abc123"
Session lifetime in seconds (5 minutes to 7 days). Defaults to 86400 (24 hours).
86400
Legal entity to bill from. Defaults to the customer's legal entity, falling back to the organization default.
"le_01H1VECT"
Ad-hoc line items to charge instead of a plan. Mutually exclusive with plan_id.
Plan to check out. The session's line items and amount are derived from the plan's prices. Mutually exclusive with line_items.
"plan_01H1VECT"
URL the customer can be sent to after a successful checkout
"https://example.com/welcome"
Response
Success
Whether the session charges the customer or only stores a payment method
payment, vault "payment"
Timestamp when the session was created
"2026-04-01T10:00:00Z"
ISO 4217 currency code
"USD"
Unique identifier for the checkout session
"chks_01H1VECT"
Browser-safe token that scopes the embedded checkout to this session. Pass it to the Alguna Checkout SDK.
"elt_01H1VECT"
Checkout session status
created, started, successful, expired "created"
Hosted checkout URL for this session. The Alguna Checkout SDK embeds this URL; it can also be used directly as a redirect target.
"https://acme.alguna.io/embed/checkout/elt_01H1VECT"
Total amount for the session
"99.00"
Your reference supplied at creation
"order_1234"
Customer the checkout is for, once known
"cust_abc123"
Timestamp when the session token expires
"2026-04-02T10:00:00Z"
Invoice created by the session, once completed. One-off sessions (line_items or amount) produce a paid invoice instead of a subscription.
"inv_01H1VECT"
Payment created by the session, once completed
"pay_01H1VECT"
Subscription created by the session, once completed
"sub_01H1VECT"