This service provides management of the cart and checkout workflows. It handles:
Logic for adding, updating, and removing cart items along with any corresponding validation
Adding or removing promo codes, fulfillment info, and payment methods
Processing the final checkout submission
Validating configurable items
Validating and confirming payments
Validating fulfillment info
Validating and decrementing inventory
However, it does not provide the actual persistence facilities—those are deferred to the Cart Services through the CartProvider
component.
Moreover, catalog, pricing, and inventory info are also handled through their respective providers—anything that requires a persistent store.
Cart Operation is primarily used through CartOperationEndpoint
and CheckoutEndpoint
.
CartOperationEndpoint
handles requests for managing the cart’s items, attributes, and promo codes while CheckoutEndpoint
handles updating contact, fulfillment, and payment information as well as the final checkout submission.
Tip
|
See the Cart Operation API spec for request and response details. |
Carts are resolved and operated upon using the ID of the Cart.
Once a cart is created for a customer, the Cart ID can be saved for later retrievals and operations using the ManageCartEndpoint
.
For registered customers, an in-progress cart may be retrieved by using the ResolveCartEndpoint
after they sign-in.
Learn more about Cart resolution.
Cart Operation also allows management of ItemLists
that can be used for simple lists of items like wishlists that do not require all of the overhead that goes with a cart.
Lists are primarily used through ItemListOperationEndpoint
and ItemListItemOperationEndpoint
.
Tip
|
See the Item List and Item List Item API specs for other request and response details. |
The ItemListOperationEndpoint
even exposes a method to add entire lists to a customer’s cart in one call.
POST /cart/{cartId}/item-lists
{
"itemListIds": [
"item-list-1",
"item-list-2",
"item-list-3"
]
}
{
"cart": {},
"inaccessibleItemListIds": [ "item-list-2" ],
"failedItemAdditions": {
"item-list-1": [ "item-2" ],
"item-list-3": [ "item-1", "item-4" ]
}
}
For those not using the Order Services, Cart Operations provides a CartHistoryEndpoint
to allow reading historical, submitted carts for customers or by order number.
Tip
|
See the Cart History API spec for request and response details. |