create_discount
Create a new discount code for food orders with customizable type, amount, and restrictions.
Instructions
[WPCafe Pro] Create a new discount code for food orders.
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>",
"type": "<type>",
"amount": "<amount>"
},
"name": "create_discount"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Discount code customers enter at checkout | |
| type | Yes | Discount type: percentage off or fixed amount off | |
| amount | Yes | Discount value (e.g. 10 for 10% or $10) | |
| max_uses | No | Maximum number of times this code can be used (0 = unlimited) | |
| description | No | Internal description of the discount | |
| expiry_date | No | Expiry date (YYYY-MM-DD), leave empty for no expiry | |
| location_id | No | Restrict to a specific location | |
| min_order_amount | No | Minimum order total required to use this code |