NextRouteNextRoute

Promo Codes

Create promotional discounts with percentage or fixed amounts, usage limits, date ranges, and plan-specific targeting.

Promo Codes

Promo codes let you offer discounts to customers during enrollment or as ongoing promotions. Codes support percentage and fixed-amount discounts, usage limits, date restrictions, and plan-specific targeting.

Promo Code Fields

FieldDescription
codeThe code customers enter (e.g., "SUMMER25")
discount_typepercent or fixed
discount_valueDiscount amount — percentage (e.g., 25 for 25%) or cents (e.g., 1000 for $10.00)
max_usesMaximum number of times the code can be redeemed (null = unlimited)
current_usesHow many times it has been used
valid_fromStart date for the promotion (null = immediately valid)
valid_untilExpiration date (null = no expiration)
applies_to_plan_ids_jsonJSON array of plan IDs this code applies to (empty = all plans)
is_activeWhether the code is currently redeemable

Discount Types

Percentage Discount

Reduces the plan price by a percentage:

Discounted price = price_cents × (1 - discount_value / 100)

Example: Code "SAVE20" with discount_type: "percent" and discount_value: 20

  • Plan price: $35.00
  • Discount: $7.00 (20%)
  • Customer pays: $28.00

Fixed Amount Discount

Reduces the plan price by a fixed dollar amount:

Discounted price = price_cents - discount_value

Example: Code "10OFF" with discount_type: "fixed" and discount_value: 1000

  • Plan price: $35.00
  • Discount: $10.00
  • Customer pays: $25.00

Usage Limits

Set max_uses to control how many times a code can be redeemed:

  • max_uses: 100 — first 100 customers to use the code
  • max_uses: 1 — single-use code (e.g., for a specific customer)
  • max_uses: null — unlimited uses

The current_uses counter increments each time the code is applied to a customer.

Date Restrictions

Use valid_from and valid_until to create time-limited promotions:

  • Seasonal promotion: valid_from: "2026-06-01", valid_until: "2026-08-31"
  • Flash sale: valid_from: "2026-03-24", valid_until: "2026-03-25"
  • Ongoing: Leave both null

Plan-Specific Promos

The applies_to_plan_ids_json field restricts a code to specific service plans:

["plan_abc123", "plan_def456"]

If empty ([]), the code applies to all plans. Use this to offer discounts only on specific service tiers or frequencies.

Creating a Promo Code

From the Dashboard

  1. Go to Billing > Promo Codes (or Marketing > Promos)
  2. Click Add Promo Code
  3. Enter the code, discount type, and value
  4. Set optional limits (max uses, date range, plan restrictions)
  5. Save

From the API

POST https://api.nextroute.app/api/promos
Authorization: Bearer <token>
Content-Type: application/json

{
  "code": "SUMMER25",
  "discount_type": "percent",
  "discount_value": 25,
  "max_uses": 100,
  "valid_from": "2026-06-01",
  "valid_until": "2026-08-31",
  "applies_to_plan_ids_json": []
}

Applying a Promo Code

Promo codes can be applied:

  • During customer enrollment (via the enrollment form or portal)
  • When creating a customer in the dashboard (set promo_code_id on the customer)
  • Via the pricing widget on your website

The discount is applied to the customer's invoices for the duration of the promotion.