Skip to main content
PUT
Update DiscountCode
Updates an existing DiscountCode record. You must include the Id of the record to update along with all required fields.

Authentication

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-Edit role.

Enums

Request Body

Required Fields

integer
required
The Id of the DiscountCode record to update.
integer
required
ID of the location this discount code is available at. If the location is a network parent, the code can also be redeemed at every location in that network.
string
required
The code customers type to claim the discount; must be unique within the location. Typically a short alphanumeric string such as SUMMER25.
string
required
Short text shown to the customer when they enter a valid code, for example 20% off your first month. Required, and translatable per language.

Optional Fields

boolean
Whether the code can be redeemed at all. When false the code is ignored everywhere, regardless of its validity or publish dates.
string
UTC date and time from which the code can be redeemed on the members portal, website and app. Leave empty to publish immediately.
string
UTC date and time after which the code can no longer be redeemed on the members portal, website and app. Leave empty for no publish end date.
number
Percentage taken off the price, entered as a whole number so 10 means 10% off. Set either this or DiscountAmount, not both; when both are set DiscountAmount wins.
number
Fixed amount taken off the price, in the location currency. Capped at the item price so the result is never negative. Set either this or DiscountPercentage, not both; when both are set this one wins.
boolean
Whether the discount is granted to the referring customer instead of the person redeeming it. When true, sign-up fails unless the new customer arrived through a referral link, and the discount stops applying if the referrer becomes inactive. To reward both sides, add a second non-referral code using the same Code value.
boolean
Whether the code can be used to pay for plans. When false the code never applies to a plan, whatever Tariffs contains.
integer[]
List of plan (tariff) IDs the discount is restricted to. Leave empty to allow any plan. Only has an effect while DiscountPricePlans is true.
integer[]
IDs added to the Tariffs relationship..
integer[]
IDs removed from the Tariffs relationship..
boolean
Whether the code can be used to pay for bookings. When false the code never applies to a booking, whatever ResourceTypes contains.
integer[]
List of resource type IDs the discount is restricted to. Leave empty to allow any resource type. Only has an effect while DiscountBookings is true, and once the list is set a booking with no resource is excluded.
integer[]
IDs added to the ResourceTypes relationship..
integer[]
IDs removed from the ResourceTypes relationship..
boolean
Whether the code can be used to pay for products. When false the code never applies to a product, whatever Products contains.
integer[]
List of product IDs the discount is restricted to. Leave empty to allow any product. Only has an effect while DiscountProducts is true.
integer[]
IDs added to the Products relationship..
integer[]
IDs removed from the Products relationship..
boolean
Whether the code can be used to pay for event tickets. When false the code never applies to an event, whatever EventCategories contains.
integer[]
List of event category IDs the discount is restricted to. Leave empty to allow any event. Only has an effect while DiscountEvents is true, and an event matches when it belongs to at least one listed category.
integer[]
IDs added to the EventCategories relationship..
integer[]
IDs removed from the EventCategories relationship..
integer
Maximum number of times one customer may redeem this code. Leave empty for no per-customer limit.
integer
Maximum number of redemptions across all customers, after which the code stops working. Leave empty for no overall limit.
boolean
Whether the code is restricted to contacts, meaning customers with no active contract. Mutually exclusive with OnlyForMembers; leave both false to allow every customer.
boolean
Whether the code is restricted to members, meaning customers with at least one active contract. Mutually exclusive with OnlyForContacts; leave both false to allow every customer.
string
UTC date and time from which the discount applies. Leave empty for no start date. For bookings this is compared against the booking start time rather than the moment of redemption.
string
UTC date and time after which the discount no longer applies. Leave empty for no end date. For bookings this is compared against the booking end time rather than the moment of redemption.
integer
Unit used together with ExpiresIn to work out when a claimed code stops working for that customer: Day, Week, Month or Year. See eDiscountExpirePeriod? enum above.
integer
How many ExpirationType periods a customer keeps the discount for after claiming it, so 3 with ExpirationType Month expires it three months after the customer claims the code. Leave empty so the discount never expires on its own.

Code Examples

Response

200

integer
HTTP status code. 200 on success.
string
A human-readable message confirming the update.
object
Contains the Id of the updated record.
boolean
true if the discountcode was updated successfully.
array
null on success.
Example Response

400

string
A summary of the validation error(s), in the format PropertyName: error message.
any
null on validation failure.
object[]
Array of validation errors.
boolean
false when the request fails validation.
Example Response