post

/carts

Creates a Cart.

Required Fields

  • line_items object
  • custom_items object – If adding a item that does not already exist in the store
  • gift_certificates object – Only if adding a gift certificate to for shopper purchase

Notes

Cart ID is generated in the response.

To create a redirect_url upon Cart creation use the query param: include=redirect_urls

A cart can be created using an existing catalog item, or by adding a custom item using Item Custom.

Cart ID is the same as the checkout ID.

Carts are valid for 30 days from the last modification. This can include creating the cart or editing the cart.

Redirect URLs can be generated only from carts created using the Server to Server Cart API. To restore a cart that was created on the storefront, either by a shopper or the Storefront Cart API, first recreate the cart using the Server to Server Cart API.

Authorization

apiKey - X-Auth-Client
apiKey - X-Auth-Token

Request Parameters

1 Query Parameter
2 Headers

Request Body

  1. Creating a cart by adding a simple product (a product without option selections)
  2. Creating a cart with a variant. This works when a product can be specified purely by a variant, without any other required options.
  3. With a variant and a checkbox and picklist modifier added.
  4. Using a Custom Item
4 Examples
Schema
object
customer_id
integer
line_items
array[object]
gift_certificates
array[object]

Responses

1 Example
Schema
object

A cart contains a collection of items, prices, discounts, etc… It does not contain customer-related data.

id
string

Cart ID, provided after creating a cart with a POST.

1 validation
parent_id
string

Bundled items will have their parent’s item Id.

customer_id
integer

ID of the customer to which the cart belongs.

email
string

The cart’s email. This is the same email that is used in the billing address

currency
object

This will always be the same between cart and checkout.

tax_included
boolean
base_amount
number

Cost of cart’s contents, before applying discounts.

discount_amount
number

Discounted amount.

cart_amount
number

Sum of line-items amounts, minus cart-level discounts and coupons. This amount includes taxes (where applicable).

coupons
array[object]
discounts
array[object]
line_items
array[object]
created_time
string

Time when the cart was created.

1 validation
updated_time
string

Time when the cart was last updated.

1 validation

Send a Test Request

Send requests directly from the browser (CORS must be enabled)
Path Params
1 path param not set
store_hash
$$.env
2 variables not set
X-Auth-Client
X-Auth-Token