Skip to content
DiscountCodeObject

A code a customer types at checkout to lower the price of a product or activity registration. Codes are scoped to one business. Applies either a fixed-cents discount (type: fixedAmount, fixedAmountCents set), a percentage discount (type: percentage, percentOff set), or makes the line zero (type: free). Optional date window, usage caps, eligibility conditions, and item restrictions limit when and where the code applies.

Fields

idID!
businessBusiness!

Canonical staff-admin page for this discount. Consume instead of building paths from the id.

codeString!
nameString

Optional admin-facing label (e.g. "Spring 2026 promo"). Not shown to customers.

fixedAmountCentsInt

Cents to subtract from the line. Non-null when type is fixedAmount, null when type is percentage or free.

percentOffInt

Percent to subtract from the line, from 1 to 100. Non-null when type is percentage, null when type is fixedAmount or free.

Lifecycle state of the code:

  • active — eligible for redemption (subject to validity window and limits)
  • inactive — paused; never redeems but can be re-activated later
  • archived — soft-deleted; never redeems and not surfaced in default lists
archivedAtDateTime

When the code was last archived. Set whenever status transitions to archived; preserved as an audit trail even if the code is later re-activated.

startsAtDateTime
endsAtDateTime
maxUsesInt

Total redemptions allowed across all customers. Null = unlimited.

maxUsesPerUserInt

Redemptions allowed per customer. Null = unlimited.

conditions[DiscountCodeCondition!]!
itemRestrictions[DiscountCodeItemRestriction!]!

Items the code applies to. Empty list means it applies to every product and activity in the business.

redemptions[DiscountCodeRedemption!]!
redemptionCountInt!

Number of redemptions counted against maxUses. Excludes redemptions cancelled when the parent purchase or registration was cancelled.

totalDiscountedCentsInt!

Sum of amountAppliedCents across all non-cancelled redemptions. Useful for showing the total dollar value a code has discounted to date.

createdAtDateTime!

Used in

DiscountCode