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

# Promo Codes

> Create discount codes for plans and billing cycles.

## Creating a promo code

Navigate to **Admin → Promos → Create Promo**.

| Field      | Description                                                            |
| ---------- | ---------------------------------------------------------------------- |
| Code       | The discount code customers enter (e.g. `WELCOME20`)                   |
| Type       | `percentage` — discount as a % of the price; `fixed` — flat amount off |
| Value      | The discount value (e.g. `20` for 20% or `5.00` for \$5 off)           |
| Max Uses   | Total number of times the code can be used (blank = unlimited)         |
| Expires At | Optional expiry date after which the code is invalid                   |
| Plans      | Restrict the code to specific plans (blank = valid on all plans)       |
| Active     | Enable/disable without deleting                                        |

## How customers apply promo codes

1. Customer navigates to **Order → \[Plan]**
2. On the checkout page, there is a **Promo Code** field
3. Customer enters the code and clicks **Apply**
4. If valid, the discounted price is shown before payment
5. The discount is applied to the generated invoice

## API validation

Codes can also be validated via the API before presenting a checkout UI:

```http theme={null}
POST /v1/promos/validate
Content-Type: application/json

{
  "code": "WELCOME20",
  "plan_id": 1,
  "cycle_id": 2
}
```

Response:

```json theme={null}
{
  "success": true,
  "data": {
    "code": "WELCOME20",
    "type": "percentage",
    "value": 20,
    "discounted_price": 7.99,
    "original_price": 9.99
  }
}
```

## Usage tracking

Each time a promo code is used, the usage count increments. You can view usage stats per code in **Admin → Promos**.

When `max_uses` is reached, the code is automatically invalidated.
