Catalog
Discounts
Create a code in the dashboard, apply it on any checkout. Works for one-time charges and subscriptions.
Create a code
In the dashboard, open Products → Discounts and click New discount. Each discount has:
- Code: the string buyers type in (e.g.
LAUNCH25). One per code per organisation. - Type:
PERCENTAGE(0–100) orFIXED(an amount in a chosen currency). - Duration:
ONCE,FOREVER, orREPEATINGfor a number of months. Only meaningful for subscriptions. One-time charges always behave asONCE. - Max uses: cap on total redemptions, optional.
- Valid window: start/end timestamps, optional.
- Product scope: leave empty to apply org-wide, or restrict to a list of products.
Apply on a hosted checkout link
Pass the code as a query param. It pre-fills the discount field on the checkout page.
https://pay.meridapay.com/pay/<product-slug>?discount_code=LAUNCH25
Apply when minting a checkout from your backend
Pass discount_code on the request body. The response echoes back the resolved discount_amount.
curl -X POST https://api.meridapay.com/checkouts \
-H "Authorization: Bearer $MERIDA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_id": "prod_8f5f7c7e-...",
"customer_email": "[email protected]",
"discount_code": "LAUNCH25"
}'
{
"url": "https://pay.meridapay.com/<token>",
"amount": "29.00",
"discount_amount": "7.25",
"currency": "USD",
"status": "active"
}
Invalid, expired, or scope-mismatched codes return 400 with the field key in error.code. Buyer-typed codes go through the same validation on the hosted checkout, where the form rejects them inline without minting a fresh session.
Subscription discounts
When a discount with duration: REPEATING is attached to a subscription, Merida applies it to the configured number of monthly invoices and then stops. duration: FOREVER keeps applying for the life of the subscription. The applied amount is part of every invoice payload, so you can show it on your own receipts and dashboards.
Next up
Subscriptions →