Tutorials

How to change a subscriber's plan

Dan Rowden  ·  March 16, 2023

This tutorial explains how you can change a subscription's product in the Lemon Squeezy dashboard and with the API.

How to change a subscriber's plan in your Lemon Squeezy dashboard

From Store > Subscriptions, click on a subscription to open its detail panel. Click on "Modify subscription".

This opens a form that lets you choose a new product and variant for this subscription.

You'll also see a few options offering you different ways to handle proration.

Click "Apply changes". The subscription product is changed!

If you chose to charge proration now, a charge will be attempted and, if successful, a receipt will be sent to the customer.

How to change a subscriber's plan with the Lemon Squeezy API

If you have an API integration with Lemon Squeezy, it's easy peasy to change a subscriber's plan.

You just need to make a single API request, specifying the new plan's product and variant IDs.

curl -X "PATCH" "https://api.lemonsqueezy.com/v1/subscriptions/{subscription_id}" -H 'Accept: application/vnd.api+json' -H 'Content-Type: application/vnd.api+json' -H 'Authorization: Bearer {api_key}' -d $'{ "data": { "type": "subscriptions", "id": "{subscription_id}", "attributes": { "product_id": {product_id}, "variant_id": {variant_id}, } } }'

That's it! The subscription will now be on the specified plan.

Tip: Make sure you are saving subscription IDs in your database so that you can edit them with the API. You can use webhooks to receive data of new subscriptions in your product.

By default, a prorated charge will be added to their next renewal if they are changing to a more expensive plan or to a plan with a different billing interval (e.g. changing from a monthly to a yearly plan).

There are two options available to change how proration works.

If you would rather charge the proration amount immediately (rather than adding to the next renewal charge), you can use "invoice_immediately": true in your request.

curl -X "PATCH" "https://api.lemonsqueezy.com/v1/subscriptions/{subscription_id}" -H 'Accept: application/vnd.api+json' -H 'Content-Type: application/vnd.api+json' -H 'Authorization: Bearer {api_key}' -d $'{ "data": { "type": "subscriptions", "id": "{subscription_id}", "attributes": { "product_id": {product_id}, "variant_id": {variant_id}, "invoice_immediately": true } } }'

You can stop proration from happening by adding "disable_prorations": true to your request. The customer will just start paying the new price from the next renewal.

curl -X "PATCH" "https://api.lemonsqueezy.com/v1/subscriptions/{subscription_id}" -H 'Accept: application/vnd.api+json' -H 'Content-Type: application/vnd.api+json' -H 'Authorization: Bearer {api_key}' -d $'{ "data": { "type": "subscriptions", "id": "{subscription_id}", "attributes": { "product_id": {product_id}, "variant_id": {variant_id}, "disable_prorations": true } } }'

You can read more about proration in our Developer Guide.

Previous
Set up SaaS subscription plans