post

/carts

Creates a Cart.

Required Fields

  • line_items object
  • gift_certificates object – only if adding a gift certificate

Notes

Cart ID is generated in the response.

To add a product with a mix of variants and options, add optionSelections to the lineItems object. optionSelections accepts optionId and optionValue.

The redirect url endpoint does not work using the Storefront Cart. At this time, shoppers can not be directed to any carts or checkouts created using the Storefront APIs.

Request Parameters

1 Query Parameter

Request Body

4 Examples
Schema
object
lineItem
object
giftCertificate
object

Responses

Schema
object

A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data. Custom Items is a read only field. A custom item can only be added to a cart using the Server to Server Cart API.

id
string

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

1 validation
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.

isTaxIncluded
boolean

Whether this item is taxable.

baseAmount
number

Cost of cart’s contents, before applying discounts.

discountAmount
number

Discounted amount.

1 validation
cartAmount
number

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

coupons
array[object]

Array of AppliedCoupon objects applied to this cart.

discounts
array[object]

Array of AppliedDiscount objects applied to this cart.

lineItems
array[object]

Array of LineItem objects.

createdTime
string

Time when the cart was created.

1 validation
updatedTime
string

Time when the cart was last updated.

1 validation

Send a Test Request

Send requests directly from the browser (CORS must be enabled)
$$.env
1 variable not set
store_domain