Skip to main content
GET
/
api
/
billing
/
discountcodes
/
{id}
{
  "BusinessId": 123,
  "BusinessName": "<string>",
  "BusinessCurrencyCode": "<string>",
  "Code": "<string>",
  "Description": "<string>",
  "Active": true,
  "PublishFrom": "<string>",
  "PublishTo": "<string>",
  "DiscountPercentage": 123,
  "DiscountAmount": 123,
  "ReferralDiscount": true,
  "DiscountPricePlans": true,
  "Tariffs": [
    123
  ],
  "DiscountBookings": true,
  "ResourceTypes": [
    123
  ],
  "DiscountProducts": true,
  "Products": [
    123
  ],
  "DiscountEvents": true,
  "EventCategories": [
    123
  ],
  "MaxUsesPerUser": 123,
  "MaxUses": 123,
  "OnlyForContacts": true,
  "OnlyForMembers": true,
  "ValidFrom": "<string>",
  "ValidTo": "<string>",
  "ExpirationType": 123,
  "ExpiresIn": 123,
  "Id": 123,
  "UniqueId": "<string>",
  "CreatedOn": "<string>",
  "UpdatedOn": "<string>",
  "UpdatedBy": "<string>",
  "IsNew": true,
  "SystemId": "<string>"
}
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).

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

Path Parameters

id
integer
required
The Id of the DiscountCode record to retrieve.

Code Examples

curl -X GET \
  "https://spaces.nexudus.com/api/billing/discountcodes/87654321" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

200

BusinessId
integer
Business Id.
BusinessName
string
Name of the business (location) this discount code belongs to.
BusinessCurrencyCode
string
Currency code of the business (e.g. USD, EUR).
Code
string
The unique alphanumeric code customers enter to apply the discount.
Description
string
Human-readable description of what this discount code is for.
Active
boolean
Whether this discount code is currently active and can be redeemed.
PublishFrom
string
Date from which this discount code is visible/published to customers.
PublishTo
string
Date until which this discount code is visible/published to customers.
DiscountPercentage
number
Percentage discount to apply (e.g. 10 for 10% off). Mutually exclusive with DiscountAmount.
DiscountAmount
number
Fixed monetary amount to discount. Mutually exclusive with DiscountPercentage.
ReferralDiscount
boolean
Whether this discount code is used as part of the referral program.
DiscountPricePlans
boolean
Whether this discount can be applied to price plans (tariffs). When true, use Tariffs to restrict to specific plans.
Tariffs
integer[]
Tariffs.
DiscountBookings
boolean
Whether this discount can be applied to resource bookings. When true, use ResourceTypes to restrict to specific resource types.
ResourceTypes
integer[]
Resource Types.
DiscountProducts
boolean
Whether this discount can be applied to products. When true, use Products to restrict to specific products.
Products
integer[]
Products.
DiscountEvents
boolean
Whether this discount can be applied to events. When true, use EventCategories to restrict to specific event categories.
EventCategories
integer[]
Event Categories.
MaxUsesPerUser
integer
Maximum number of times a single customer can redeem this discount code.
MaxUses
integer
Maximum total number of times this discount code can be redeemed across all customers.
OnlyForContacts
boolean
When true, only contacts (non-member customers) can use this discount code.
OnlyForMembers
boolean
When true, only members (customers with an active plan) can use this discount code.
ValidFrom
string
Start date from which this discount code can be redeemed.
ValidTo
string
End date after which this discount code can no longer be redeemed.
ExpirationType
integer
Unit of the expiration period (Day, Week, Month, Year). Used with ExpiresIn to determine when the discount expires after being assigned to a customer.
ExpiresIn
integer
Number of ExpirationType periods after assignment until the discount expires for a customer.
Id
integer
Unique record identifier.
UniqueId
string
UUID of the record.
CreatedOn
string
Date and time the record was created (ISO 8601).
UpdatedOn
string
Date and time the record was last updated (ISO 8601).
UpdatedBy
string
Email of the user who last updated this record.
IsNew
boolean
Whether the record was recently created.
SystemId
string
External system identifier.
Example Response
{
  "BusinessId": 0,
  "BusinessName": null,
  "BusinessCurrencyCode": null,
  "Code": "",
  "Description": "",
  "Active": false,
  "PublishFrom": null,
  "PublishTo": null,
  "DiscountPercentage": null,
  "DiscountAmount": null,
  "ReferralDiscount": false,
  "DiscountPricePlans": false,
  "Tariffs": [],
  "DiscountBookings": false,
  "ResourceTypes": [],
  "DiscountProducts": false,
  "Products": [],
  "DiscountEvents": false,
  "EventCategories": [],
  "MaxUsesPerUser": null,
  "MaxUses": null,
  "OnlyForContacts": false,
  "OnlyForMembers": false,
  "ValidFrom": null,
  "ValidTo": null,
  "ExpirationType": 0,
  "ExpiresIn": null,
  "Id": 87654321,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "CreatedOn": "2025-01-10T08:00:00Z",
  "UniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "UpdatedBy": "admin@example.com",
  "IsNew": false,
  "SystemId": null,
  "ToStringText": "DiscountCode Example",
  "LocalizationDetails": null,
  "CustomFields": null
}