B2B Checkout States
The CartCheckoutSession object manages checkout progress.
The State and NextState fields on CartCheckoutSession drive the progression through a checkout. State identifies and completes an async task, and NextState identifies the value that State automatically transitions to. The values are stored as strings, and the Checkout flow manages state transitions.
The BackgroundOperation object identifies the async checkout task running in the background and provides a status of the tasks. CartCheckoutSession.IsProcessing
also tracks whether the background operation is still processing, and CartCheckoutSession.IsError
indicates whether an error occurred during checkout.
In this example, State=Inventory
transitions to NextState=Confirm Price
, which confirms the price after inventory processing completes. InProcessing
indicates that a checkout task is operating in the background, and the checkout Wait Screen displays until the task is finished or canceled.
When an async task completes:
IsProcessing
is set tofalse
.- If an error occurs,
If error State
is set toError
, and NextState is set tonull
. - Else, NextState is copied to State.