You are here:
Cart to Order Action
In a B2B Commerce Checkout flow, create a Salesforce standard order in draft mode.
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 Cart To Order . To access
this action from the API, use the name cartToOrderAction.
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. |
| runAsync | Execute the Cart to Order action asynchronously. |
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 B2BCommerceIntegrator 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 |
| 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
To use the B2B Commerce Cart to Order 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 is
CartStatusEnum.CHECKOUT. Session.IsProcessingisn’t set toFalse.Session.NextStateis set tocartToOrder.Session.Statecan’t be empty.- backgroundOperationId can’t be
NeworRunning.

