Documentation
Checkout

Checkout Lifecycle

Understand how Checkout Sessions, Invoices, redirects, and webhooks relate.

Checkout Lifecycle

A Checkout Session and an Invoice describe different stages of one payment attempt.

flowchart LR
  A[Checkout Session OPEN] -->|Buyer chooses network and token| B[PROCESSING]
  B -->|Invoice created| C[Checkout Session COMPLETED]
  B -->|Creation failed safely| A
  A -->|Session timeout| D[Checkout Session EXPIRED]
  C --> E[Invoice PENDING]
  E -->|Funds detected| F[Invoice CONFIRMING]
  F -->|Enough amount and confirmations| G[Invoice SUCCESS]
  E -->|Invoice timeout| H[Invoice EXPIRED]

Checkout Session status

StatusMeaning
OPENThe hosted checkout can create its Invoice
PROCESSINGOne request is atomically creating the Invoice
COMPLETEDThe session is linked to an Invoice; payment may still be pending
EXPIREDNo new Invoice can be created from this session

The same Checkout Session can create at most one Invoice. Repeated browser submits return the already-linked Invoice instead of creating a second payment address.

Which identifier should you store?

Store all three when available:

IdentifierOwnerPurpose
merchantOrderIdYour systemStable lookup of your order
checkoutSessionIdYolfi checkoutCorrelates redirect, checkout attempt, and webhook
invoiceIdYolfi paymentTracks the blockchain payment lifecycle

successUrl may include {CHECKOUT_SESSION_ID} for confirmation-page state. Never fulfill from that redirect. Fulfill only after verifying and processing payment.confirmed idempotently.

On this page