CoworkerDiscountCodes
Search CoworkerDiscountCodes
Search and list CoworkerDiscountCode records with filtering, sorting, and pagination.
GET
Search CoworkerDiscountCodes
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-List role.Query Parameters
Pagination & Sorting
integer
default:"1"
The page number to retrieve.
integer
default:"25"
The number of records per page.
string
The property name to sort results by (e.g.
Name, CreatedOn).integer
Sort direction.
0 for ascending, 1 for descending.Filters
integer
Filter by 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
Filter by display value for Coworker.CoworkerType..
string
Filter by display value for Coworker.FullName..
string
Filter by display value for Coworker.BillingName..
string
Filter by display value for Coworker.CompanyName..
integer
Filter by 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
Filter by display value for Business.Name..
integer
Filter by 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
Filter by display value for DiscountCode.Code..
boolean
Filter by display value for DiscountCode.Active..
string
Filter by display value for DiscountCode.ValidFrom..
string
Filter by display value for DiscountCode.ValidTo..
string
Filter by 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
Filter by 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
Filter by 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
Filter by 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
Filter by 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
Filter by 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.
Range Filters
string
Filter by display value for DiscountCode.ValidFrom. greater than or equal to this value. Format:
YYYY-MM-DDTHH:mm.string
Filter by display value for DiscountCode.ValidFrom. less than or equal to this value. Format:
YYYY-MM-DDTHH:mm.string
Filter by display value for DiscountCode.ValidTo. greater than or equal to this value. Format:
YYYY-MM-DDTHH:mm.string
Filter by display value for DiscountCode.ValidTo. less than or equal to this value. Format:
YYYY-MM-DDTHH:mm.integer
Filter by 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 greater than or equal to this value.
integer
Filter by 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 less than or equal to this value.
string
Filter by 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 greater than or equal to this value. Format:
YYYY-MM-DDTHH:mm.string
Filter by 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 less than or equal to this value. Format:
YYYY-MM-DDTHH:mm.string
Filter by 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 greater than or equal to this value. Format:
YYYY-MM-DDTHH:mm.string
Filter by 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 less than or equal to this value. Format:
YYYY-MM-DDTHH:mm.string
Filter records created on or after this date. Format:
YYYY-MM-DDTHH:mm.string
Filter records created on or before this date. Format:
YYYY-MM-DDTHH:mm.string
Filter records updated on or after this date. Format:
YYYY-MM-DDTHH:mm.string
Filter records updated on or before this date. Format:
YYYY-MM-DDTHH:mm.Code Examples
Simple listing
Filtering by CreatedOn
Range filters
Response
200
CoworkerDiscountCode[]
The list of CoworkerDiscountCode records matching the query. See the Get one CoworkerDiscountCode endpoint for the full list of properties returned for each record.
integer
Current page number.
integer
Number of records per page.
string
The field used for sorting.
integer
The sort direction (
0 = ascending, 1 = descending).integer
Index of the first item on the current page.
integer
Index of the last item on the current page.
integer
Total number of matching records across all pages.
integer
Total number of pages.
boolean
Whether there is a next page of results.
boolean
Whether there is a previous page of results.
Example Response