You are here:
Calculate Cart Shipment Costs Action
In a B2B Commerce Checkout flow, request the shipping costs of all line items within 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 Calculate Cart Shipment
Costs. To access this action from the API, use the name calcCartShipmentAction.
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 |
|---|---|
| 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 |
| 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 is executed asynchronously using the pricing service configured in StoreIntegratedService.
To use the B2B Commerce Check Cart Shipment Cost 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.IsProcessingisn’t set toFalse.Session.NextStateis set toDeliveryMethod.Session.Statecan’t be empty.- backgroundOperationId can’t be
NeworRunning.

