Update cart line
update_cart_itemModify an existing cart line by zero-based index: set quantity (0 removes it) or change size/fabric to re-price the line; re-read the cart after removal.
Instructions
Change one line already in the cart, addressed by its zero-based index from view_cart: set qty (0 removes the line; max 99) and/or switch size or fabric, which re-prices the line. Pass only what changes. After a removal the lines below move up one index, so re-read view_cart before the next edit. A bad index or an unavailable size/fabric returns an error (with the sizes on offer) and changes nothing. Returns the updated cart. To add a different product use add_to_cart.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qty | No | New quantity; 0 removes the line. | |
| size | No | New size for this line (must be available for the product). | |
| index | Yes | Zero-based cart line index from view_cart. | |
| fabric | No | New fabric for this line (must be available for the product). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present instead of a cart when the call failed (bad index, unavailable size, ...). | |
| items | No | Cart lines in index order — this index is what update_cart_item takes. | |
| currency | No | ||
| subtotal | No | Sum of price x qty over all lines, USD. | |
| checkout_url | No | Cart page URL for the human. |