Skip to main content
GET
Get one CoworkerDiscountCode
A customer discount code (internally CoworkerDiscountCode) is the link between one customer and one discount code offer. Nothing reduces a customer’s price until this link exists. It is created when the customer claims a code at sign-up, on the members portal or against a booking, and an operator can also create one directly to give a named customer a discount without sharing a code anyone else could use. The assignment carries its own ValidFrom and ExpiresOn window, which applies on top of the offer’s own validity window with the more restrictive of the two winning, and a read-only TimesUsed counter that the offer’s per-customer and overall usage caps are checked against. Every other rule stays on the offer itself, so change the discount amount, audience or which purchases it covers on the DiscountCode rather than here. On a referral assignment the holder is the customer who made the referral and RefererGuid identifies the person they referred. BookingUniqueId, when set, reserves the discount for one specific booking.

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 CoworkerDiscountCode-Read role.

Path Parameters

integer
required
The Id of the CoworkerDiscountCode record to retrieve.

Code Examples

Response

200

integer
ID of the customer who holds this discount and receives the reduced price. On a referral assignment this is the customer who made the referral, not the person who was referred.
string
Display value for Coworker.CoworkerType..
string
Display value for Coworker.FullName..
string
Display value for Coworker.BillingName..
string
Display value for Coworker.CompanyName..
integer
ID of the location that issued this discount to the customer. When the customer claims a code themselves this is taken from the code’s own location, or from the booking’s location for a booking-specific claim.
string
Display value for Business.Name..
integer
ID of the discount code offer granted to the customer. Every rule on that offer still applies on top of this assignment, including its active flag, validity window, usage caps, audience and which kinds of purchase it pays for.
string
Display value for DiscountCode.Code..
boolean
Display value for DiscountCode.Active..
string
Display value for DiscountCode.ValidFrom..
string
Display value for DiscountCode.ValidTo..
string
Free-text internal note about why the customer has this discount. Filled in automatically for a referral assignment to record who the customer referred.
integer
Read-only count of how many times this customer has already used the discount. Maintained by invoicing and booking, and it can rise by more than one at a time because an invoice line adds its quantity. Cancelling a booking gives a use back. Checked against the offer’s MaxUsesPerUser, and summed across all customers for its overall MaxUses.
string
UTC date and time from which this customer may use the discount, on top of the offer’s own validity window; the more restrictive of the two applies. Leave empty for no customer-specific start. The server rejects a value later than ExpiresOn.
string
UTC date and time after which this customer may no longer use the discount, on top of the offer’s own validity window; the more restrictive of the two applies. Calculated from the offer’s ExpirationType and ExpiresIn when the customer claims a code themselves, but not when an operator assigns one directly, so set it explicitly if the discount should lapse. Leave empty for no customer-specific end.
string
System-managed unique identifier of the customer who was referred, meaning the person who signed up with the code, while the holder of this assignment is the one being rewarded. Set by the referral sign-up flow; a referral discount stops applying once the referred customer is no longer active. Do not set this by hand to simulate a referral.
string
System-managed unique identifier of the booking this discount is reserved for. When empty the discount can be used for any eligible purchase; when set it only applies to that one booking. Populated by the booking flow when a customer enters a code against a booking.
integer
Unique record identifier.
string
UUID of the record.
string
Date and time the record was created (ISO 8601).
string
Date and time the record was last updated (ISO 8601).
string
Email of the user who last updated this record.
boolean
Whether the record was recently created.
string
External system identifier.
Example Response