> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rapidcert.co.nz/llms.txt
> Use this file to discover all available pages before exploring further.

# Discount Management

> Creating and managing discount codes in the RapidCert admin dashboard

# Discount Management

This guide covers creating, managing, and reporting on discount codes in the RapidCert admin dashboard.

## Overview

Discount codes allow you to offer reduced pricing to companies at checkout. Discounts can be a fixed dollar amount or a percentage off, and can be scoped to specific clients, limited by usage count, or set to expire on a given date.

### Who Can Manage Discounts

| Role                      | Access                                        |
| ------------------------- | --------------------------------------------- |
| **Admin**                 | Create, edit, delete, and report on discounts |
| **Assessor** / **Viewer** | No access                                     |

Navigate to **Settings** in the sidebar, then select the **Discounts** tab to access discount management.

## Creating a Discount

<Steps>
  <Step title="Open the discount form">
    Click **Create Discount** in the top-right corner of the Discounts tab.
  </Step>

  <Step title="Set the discount code">
    Enter a custom code or click **Generate** to create a random 8-character alphanumeric code. Custom codes can be up to 20 characters. Codes are case-insensitive and must be unique.
  </Step>

  <Step title="Choose the discount type">
    Select **Percentage** (0–100%) or **Fixed Amount** (dollar value) and enter the discount value.
  </Step>

  <Step title="Configure optional settings">
    Fill in any of the optional fields below to refine how the discount applies.
  </Step>

  <Step title="Save">
    Click **Save** to create the discount. It syncs to Stripe automatically.
  </Step>
</Steps>

### Discount Fields

| Field                  | Required | Description                                                                        |
| ---------------------- | -------- | ---------------------------------------------------------------------------------- |
| **Coupon Code**        | Yes      | Unique alphanumeric code (8 chars recommended)                                     |
| Type                   | Yes      | Percentage or fixed dollar amount                                                  |
| Value                  | Yes      | Amount or percentage to discount                                                   |
| **Applicable Clients** | Yes      | One or more clients the discount applies to. At least one client must be selected. |
| Start date             | No       | Date the code becomes active                                                       |
| Expiry date            | No       | Date the code stops working                                                        |
| Max uses               | No       | Total number of times the code can be used                                         |
| Reason                 | No       | Internal note explaining the discount                                              |
| Consultant email       | No       | Affiliate or consultant email for kickback tracking                                |
| Kickback %             | No       | Commission rate (0–100%) paid to the consultant                                    |

<Note>
  Once a discount has been synced to Stripe (i.e., a Stripe coupon has been created), the **Max Uses** and **Expiry Date** fields become read-only. This happens regardless of whether the discount has been used. Plan these values carefully before a code goes live.
</Note>

## Managing Discounts

### List View

The Discounts tab shows all discount codes with their current status, type, usage count, and expiry date. You can:

* **Search** by code or reason
* **Filter** by status: Active or Inactive (expired codes appear in the list with an Expired badge but are not a separate filter option)

Discount codes are shown in order of most recently created.

### Editing a Discount

1. Click the **Edit** icon in the **Actions** column
2. Make your changes in the modal
3. Click **Save Changes**

<Warning>
  Max uses and expiry date cannot be changed after a discount has been synced to Stripe (i.e., a Stripe coupon has been created), regardless of whether the discount has been used.
</Warning>

### Deleting a Discount

Click the **Delete** icon next to a discount to remove it. Deletion is a soft delete — the record is retained for reporting purposes but the code can no longer be applied at checkout.

## Discount Statuses

Discount status is derived from the discount's active flag and its configured date fields.

| Status        | Description                                                |
| ------------- | ---------------------------------------------------------- |
| **Active**    | Code is valid and can be used at checkout                  |
| **Inactive**  | Code exists but has been manually disabled                 |
| **Scheduled** | Code is active but the start date has not yet been reached |
| **Expired**   | Past the expiry date or max uses reached                   |

## Usage Tracking

Each discount shows a **Uses** count on the list view. Detailed usage tracking data — including which companies have used a code — is available on the **Dashboard**.

To view discount usage:

1. Navigate to the **Dashboard**
2. Select the **Discounts & Kickbacks** tab
3. Use the **Discount Codes** subtab to see per-code usage, the companies that applied each code, and order values

## Kickback and Affiliate System

If a discount is linked to a consultant or affiliate, RapidCert tracks commission owed and paid.

### How Kickbacks Work

When a discount with a consultant email is applied at checkout, the system records:

* The order value after discount
* The kickback percentage
* The calculated commission amount

Commissions are automatically adjusted if an order is refunded — the kickback amount reflects the net revenue received.

### Marking Consultants as Paid

1. Navigate to the **Dashboard**
2. Select the **Discounts & Kickbacks** tab
3. Select the **Consultants** subtab
4. Find the consultant by email
5. Review outstanding commissions
6. Click **Mark as Paid** to record payment

## Discount Reports

Discount activity reports are available on the **Dashboard** under the **Discounts & Kickbacks** tab. This tab has four subtabs:

| Subtab             | What it shows                                                                   |
| ------------------ | ------------------------------------------------------------------------------- |
| **Overview**       | Total discount value applied, number of uses, and period-over-period comparison |
| **Consultants**    | Consultant commission tracking and payment status                               |
| **Discount Codes** | Per-code usage, total value discounted, and companies that applied each code    |
| **Kickbacks**      | Kickback amounts, payment status, and reconciliation data                       |

## Stripe Integration

When you save a discount in RapidCert, it is automatically synced to Stripe as a coupon with a corresponding promotion code (discounts with a zero value are not synced to Stripe). This means:

* Discounts are enforced at the payment level, not just in the UI
* Stripe processes the reduced amount directly — no manual adjustments needed
* The Stripe promotion code matches the code you set in RapidCert

<Note>
  If Stripe sync fails due to a network error, the discount is still created in RapidCert but will not work at checkout until the sync is retried.
</Note>

### Zero-total discounts

When a discount reduces a contractor/supplier's total to \$0, the checkout behaviour depends on whether the discount is synced to Stripe:

* **Stripe-synced discounts** (percentage or fixed amount discounts that have been synced to Stripe) — the contractor/supplier is still redirected to Stripe Checkout so that Stripe records the promotion redemption and enforces usage limits. No card details are required.
* **App-only zero-total discounts** (fixed amount discounts not synced to Stripe, such as those with a \$0 value) — the evaluation is confirmed immediately without redirecting to Stripe. No card details are required.

This distinction matters when you configure **Max Uses** or **Expiry Date** on a discount intended to produce a zero-total checkout. If the discount is Stripe-synced, Stripe enforces those limits. If it is not synced, RapidCert enforces them.

### Immutability After Sync

Once a discount has been synced to Stripe (i.e., a Stripe coupon has been created), the following fields are locked, regardless of whether the discount has been used:

* **Max Uses** — Stripe tracks redemptions and cannot rewind this value
* **Expiry Date** — Stripe enforces this server-side; changes would create inconsistency

If you need to effectively change these values, deactivate the existing code and create a new one with the correct settings.

<Tip>
  Test discount codes in your staging environment before distributing them to ensure the correct amount is applied at checkout.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Settings" icon="gear" href="/guides/admins/settings-configuration">
    Configure platform settings
  </Card>

  <Card title="Company Management" icon="buildings" href="/guides/admins/company-management">
    Manage the companies that apply discount codes
  </Card>
</CardGroup>
