> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get one DiscountCode

> Retrieve a single DiscountCode record by its Id.

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

<Note>
  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.
</Note>

## Path Parameters

<ParamField path="id" type="integer" required>
  The Id of the DiscountCode record to retrieve.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/billing/discountcodes/87654321" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/discountcodes/87654321',
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const record = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/billing/discountcodes/87654321',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  record = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="BusinessId" type="integer">
  Business Id.
</ResponseField>

<ResponseField name="BusinessName" type="string">
  Name of the business (location) this discount code belongs to.
</ResponseField>

<ResponseField name="BusinessCurrencyCode" type="string">
  Currency code of the business (e.g. USD, EUR).
</ResponseField>

<ResponseField name="Code" type="string">
  The unique alphanumeric code customers enter to apply the discount.
</ResponseField>

<ResponseField name="Description" type="string">
  Human-readable description of what this discount code is for.
</ResponseField>

<ResponseField name="Active" type="boolean">
  Whether this discount code is currently active and can be redeemed.
</ResponseField>

<ResponseField name="PublishFrom" type="string">
  Date from which this discount code is visible/published to customers.
</ResponseField>

<ResponseField name="PublishTo" type="string">
  Date until which this discount code is visible/published to customers.
</ResponseField>

<ResponseField name="DiscountPercentage" type="number">
  Percentage discount to apply (e.g. 10 for 10% off). Mutually exclusive with DiscountAmount.
</ResponseField>

<ResponseField name="DiscountAmount" type="number">
  Fixed monetary amount to discount. Mutually exclusive with DiscountPercentage.
</ResponseField>

<ResponseField name="ReferralDiscount" type="boolean">
  Whether this discount code is used as part of the referral program.
</ResponseField>

<ResponseField name="DiscountPricePlans" type="boolean">
  Whether this discount can be applied to price plans (tariffs). When true, use Tariffs to restrict to specific plans.
</ResponseField>

<ResponseField name="Tariffs" type="integer[]">
  Tariffs.
</ResponseField>

<ResponseField name="DiscountBookings" type="boolean">
  Whether this discount can be applied to resource bookings. When true, use ResourceTypes to restrict to specific resource types.
</ResponseField>

<ResponseField name="ResourceTypes" type="integer[]">
  Resource Types.
</ResponseField>

<ResponseField name="DiscountProducts" type="boolean">
  Whether this discount can be applied to products. When true, use Products to restrict to specific products.
</ResponseField>

<ResponseField name="Products" type="integer[]">
  Products.
</ResponseField>

<ResponseField name="DiscountEvents" type="boolean">
  Whether this discount can be applied to events. When true, use EventCategories to restrict to specific event categories.
</ResponseField>

<ResponseField name="EventCategories" type="integer[]">
  Event Categories.
</ResponseField>

<ResponseField name="MaxUsesPerUser" type="integer">
  Maximum number of times a single customer can redeem this discount code.
</ResponseField>

<ResponseField name="MaxUses" type="integer">
  Maximum total number of times this discount code can be redeemed across all customers.
</ResponseField>

<ResponseField name="OnlyForContacts" type="boolean">
  When true, only contacts (non-member customers) can use this discount code.
</ResponseField>

<ResponseField name="OnlyForMembers" type="boolean">
  When true, only members (customers with an active plan) can use this discount code.
</ResponseField>

<ResponseField name="ValidFrom" type="string">
  Start date from which this discount code can be redeemed.
</ResponseField>

<ResponseField name="ValidTo" type="string">
  End date after which this discount code can no longer be redeemed.
</ResponseField>

<ResponseField name="ExpirationType" type="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.
</ResponseField>

<ResponseField name="ExpiresIn" type="integer">
  Number of ExpirationType periods after assignment until the discount expires for a customer.
</ResponseField>

<ResponseField name="Id" type="integer">
  Unique record identifier.
</ResponseField>

<ResponseField name="UniqueId" type="string">
  UUID of the record.
</ResponseField>

<ResponseField name="CreatedOn" type="string">
  Date and time the record was created (ISO 8601).
</ResponseField>

<ResponseField name="UpdatedOn" type="string">
  Date and time the record was last updated (ISO 8601).
</ResponseField>

<ResponseField name="UpdatedBy" type="string">
  Email of the user who last updated this record.
</ResponseField>

<ResponseField name="IsNew" type="boolean">
  Whether the record was recently created.
</ResponseField>

<ResponseField name="SystemId" type="string">
  External system identifier.
</ResponseField>

```json Example Response theme={null}
{
  "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
}
```
