1. Shopping cart service

Cart commands and pipelines

Version:

The following table describes the commands and pipelines pertaining to the Cart entity:

Command/Pipeline

Description

GetCartCommand

GetCartPipeline

Retrieves the cart record. If the cart does not exist it returns an empty cart.

Parameter:

  • cartId: the cart identifier (string)

MergeCartsCommand

MergeCartsPipeline

Merges two cart records. For example a customer initially creates a cart as an anonymous user, then authenticates and creates another cart. This action merges the previously anonymous cart into the authenticated cart and recalculates the cart.

Parameters:

  • fromCartId: cart record that data is merged from (string)

  • toCartId: cart record that data is merged to (string)

AddCartLineCommand

AddCartLinePipeline

Create a new cart line in the cart and recalculates the cart.

Parameters:

  • cartId: unique identifier for cart.

  • cartLineId: unique identifier for the cart line.

AddEmailToCartCommand

AddEmailToCartPipeline

Adds the shopper email to the cart.

Parameters:

  • cartID: the unique identifier for the cart.

  • email: email address associated with the cart.

UpdateCartLineCommand

UpdateCartLinePipeline

Updates a cart line within a Cart, for example updates its identifier or quantity, and recalculates the cart.

Parameters:

  • cartId: the unique identifier for the cart (string)

  • cartLineId: the unique identifier for the cart line (string)

  • quantity: the quantity of cart line items to add (decimal)

RemoveCartLineCommand

RemoveCartLinePipeline

Removes a single cart line from a Cart. Recalculates the cart.

Parameters:

  • cartId: the unique identifier for the cart (string)

  • cartLineId: the unique identifier for the cart line (string)

The following table describes the actions performed on a cart in the special case when an order is put on hold. When an order is put on hold and modified, the Commerce Engine modifies the cart that created the order.

Action

Description

AddLineItem

Adds a cart line item to an order that is on hold.

Parameters:

  • orderId: the identifier of the order

  • itemId: the identifier of the cart line item to add to the order

  • quantity: quantity of the line item to add

EditLineItem

Edits a cart line item of an order that is on hold.

Parameters:

  • orderId: the identifier of the order

  • itemId: the identifier of the cart line item to edit

  • quantity: quantity of the line item to edit

DeleteLineItem

Deletes a cart line item of an order that is on hold.

Parameters:

  • orderId: the identifier of the order

  • itemId: the identifier of the cart line item to delete

The following are general pipelines that extend other cart pipelines:

  • CalculateCartPipeline

  • CalculateCartLinesPipeline

  • GetCartPipeline

  • GetCartListPipeline

  • PopulateLineItemPipeline

  • PopulateValidateCartPipeline

If you have suggestions for improving this article, let us know!