create_discount
Create discount codes as percentage, fixed amount, or free shipping. Add optional limits for minimum subtotal, max uses, and validity period after the user agrees to the code.
Instructions
Create a discount code. type is 'percentage' (value 0-100), 'fixed' (value in minor currency units, requires currency e.g. 'USD'), or 'free_shipping' (value 0). Optional limits: minSubtotal, maxUses, startsAt, endsAt. Only call AFTER the user explicitly agreed to the code you described.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | The discount code | |
| type | No | ||
| value | No | Percent (0-100), fixed amount in minor units, or 0 | |
| endsAt | No | ISO date-time the code expires | |
| enabled | No | ||
| maxUses | No | Total redemption cap | |
| currency | No | ISO 4217 code, required for 'fixed' type, omit otherwise | |
| startsAt | No | ISO date-time the code becomes valid | |
| minSubtotal | No | Minimum order subtotal in minor units |