Skip to main content
GET
Get Cart

Get Cart

Returns the current cart for the visitor.
The cart is a storefront surface, not part of the OAuth /api/v1 app API. It follows the Shopify-AJAX cart contract: requests are made against the storefront origin (your store domain), identity is the cart cookie token (not a Bearer access token), and the response is the flat Shopify cart object — not wrapped in a { status, type, data } envelope.

Request

GET /cart.js returns the current cart as JSON. The cart is identified by the cart cookie that the storefront sets on the first write action; send it with the request (browsers do this automatically).

Response

The response is the flat Shopify cart object. Money fields are integers in the store’s currency subunit (e.g. cents).
token
string
Unique cart token (matches the cart cookie)
items
array
Array of line items
item_count
integer
Total number of items
total_price
integer
Cart total in the currency subunit
currency
string
Currency code
requires_shipping
boolean
Whether any items require shipping
note
string
Cart note
attributes
object
Cart attributes (key-value pairs)

Example Response

An empty cart returns item_count: 0 with an empty items array.

Errors

If the store context cannot be resolved, the endpoint returns a Shopify-style error body with the real HTTP status: