Skip to main content
POST

Authorizations

Authorization
string
header
required

OAuth 2.0 bearer token obtained from POST /oauth2/token. Tokens expire after 30 minutes. Include in the Authorization header as Bearer {access_token}.

Body

event_id
integer
required

ID of the event to which this discount is associated.

Example:

12345

code
string
required

Unique code for the discount within the event. May not contain <, >, \, or ".

Maximum string length: 255
Example:

"SPRINGSALE2024"

type
enum<string>
required

The type of discount being applied.

  • percentage — percentage_discount is required.
  • absolute — absolute_discount is required.
  • specific — line-item-specific fees are supplied via custom_fees_update.
Available options:
percentage,
absolute,
specific
Example:

"percentage"

parent_id
integer

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.

Example:

6715880

percentage_discount
number<float>

Percentage value of the discount. Required when type is percentage.

Required range: 0 <= x <= 100
Example:

15

absolute_discount
number<float>

Absolute monetary value of the discount. Required when type is absolute.

Example:

25.5

apply_to_all
boolean

If true, the discount applies to every line item; if false, only to those listed in applicable_line_items.

Example:

true

capacity
integer

Maximum number of times this discount can be used. Omit (or 0) for unlimited.

Example:

10

min_group_size
integer

Minimum group size required to use this discount.

Required range: x >= 2
Example:

5

registrants_per_use
integer

Maximum number of times the code can be used per group of N registrants. e.g. set to 2 to allow 1 use in a group of 2, 2 uses in a group of 4, etc.

Required range: x >= 2
Example:

2

all_registrants_in_group
boolean

Whether all registrants in a group must use the same discount.

Example:

true

applicable_line_items
string[]

Line items the discount applies to when apply_to_all is false. Standard values are reg_type, package, and session. Custom-question line items use the form c_<questionId> (e.g. c_438).

Example:
custom_fees_update
object

For specific discounts: maps each line-item type to a map of line-item IDs and the replacement fee (as a string). On save, these entries are merged into the persisted custom_fees object. Returned only via the custom_fees field on read responses.

Example:
autopopulate_attributes
object[]

Registrant fields to be automatically populated when this discount is applied. Each entry has an attribute (registrant attribute name or c_<questionId> for custom questions) and a value.

notes
string

Free-form notes or comments about the discount.

Example:

"Discount for early bird registrants."

sold_out_message
string

Custom message shown when the discount is sold out. Defaults to a generic message when not set.

Maximum string length: 255
Example:

"SPRINGSALE2024 has been used too many times."

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).

id
integer
Example:

6095869

parent_id
integer | null

ID of the primary discount when this row is an alternate code; null (or 0) for primary codes.

Example:

null

event_id
integer
Example:

261977

code
string
Example:

"SPRINGSALE2024"

type
enum<string>
Available options:
percentage,
absolute,
specific
Example:

"percentage"

capacity
integer

Maximum number of times this discount can be used. 0 means unlimited.

Example:

10

min_group_size
integer
Example:

0

registrants_per_use
integer
Example:

0

sold_out_message
string | null
Example:

null

percentage_discount
number<float>
Example:

15

absolute_discount
number<float>
Example:

0

applicable_line_items
string[] | null
Example:
apply_to_all
enum<integer>

Returned as 0 or 1 (not a JSON boolean), even though the request accepts a boolean.

Available options:
0,
1
Example:

1

custom_fees
object | null

Merged set of line-item-specific fees for specific discounts. Outer key is the line-item type (reg_type, package, session), inner key is the line-item ID (numeric string), value is the fee as a string. Populated by custom_fees_update on write.

Example:
notes
string | null
Example:

"Discount for early bird registrants."

created_at
string

Timestamp when the discount was created. Formatted as YYYY-MM-DD HH:MM:SS.

Example:

"2026-04-28 21:00:15"

updated_at
string

Timestamp when the discount was last updated. Formatted as YYYY-MM-DD HH:MM:SS.

Example:

"2026-04-28 21:00:15"