Cart
cart_add
Add one item to an open cart.
One call per item. Restaurant dishes with required choices (size, sides) need the buyer's picks.
| Type | Write: changes a cart or an order |
| Needs a cart the buyer approved | No |
| Moves money | No |
Tool description (what the assistant sees)
Adds one shop offer to an open cart. One cart holds one shop; restricted categories and quantities above available stock are refused. Restaurant items with required options need modifiers, and the error lists the available choices. Nothing is reserved or charged.#Parameters
| Name | Type | Required | Description |
|---|---|---|---|
cart_id | uuid | Yes | The cart. |
product_id | uuid | Yes | The offer, from a search result. |
qty | integer | No | How many, 1 to 99. Left out: 1. |
weight_lb | number | No | For items sold by weight (sold_by: weight in search results): how many pounds, in 0.25 lb steps. Left out: ask by count with qty. |
modifiers | object[] | No | Menu options for restaurant items, listed under modifier_groups in search results. One entry per group: group_id and the option_ids the buyer picked. Every required group needs an answer. |
note | string | No | Restaurant items only: the buyer's short note for this item, such as "No onions". At most 140 characters. |
substitution_policy | string | No | never_substitute, ask_first or auto_similar. |
#Notes
- A required option group left out comes back as
MISSING_FIELDonmodifiers, with the groups and their choices. Ask the buyer; never send the example call as it is. - Adding an item clears any approval the cart already had.