create_coupon
Create a coupon for Checkout Page.
Use this when a merchant wants a discount code that customers can enter on eligible pages.
How page restrictions work:
Omit both
pageIdsandticketTypeIdsto create a coupon that is usable on all checkout pages and events.Set
pageIdsto restrict the coupon to one or more specific pages.ticketTypeIdsare narrower thanpageIds: they restrict the coupon to specific ticket types within an event.If the page is an event, you must first restrict the coupon to that event by including the event page ID in
pageIds, and only then can you narrow it to certain tickets from that event withticketTypeIds.Do not pass
ticketTypeIdsby themselves. Every ticket type must belong to one of thepageIdsprovided, or the request fails.
How discount types work:
amountOffis a fixed amount discount. It requirescurrency.percentOffis a percentage discount applied to the eligible checkout total.Set exactly one of
amountOfforpercentOff, never both.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The coupon code a customer enters. | |
| label | Yes | Internal name for the coupon. | |
| pageIds | No | A list of pageIds that this coupon can be used within. | |
| currency | No | Three-letter ISO code for the currency of the amountOff parameter. Required when `amountOff` is set, and not allowed when `percentOff` is set. | |
| duration | Yes | How long the discount lasts: `once` applies to the first eligible payment, `repeating` applies for a fixed number of months, and `forever` applies until canceled or expired. | |
| redeemBy | No | The ISO datetime that this coupon must be used before. | |
| amountOff | No | A positive integer representing the amount to subtract from an invoice total (required if `percentOff` is not passed). | |
| percentOff | No | A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amountOff` is not passed). | |
| ticketTypeIds | No | List of ticket type IDs that this coupon can be used with. Ticket ticket ids must belong to a page specified in the `pageIds` array. | |
| maxRedemptions | No | The total number of times this coupon can be redeemed across all customers. Doesn't limit a single customer from redeeming multiple times. Omit for unlimited redemptions. | |
| durationInMonths | No | A positive integer representing the number of months the coupon applies for. Required when `duration === repeating`, and not allowed when `duration` is `once` or `forever`. | |
| appliesToSetupFee | No | When enabled, applies this coupon discount to the setup fee. | |
| appliesToTicketFees | No | When enabled, applies this coupon discount to ticket-level fees on event pages as well as the ticket prices. Defaults to false, which leaves ticket fees undiscounted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes |