Change basket
update_basketUse this to change the quantity of a product in the teas.co.uk basket. quantity is the new total from 0 to 99, not an amount to add, and 0 removes the line; id is the product id of the line (from view_basket or add_to_basket). If the product is not in the basket yet, a quantity above 0 adds it and 0 does nothing; an id teas.co.uk does not know, or an increase past the 20 kg parcel limit, is reported in messages and the basket stays as it was. With no basket at all it returns an error. Setting the same quantity again changes nothing. Returns the updated basket with the live subtotal and a delivery estimate; nothing is bought or charged. To add new products use add_to_basket, and to see the basket first use view_basket.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Product id of the basket line to change (from view_basket or add_to_basket). | |
| quantity | Yes | The new quantity; 0 removes it. | |
| basket_id | No | Only for hosts that do not identify the user: the basket_id returned by an earlier basket tool in this conversation. Leave it out otherwise. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Number of items in the basket. | |
| lines | Yes | ||
| delivery | Yes | ||
| messages | Yes | Anything that could not be added or changed, in plain words. | |
| subtotal | No | Pounds including VAT, before delivery. | |
| basket_id | No | Present only when the host did not identify the user: pass it to later basket tools. | |
| subtotal_text | Yes |