Create an order-level discount
create_order_discountCreate order-level promo codes idempotently to prevent duplicates, with dry-run preview and validation. Confirm the stored configuration afterward using list_discounts.
Instructions
Idempotently create an order-level promo code at one authorized location. If the code already exists, returns it without creating a duplicate. Percentage amounts must be at most 100. Use list_discounts afterward to verify the stored configuration.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| mode | No | Preview by default. Apply requires the exact returned planDigest. | dry-run |
| amount | Yes | ||
| isFixed | Yes | ||
| disabled | No | ||
| maxUsage | No | ||
| startDate | Yes | ||
| startTime | No | 12:00 AM | |
| expireDate | Yes | ||
| expireTime | No | 11:59 PM | |
| locationId | No | Omit to use CRAVEUP_LOCATION_ID | |
| planDigest | No | Exact digest returned by a dry-run of the same arguments. | |
| description | No | ||
| oncePerOrder | No | ||
| oncePerCustomer | No | ||
| minItemsQuantity | No | ||
| confirmationToken | No | Required exact phrase for destructive, paid, or release operations. | |
| minPurchaseAmount | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| mode | Yes | ||
| status | Yes | ||
| changes | Yes | ||
| summary | Yes | ||
| operation | Yes | ||
| planDigest | Yes | ||
| environment | Yes | ||
| nextActions | Yes | ||
| schemaVersion | Yes |