Skip to main content

Coupons API

Coupons create discounts that can be applied to subscriptions or invoices — either as a percentage off or a fixed amount off.

The Coupon object​

{
"id": "LAUNCH50",
"object": "coupon",
"name": "50% off for 3 months",
"percent_off": 50,
"duration": "repeating",
"duration_in_months": 3,
"max_redemptions": 100,
"times_redeemed": 12,
"valid": true,
"created": 1748476800
}

Create a Coupon​

POST /v1/coupons

ParameterTypeDescription
percent_offdecimalPercentage discount (e.g., 50 = 50%). Mutually exclusive with amount_off.
amount_offintegerFixed discount in cents. Mutually exclusive with percent_off.
currencystringRequired if using amount_off.
durationstringforever, once, or repeating.
duration_in_monthsintegerRequired if duration=repeating.
max_redemptionsintegerMaximum number of times this coupon can be used.
idstringCustom coupon code (e.g., LAUNCH50).
# 25% off forever
curl https://api.meridian.dev/v1/coupons \
-u sk_test_4eC39HqL...: \
-d id=EARLYBIRD25 \
-d percent_off=25 \
-d duration=forever

# $10 off first month
curl https://api.meridian.dev/v1/coupons \
-u sk_test_4eC39HqL...: \
-d amount_off=1000 \
-d currency=usd \
-d duration=once

Apply a coupon to a subscription​

await meridian.subscriptions.create({
customer: 'cus_Nk3mHXq7ViGwMz',
items: [{ price: 'price_ProMonthly' }],
coupon: 'EARLYBIRD25',
});

Delete a Coupon​

DELETE /v1/coupons/:id

Deleting a coupon prevents future redemptions but does not affect existing subscriptions already using it.