A DiscountCode represents a discount registered in the system. Each discount code belongs to a Business (location) and defines a percentage or fixed-amount discount that can be applied to different item types: price plans (tariffs), bookings, products, and/or events.Use the boolean flags (DiscountPricePlans, DiscountBookings, DiscountProducts, DiscountEvents) to control which item categories the discount applies to. For each enabled category, associate the specific eligible items via the corresponding ID list (e.g. Tariffs, ResourceTypes, Products, EventCategories). Use the Added* and Removed* list variants for incremental updates without replacing the full list.A discount can specify either DiscountPercentage (e.g. 10 for 10% off) or DiscountAmount (a fixed monetary amount off), but not both.Discount codes can be assigned to individual customers via CoworkerDiscountCode. Availability can be further restricted by validity dates (ValidFrom/ValidTo), publish window (PublishFrom/PublishTo), usage caps (MaxUses, MaxUsesPerUser), audience (OnlyForContacts, OnlyForMembers), and expiration rules (ExpirationType, ExpiresIn).
This endpoint requires OAuth2 authentication. Include a valid bearer token in the Authorization header.
The authenticated user must be a full unrestricted administrator or have the DiscountCode-Create role.
Unit of the expiration period (Day, Week, Month, Year). Used with ExpiresIn to determine when the discount expires after being assigned to a customer. See eDiscountExpirePeriod? enum above.