
How It Works
1
Create a code
Set up a discount code in your dashboard with a type, value, and optional limits.
2
Share it
Send the code to customers via email, Discord, social media, or anywhere else.
3
Customer applies it
The customer enters the code at checkout.
4
Discount applied
Suby adjusts the amount charged automatically.
Creating a Discount Code
1
Go to Discounts
Navigate to Growth → Discounts in your dashboard and click Create code.
2
Configure your code
Set the code string (e.g.
LAUNCH50), discount type, value, and optionally a usage limit and expiry date.3
Save and share
Your code is active immediately.
Discount Types
Limitations
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.
Via API
You can also create discount codes programmatically withPOST /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
discountCodefield onPOST /api/payment/createorPOST /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.
Per-account codes (externalRef)
Set externalRef when creating a code to bind it to a single account. It is then only accepted on a checkout created with the exact same externalRef, and refused everywhere else with DISCOUNT_CODE_EXTERNAL_REF_MISMATCH.
Use it for codes that must not be transferable between your users — prepaid credits, upgrade proration, one-off goodwill gestures. Matching is exact (no case folding, no trimming), and a checkout created without an externalRef can never redeem a bound code. Omit the field for a code any customer can use.
Full API Reference
Endpoints, parameters, and response objects for Discounts.

