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

Cancel Cart Async Operation Action

In a B2B Commerce Checkout flow, cancel the current checkout so the user can return to an unlocked cart. This operation automatically runs when cart changes are invoked, such as add to 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 Cancel Cart Async Operation. To access this action from the API, use the name cancelCartAsyncOperation.

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.

Error Conditions:

Error Condition Description
Cancel a Closed Cart

A cart can’t be canceled after it’s closed.

Error Code: INVALID_OPERATION

HTTP Status Code: 403

Usage:

To use the B2B Commerce Cancel Cart Async Operation, 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 can’t be Closed.
  • There’s an active CartCheckoutSession associated with the cart.
  • There’s a valid BackgroundOperationId.

When the Cancel Cart Async Operation runs, these API interactions occur.

  • The background operation is marked as canceled.
  • The cart transitions to the Active state, unlocking the cart for more updates.
  • If it exists, the CartCheckoutSession object is archived.
 
Loading
Salesforce Help | Article