Skip to main content
POST
Create a checkout session

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Headers

Alguna-Version
enum<string>
required
Available options:
2026-04-01
Idempotency-Key
string

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.

Maximum string length: 255
Example:

"ik_a1b2c3d4e5f6"

Body

application/json
amount
string | null

Total amount to charge when neither plan_id nor line_items are provided

Example:

"99.00"

checkout_intent
enum<string> | null

payment charges the customer; vault only collects and stores a payment method. Defaults to payment.

Available options:
payment,
vault
Example:

"payment"

client_reference_id
string | null

Your own reference for this checkout (order ID, cart ID). Echoed on the session and the checkoutsession.completed webhook.

Example:

"order_1234"

currency
string | null

ISO 4217 currency code; defaults to the organization currency

Example:

"USD"

customer
object | null

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.

customer_alias
string | null

Alternative identifier (external ID) for the customer. Used when customer_id is not provided.

Example:

"ext_39003209203023902"

customer_id
string | null

Customer the checkout is for. Omit for guest checkout and pass customer instead — the customer account is created when checkout completes.

Example:

"cust_abc123"

expires_in_seconds
integer<int64> | null

Session lifetime in seconds (5 minutes to 7 days). Defaults to 86400 (24 hours).

Example:

86400

Legal entity to bill from. Defaults to the customer's legal entity, falling back to the organization default.

Example:

"le_01H1VECT"

line_items
object[]

Ad-hoc line items to charge instead of a plan. Mutually exclusive with plan_id.

plan_id
string | null

Plan to check out. The session's line items and amount are derived from the plan's prices. Mutually exclusive with line_items.

Example:

"plan_01H1VECT"

success_url
string | null

URL the customer can be sent to after a successful checkout

Example:

"https://example.com/welcome"

Response

Success

checkout_intent
enum<string>
required

Whether the session charges the customer or only stores a payment method

Available options:
payment,
vault
Example:

"payment"

created_at
string<date-time>
required

Timestamp when the session was created

Example:

"2026-04-01T10:00:00Z"

currency
string
required

ISO 4217 currency code

Example:

"USD"

id
string
required

Unique identifier for the checkout session

Example:

"chks_01H1VECT"

session_token
string
required

Browser-safe token that scopes the embedded checkout to this session. Pass it to the Alguna Checkout SDK.

Example:

"elt_01H1VECT"

status
enum<string>
required

Checkout session status

Available options:
created,
started,
successful,
expired
Example:

"created"

url
string
required

Hosted checkout URL for this session. The Alguna Checkout SDK embeds this URL; it can also be used directly as a redirect target.

Example:

"https://acme.alguna.io/embed/checkout/elt_01H1VECT"

amount
string | null

Total amount for the session

Example:

"99.00"

client_reference_id
string | null

Your reference supplied at creation

Example:

"order_1234"

customer_id
string | null

Customer the checkout is for, once known

Example:

"cust_abc123"

expires_at
string<date-time> | null

Timestamp when the session token expires

Example:

"2026-04-02T10:00:00Z"

invoice_id
string | null

Invoice created by the session, once completed. One-off sessions (line_items or amount) produce a paid invoice instead of a subscription.

Example:

"inv_01H1VECT"

payment_id
string | null

Payment created by the session, once completed

Example:

"pay_01H1VECT"

subscription_id
string | null

Subscription created by the session, once completed

Example:

"sub_01H1VECT"