Update discount
update_discountPartially update a discount's value, schedule, status, usage limit, or currency minimums while preserving code, type, and currency once the discount has been used.
Instructions
Update a discount (partial). code/type/currency become immutable once the discount has been used. A code with any minimum (minSubtotal for the default currency, minSubtotalByCurrency for additional currencies) applies only in the currencies those minimums name.
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": {
"idOrSlug": "<idOrSlug>"
},
"name": "update_discount"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| type | No | ||
| value | No | ||
| endsAt | No | ISO date-time | |
| enabled | No | ||
| maxUses | No | ||
| currency | No | ||
| idOrSlug | Yes | The discount's id or code to update | |
| startsAt | No | ISO date-time | |
| minSubtotal | No | Minimum subtotal in minor units: the code's own currency for 'fixed', the default currency otherwise. null clears it - with minSubtotalByCurrency set, the code then no longer applies to default-currency carts | |
| minSubtotalByCurrency | No | 'percentage' and 'free_shipping' only: replaces the per-currency minimums for carts in additional currencies; [] clears them. Omit to keep them. Changing such a code to 'fixed' needs [] here |