HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

cart

This topic explains how to communicate with the cart API.

The cart API lets you manipulate carts in Optimizely Customized Commerce. There are two sets of endpoints which require different levels of permissions. When using the /carts endpoints you, must have the CustomerServiceRepresentatives role. When using the /me/cart endpoints, you have access to create and modify only your own carts. For both sets of endpoints you can use either the cartId integer or the customerId, cartName, and marketId to manipulate the carts.

Endpoints

GETapi/episerver/v3.0/carts/{cartId}Gets a cart by integer primary key.
GETapi/episerver/v3.0/carts/{customerId}/{cartName}/{marketId}/{createIfNotExist:bool?}Gets a cart by customer id, cart name and market id. Last parameter is optional boolean to create cart if does not exist.
GETapi/episerver/v3.0/me/cart/{cartId}Gets a cart by integer primary key for current user.
GETapi/episerver/v3.0/me/cart/{customerId}/{cartName}/{marketId}/{createIfNotExist:bool?}Gets a cart by customer id, cart name and market id for current user. Last parameter is optional boolean to create cart if does not exist.
POSTapi/episerver/v3.0/cartsCreate new cart as per provided model.
POSTapi/episerver/v3.0/me/cartCreate new cart as per provided model for current user
PUTapi/episerver/v3.0/cartsUpdates an existing cart or creates new cart as per provided model.
PUTapi/episerver/v3.0/me/cartUpdates an existing cart or creates new cart as per provided model for current user.
DELETEapi/episerver/v3.0/carts/{cartId}Deletes a cart as per given cartId.
DELETEapi/episerver/v3.0/carts/{customerId}/{cartName}/{marketId}Deletes a cart by customer id, cart name and market id.
DELETEapi/episerver/v3.0/me/cart/{cartId}Deletes a cart as per given cartId for current user.
DELETEapi/episerver/v3.0/me/cart/{customerId}/{cartName}/{marketId}Deletes a cart by customer id, cart name and market id for current user.
POSTapi/episerver/v3.0/carts/searchSearch carts using search filter object as body.
POSTapi/episerver/v3.0/me/cart/searchSearch carts using search filter object as body for current user.
POSTapi/episerver/v3.0/carts/{cartId}/converttoorderCreates an order for specified cart, returns an order model and location for the resource created in the header.
POSTapi/episerver/v3.0/carts/{customerId}/{cartName}/{marketId}/converttoorderCreates an order for specified cart, returns an order model and location for the resource created in the header.
POSTapi/episerver/v3.0/me/cart/{cartId}/converttoorderCreates an order for specified cart for current user and returns an order model and location for the resource created in the header.
POSTapi/episerver/v3.0/me/cart/{customerId}/{cartName}/{marketId}/converttoorderCreates an order for specified cart for current user and returns an order model and location for the resource created in the header.
POSTapi/episerver/v3.0/carts/{cartId}/preparecheckoutValidates specified cart and returns information related to cart totals and validation messages.
POSTapi/episerver/v3.0/carts/{customerId}/{cartName}/{marketId}/preparecheckoutValidates specified cart and returns information related to cart totals and validation messages.
POSTapi/episerver/v3.0/me/cart/{cartId}/preparecheckoutValidates specified cart for current user and returns information related to cart totals and validation messages.
POSTapi/episerver/v3.0/me/cart/{customerId}/{cartName}/{marketId}/preparecheckoutValidates specified cart for current user and returns information related to cart totals and validation messages.