Skip to main content
POST
Update Cart

Update Cart

Updates quantities of items in the cart, or updates the cart note, attributes, and discount codes.
Cart update 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

Body Parameters

updates
object
Object mapping variant IDs to new quantities. Set a quantity to 0 to remove that item.
note
string
Update the cart note
attributes
object
Update cart attributes (replaces existing attributes)
discount
string
Discount code(s) to apply. Accepts a single code or comma-separated codes. Pass an empty string to clear all applied discount codes.

Response

The response is the flat Shopify cart object (the same shape returned by Get Cart), reflecting the updated cart. For quantity updates the response also includes an items_changelog object ({ added, removed }).

Example Response

Updating Cart Note, Attributes, and Discounts

Errors

On failure the endpoint returns a Shopify-style error body with the real HTTP status: