Loading
Prepare for Email to Become the Default Login ExperienceRead More
Automate Your Business Processes with Salesforce Flow
Checkout Session Action

Checkout Session Action

In a B2B Commerce Checkout flow, get or create a checkout session, and return the ID of the session to the caller.

Required Editions

Available in: Lightning Experience
View supported editions.

In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and search for Checkout Session Action. To access this action from the API, use the name checkoutSessionAction.

Set Input Values:

Use values from earlier in the flow to set the inputs.

Input Parameter Description
cartId The ID of the cart that transitions into a checkout.

Store Output Values:

Output Parameter Description
requestId The ID of the request that processes and then either creates or returns the Checkout Session.

Error Conditions:

Error Condition Description
Invalid CartId Input

The cart ID value isn’t accepted.

Error Code: UNKNOWN_EXCEPTION

HTTP Status Code: 500

User Can’t Invoke Action

The caller doesn’t have the appropriate permissions to call the action, including the MAD or B2B Commerce Integrator user perms.

Error Code: BAD_REQUEST

HTTP Status Code: 400

User Doesn’t Have Access to the Effective Account

The user doesn’t have access to the effective account either because it isn’t a buyer account or they don’t have permission to buy for the account.

Error Code: BAD_REQUEST

HTTP Status Code: 400

User Account Isn’t Associated With the Store

The current logged-in buyer account isn’t associated with the store and therefore isn’t a store member.

Error Code: BAD_REQUEST

HTTP Status Code: 400

Cart Is Already in Progress

The requested cart is already being processed.

Error Code: BAD_REQUEST

HTTP Status Code: 400

The Session Wasn’t Created

The session wasn’t created due to an internal service error.

Error Code: UNKNOWN_EXCEPTION

HTTP Status Code: 500

Usage:

To use the B2B Commerce Checkout Session Action, these requirements apply.

  • The user has the appropriate permissions to invoke the action.
  • The effective account is valid.
  • The buyer account is a member of the store.
  • The cart status is set to Active or Checkout.
  • The cart must not have any current, active session.

When the Checkout Session Action runs, these API interactions occur.

  • The cart transitions to the Checkout state, preventing more updates to the cart.
  • If it doesn’t exist already, the CartCheckoutSession object is created.
  • All errors that are mapped to the input cartId, on the CartValidationOutput object, are cleared.
 
Loading
Salesforce Help | Article