Skip to main content
POST
Create Cart

Authorizations

X-Authorization
string
header
required

Body

application/json
cart
(integer | object)[]
required

An array of product variants.

A product variant, provided either as a plain variant ID or as an object with a variant_id.

Example:

39076568408247

shopify
string

A Base64-encoded cart snapshot, used to reflect additional transaction details from the commerce provider (e.g. Shopify) such as automatic discounts. Optional — most integrations can omit it.

Loop only consumes this snapshot server-side when the shop is configured to use Shopify Scripts. When decoded, it is a JSON object shaped like a subset of the Shopify Ajax cart (/cart.js), including currency, total_price, total_discount, cart_level_discount_applications, and per-line items[]. Headless storefronts that don't use Shopify Scripts should omit this field.

Example:

"c2FtcGxlLXN0cmluZw=="

Response

Success

token
string

The cart's unique identifier.

Example:

"46923497728c9a7b5o8a433zz5c0bbbb683319824778"

data
object

Echoes the contents of the create request.