Discount codes

Percent or fixed-amount promotion codes reduce the product price at checkout. Create codes in the dashboard, then let buyers enter them on payment links (when enabled) or pass a code when creating a checkout session from your backend.

Create a code

Dashboard → Discounts → New code. Choose percent (1–100) or fixed amount in the smallest currency unit. Optionally set a max redemption count and an expiry. Codes are case-insensitive and stored uppercase.

Rules

  • Percent codes are 1–100% off the product amount.
  • Fixed codes subtract cents; the charged amount never drops below $0.50 (or the equivalent floor in other currencies).
  • Redemptions increment only after payment succeeds — not on session create.
  • Paused or deleted codes cannot be applied to new checkouts.

Payment links

Enable “Allow promotion codes” on a payment link so buyers see a code field before paying. Without that flag, only API-created sessions can attach a discount.

API

POST /v1/discount_codes
Authorization: Bearer rk_live_...
Content-Type: application/json

{
  "code": "SAVE20",
  "type": "percent",
  "value": 20,
  "max_redemptions": 100
}

# Attach at checkout:
POST /v1/checkout_sessions
{
  "price": "price_...",
  "discount_code": "SAVE20",
  "success_url": "https://example.com/thanks"
}