Tutorials

How to create discounts that expire after a certain number of subscription payments

Dan Rowden  ·  March 10, 2023

This tutorial shows how you can set up discounts that expire after a certain number of subscription renewals.

For example, you can discount a new customer's subscription by 50% for their first 3 months and then return them automatically to the original price for the rest of their subscription.

At the moment, repeating discounts can only be controlled on a monthly frequency. This means that for a yearly subscription, you will need to use "24" if you want the first 2 payments to have the discount. For daily or weekly subscriptions, repeating discounts are not recommended.
We have planned a better system for repeating discounts, which is now in our backlog.

How to create expiring subscription discounts in your Lemon Squeezy dashboard

In your Lemon Squeezy dashboard, go to Store > Discounts add create a new discount.

Towards the bottom of the form, enable the "Discount applies every month?" option.

Input the number of months the discount should be applied for.

Now save the discount.

That's it! Any customer who uses your discount at checkout will get the discount applied for the first number of months you specified.

Tip: To create a discount that repeats forever, check the "Discount applies forever" option below the month field.

How to create expiring subscription discounts with the Lemon Squeezy API

With the API, you can create discounts programatically.

When creating a discount, you can create a repeating discount using the duration and duration_in_months attributes to determine how long the discount should be applied for.

For example:

curl -X "POST" "https://api.lemonsqueezy.com/v1/discounts" -H 'Accept: application/vnd.api+json' -H 'Content-Type: application/vnd.api+json' -H 'Authorization: Bearer {api_key}' -d $'{ "data": { "type": "discounts", "attributes": { "name": "10% off for the first 3 months", "code": "10PERCENT3MO", "amount": 10, "amount_type": "percent", "duration": "repeating", "duration_in_months": 3 }, "relationships": { "store": { "data": { "type": "stores", "id": "1" } } } } }

More options:

  • If you want to create a discount that applies to all subscription payments, change duration to "forever" and remove duration_in_months.

  • Omitting duration and duration_in_months from the request (or using "duration": "once") will create a discount that will only be applied to the initial subscription payment.

Previous
Change a subscriber's plan