# Update a cart (/api/carts/update-cart)

`POST https://api.comecero.com/api/v1/carts/{cart_id}`

Changes a cart. Only the fields you send change, but `items` replaces all items. Prices, tax, shipping and promotions are worked out again. Any token type may call it; a limited token only for a bound cart. A closed cart cannot change (`422`). `order_id` can only be set on create. A limited token may not set `reference_price` (`403`, error `m82tixT`).

## Parameters

- `cart_id` (path, required): The id of the cart.
- `expand` (query): Comma-separated child objects to return in full instead of as a URL, for example `customer,payments`. Use dot notation for nested objects (`items.product`), up to four levels deep. A single object takes up to 12 paths; a list takes up to 2, applied to every item. Extra paths are dropped without an error. See [Expanding objects](https://docs.comecero.com/docs/basic-concepts/expanding-objects).
- `show` (query): Comma-separated fields to return; all others are left out. Use dot notation for child fields (`customer.email`). You cannot send `show` and `hide` together (`400`). See [Customizing output](https://docs.comecero.com/docs/basic-concepts/customizing-output).
- `hide` (query): Comma-separated fields to leave out of the response. Use dot notation for child fields (`customer.email`). You cannot send `show` and `hide` together (`400`). See [Customizing output](https://docs.comecero.com/docs/basic-concepts/customizing-output).
- `formatted` (query): When `true`, the object also has a `formatted` child with amounts and dates as display text in the shopper's language and currency (for example `$19.99` or `November 7, 2026`). The default is `false`. See [Localized formatting](https://docs.comecero.com/docs/basic-concepts/localized-formatting).
- `timezone` (query): An IANA time zone name, such as `America/New_York` or `UTC`. It sets how `date_start` and `date_end` are read and the time zone of every date in the response. The default is the account's time zone (Settings, Technical), or UTC when it has none. A name that is not known is a `400`.
- `max_cross_sells` (query): How many cross-sell offers to return when `cross_sells` is expanded, 0 to 10. Default 3.
- `max_up_sells` (query): How many up-sell offers to return when `up_sells` is expanded, 0 to 10. Default 3.
- `user_ip_address` (query): The shopper's IP address, when your server calls with a secret token on the shopper's behalf. Comecero uses it for fraud checks and to find the shopper's country. Only read for a secret token: for every other token the address the request comes from is used. A value that is not a valid IPv4 or IPv6 address is ignored.

Request body: the `cart_request` schema.

Responses: 200, 400, 401, 403, 404, 422, 500.

Full schemas: operation `update_cart` in /openapi.json.