Update cart item
suppco_update_cart_itemDestructiveIdempotent
Set the quantity of a product that is already in the signed-in user's cart. quantity is the new total, not an amount to add, so repeating the call is safe; 0 removes the item. If the product is in the cart as both a one-time purchase and a subscription, set subscription to choose which one to change. Returns the updated cart.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quantity | Yes | New total number of units for this item. 0 removes it. | |
| subscription | No | true to change the subscription item, false for the one-time item. Only needed when the product is in the cart as both. | |
| product_id_or_slug | Yes | SuppCo product ID (UUID) or slug of a product in the cart, as shown by suppco_get_my_cart. |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart | Yes |