Loading
Prepare for Email to Become the Default Login ExperienceRead More
Automate Your Business Processes with Salesforce Flow
Check Cart Inventory Action

Check Cart Inventory Action

In a B2B Commerce Checkout flow, request a full inventory availability check of all line items in the cart.

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 Check Cart Inventory. To access this action from the API, use the name checkCartInventoryAction.

Set Input Values

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

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

Store Output Values

Output Parameter Description
backgroundOperationId The ID of the background operation that processes the total price of all items in the cart.

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 Cart

The buyer doesn’t own the cart, doesn’t have read access to the cart, or the cart isn’t shared with the buyer.

Error Code: BAD_REQUEST

HTTP Status Code: 400

The Cart Isn’t in the Checkout State

The cart status isn’t in the Checkout state and can’t continue.

Error Code: INVALID_OPERATION

HTTP Status Code: 403

Integration Is Already in Progress

Only one integration can be processed at a time. This error indicates when an integration is already running.

Error Code: ALREADY_IN_PROCESS

HTTP Status Code: 400

Account Associated With the Cart Isn’t Valid or Accessible

The effective account listed isn’t valid.

Error Code: INSUFFICIENT_ACCESS_OR_READONLY

HTTP Status Code: 500

User Isn’t a Member of the Store

The user isn’t a member of the store.

Error Code: INSUFFICIENT_ACCESS_OR_READONLY

HTTP Status Code: 500

Usage

This action runs asynchronously using the pricing service configured in StoreIntegratedService.

To use the B2B Commerce Check Cart Inventory 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 buyer has edit access to the cart.
  • The cart status isn’t Closed.
  • Session.IsProcessing isn’t set to False.
  • Session.NextState is set to CheckInventory.
  • Session.State can’t be empty.
  • backgroundOperationId can’t be New or Running.
 
Loading
Salesforce Help | Article