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

# Discount Codes

> Create fixed or percentage discounts with usage limits and expiry dates.

Discount codes let you offer reductions at checkout — for promotions, launches, or specific customer segments. Customers enter the code at checkout and the price adjusts automatically.

<Frame>
  <img src="https://mintcdn.com/suby/78hmNhVo7Bl_AwU_/images/capture-2026-03-10-19-42-45.png?fit=max&auto=format&n=78hmNhVo7Bl_AwU_&q=85&s=29800c0372db62be13ad60b29808704e" alt="Captured’écran2026 03 10à19 42 45" width="1872" height="1566" data-path="images/capture-2026-03-10-19-42-45.png" />
</Frame>

## How It Works

<Steps>
  <Step title="Create a code">
    Set up a discount code in your dashboard with a type, value, and optional limits.
  </Step>

  <Step title="Share it">
    Send the code to customers via email, Discord, social media, or anywhere else.
  </Step>

  <Step title="Customer applies it">
    The customer enters the code at checkout.
  </Step>

  <Step title="Discount applied">
    Suby adjusts the amount charged automatically.
  </Step>
</Steps>

## Creating a Discount Code

<Steps>
  <Step title="Go to Discounts">
    Navigate to **Growth → Discounts** in your dashboard and click **Create code**.
  </Step>

  <Step title="Configure your code">
    Set the code string (e.g. `LAUNCH50`), discount type, value, and optionally a usage limit and expiry date.
  </Step>

  <Step title="Save and share">
    Your code is active immediately.
  </Step>
</Steps>

## Discount Types

| Type         | Example                     |
| ------------ | --------------------------- |
| Percentage   | 20% off the checkout total  |
| Fixed amount | \$10 off the checkout total |

## Limitations

<Note>
  Discount codes apply to the checkout total after tax calculation. Codes are case-insensitive at checkout. A usage limit of 1 makes a code single-use.
</Note>

## Via API

You can also create discount codes programmatically with `POST /api/discount/create` — set a `PERCENT` or `FIXED` type, target `"all"` products or a specific list, and optionally cap usage (`maxUses`) or set an expiry (`expiresAt`).

Codes can be applied two ways:

* **Customer enters it at checkout** — the price adjusts automatically.
* **Pre-applied by you** — pass the code in the `discountCode` field on `POST /api/payment/create` or `POST /api/subscription/create`, and it's applied to the checkout without the customer typing anything. It's silently ignored if the code is invalid, expired, exhausted, or not attached to that product.

<Card title="Full API Reference" icon="code" href="/v2/api-reference/discounts/create">
  Endpoints, parameters, and response objects for Discounts.
</Card>
