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 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 cart object — not wrapped in a { status, type, data } envelope.

Request

Body Parameters

object
Object mapping variant IDs to new quantities. Set a quantity to 0 to remove that item.
string
Update the cart note
object
Update cart attributes (replaces existing attributes)
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 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 standard error body with the real HTTP status: