Coupon Write Tool
coupon-writeCreate or update discount coupons. Requires coupon permission. Creation requires a unique code, type and discounts; percentage discounts cannot exceed 100. Updates replace supplied discount collections and can affect what clients pay.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Coupon code (max 32, unique). Required for "create", optional for "update". | |
| type | No | Discount type: "percentage" (amount is 0–100 percent) or "fixed" (amount is a monetary value). Required for "create". | |
| action | Yes | Action to perform. | |
| duration | No | Whether the discount applies for the full subscription duration. Optional. | |
| coupon_id | No | Coupon id. Required when updating an existing record. | |
| discounts | No | Discount rules. Required for "create". Each entry has an "amount" and optional "services". | |
| single_use | No | Allow each customer to use the coupon only once. Optional. | |
| description | No | Internal description of the coupon. Optional. | |
| date_expires | No | Expiry date-time (e.g. "2026-12-31 23:59:59"). Optional; pass null on "update" to clear. | |
| is_cart_total | No | Fixed coupons only: take the amount off the eligible cart subtotal once, spread across the eligible items, instead of off every eligible item and quantity. Ignored (forced false) for percentage coupons. Optional. | |
| new_customers | No | Restrict the coupon to customers with no prior paid invoices. Optional. | |
| min_cart_amount | No | Minimum cart total required to use the coupon. Optional; pass null on "update" to clear. | |
| single_quantity | No | Apply the discount to a single quantity only. Optional. |