Create a discount code
create_couponCreate a new discount code. Codes are stored uppercase and matched case-insensitively at checkout. Buyers can only type a code on checkouts that show a code box: this switches it on for the draft checkouts the code covers, and lists live ones still without it (codeBox.stillOff) for the seller to turn on.
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>",
"kind": "<kind>",
"value": "<value>"
},
"name": "create_coupon"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code buyers type, e.g. BLACKFRIDAY. Letters and numbers. | |
| kind | Yes | percent = % off, fixed = amount off. | |
| value | Yes | For percent: 1-100. For fixed: the amount off in cents. | |
| account | No | Only to work in a client's account: its id from list_accounts. Leave it out for your own account. | |
| expiresAt | No | ISO-8601 date/time when it stops working. Omit for never. | |
| productSlug | No | Limit to one product. Omit to apply to every product. | |
| maxRedemptions | No | Cap on total uses. Omit for unlimited. |