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.

BackgroundOperation object diagram

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.

Process inventory example diagram

When an async task completes:

  • IsProcessing is set to false.
  • If an error occurs, If error State is set to Error, and NextState is set to null.
  • Else, NextState is copied to State.