Loading
Prepare for Email to Become the Default Login ExperienceRead More
Intermittent freezing when using using certain browser versionsRead More
Automate Your Business Processes with Salesforce Flow
Get Cart Items Action

Get Cart Items Action

In a B2B Commerce Checkout flow, get items in a cart.

Required Editions

Available in: Lightning Experience
View supported editions.
Note
Note Cart actions aren’t available in flows for B2B stores built on an Aura template. To build a B2B Commerce Checkout flow for an Aura store, see B2B Commerce Checkout Flow (Aura).

In Flow Builder, add an Action element to your flow. Select the Commerce category, and search for Get Cart Items. To access this action from REST API, use the name getCartItems.

Set Input Values

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

Input ParameterDescription
Cart ID The ID of the cart owned by the user.
Effective Account ID (Optional) The ID of the buyer account or guest buyer profile for which the request is made. If unspecified, the default value is determined from context.
User ID The ID of the buying user who owns the cart.
Web Store ID The ID of the store associated with the cart.

Store Output Values

Use output values later in the flow. The values are assigned when the item is created.

Output ParameterDescription
Cart Items An Apex ConnectApi.CartItemCollection record that includes a collection of line items in a cart.

Error Conditions

Error Condition Description

A required parameter hasn't been specified.

Error Message: You must specify a value for the {0} parameter. <!--Where 0 is the API name of the parameter that requires input.-->

Error Code: REQUIRED_FIELD_MISSING

HTTP Status Code: 400

The specified ID is invalid.

Error Message: Something's not right with the ID "{0}" specified for the {1} parameter. Check it and try again. <!--Where 0 is the invalid ID, and 1 is the API name of the input parameter with the invalid ID.-->

Error Code: INVALID_INPUT

HTTP Status Code: 400

The specified effective account ID is invalid for the account or guest buyer profile.

Error Message: The ID "{0}" specified for the {1} parameter isn't a valid {2} record. <!--Where 0 is the specified ID, and 1 is the API name of the parameter with the specified ID, and 2 is the name of the valid record type.-->

Error Code: INVALID_TYPE

HTTP Status Code: 400

The specified store or cart doesn’t exist.

Error Message: We couldn't find a record with the ID "{0}" specified for the {1} parameter. Check the record and try again. <!--Where 0 is the ID of the record that doesn't exist, and 1 is the parameter that the ID was specified for–>

Error Code: RECORD_NOT_FOUND

HTTP Status Code: 400

 
Loading
Salesforce Help | Article