Manage discount codes
manage_discount_codesList, create, change, disable or delete the codes buyers enter at checkout: type percent (value 1-100) or fixed (value in major currency units, store currency by default), with an optional min_order, max_uses, starts_at and expires_at. "disable" keeps the code and its usage count; "delete" removes it. Codes are stored uppercase and must be unique per store.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | What buyers type, e.g. "WELCOME10" (stored uppercase) | |
| type | No | percent off, or a fixed amount off | |
| value | No | percent: 1-100. fixed: amount in major units (e.g. 200 = ₹200 off) | |
| action | Yes | ||
| active | No | Whether the code can be used (default true on create) | |
| code_id | No | For update / disable / delete (from "list") | |
| site_id | Yes | The site, from list_sites | |
| currency | No | fixed only; defaults to the store currency | |
| max_uses | No | Total redemptions allowed; null = unlimited | |
| min_order | No | Minimum order amount (major units) for the code to apply | |
| starts_at | No | ISO date/time the code starts working; null = now | |
| user_goal | No | Optional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details. | |
| expires_at | No | ISO date/time the code stops working; null = never |