Apply promo code
apply_promoValidate a promo code the human gave you and attach it to the cart. Returns applied=true with the new subtotal, discount, shipping and total, or applied=false with a reason — an invalid or expired code, or a bundle price in the cart that beats it (codes don't stack with bundle pricing). Codes are case-insensitive and a cart holds one: a valid new code replaces the current one, a rejected one leaves it in place; remove_promo just drops it. Needs at least one item in the cart. Never guess or try codes the human didn't give. The code is re-checked in get_order_preview and prepare_order.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "apply_promo"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Promo code exactly as the human gave it (case-insensitive). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Normalized promo code (when applied). | |
| error | No | Present when the cart is empty or code is missing. | |
| total | No | ||
| bundle | No | Bundle price that beats the code (when applied=false for that reason). | |
| reason | No | Why the code was rejected (when applied=false). | |
| applied | No | ||
| currency | No | ||
| discount | No | ||
| shipping | No | ||
| subtotal | No |