Create Discount Code
Creates a new discount code for an event. Requires event_id, code, and type (percentage, absolute, or specific). Set capacity to limit total usage, apply_to_all to apply across every line item, or list specific items in applicable_line_items for targeted discounts. For specific-type discounts, supply line-item-specific fees via custom_fees_update. Group constraints can be configured via min_group_size, registrants_per_use, and all_registrants_in_group. To create an alternate code, set parent_id to a primary code in the same event; the alternate inherits the parent’s settings (see parent_id).
Authorizations
Body
Creates this code as an alternate (child) of the given primary code. The parent must be an existing,
non-deleted, top-level code in the same event; otherwise the request is rejected with 422.
An alternate inherits everything from its parent: capacity, min_group_size, registrants_per_use,
percentage_discount, absolute_discount, apply_to_all, applicable_line_items, custom_fees,
notes, sold_out_message, all_registrants_in_group, autopopulate_attributes and visibility. Any of these sent alongside parent_id are ignored,
and checkout always applies the parent's type and amount (the alternate's own type is informational only).
Each alternate still tracks its own usage count against the inherited capacity.
So the only fields worth sending with parent_id are event_id, code and type.
6715880
Response
Created
The discount payload returned by every read endpoint. Reflects Discount::fields() exactly —
every property is always present in the response (values may be null).