Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dylanryan's avatar

How to automatically bill a customer when changing the quantity of a subscription item via the Lemon Squeezy API

Hey, I know this might not be the absolute perfect place for this, but I can't seem to find a solution to this problem. The Lemon Squeezy support itself isn't really helpful either with their super slow ticket response time.

I have a volume subscription in Lemon Squeezy, which means it's billed per seat in the workspace. Now, every time a user adds someone to the workspace, I need to add another seat to the subscription. Currently, I do that using the subscription-item endpoint. This works totally fine; it increments the quantity on the subscription item. However, it doesn't directly bill the user. It only bills the user on the next billing cycle.

But instead, I want it to bill the user instantly. I've tried using the subscriptions endpoint, but no luck there. There's something with proration and immediate payments, but it doesn't do anything because you can't update a subscription item's quantity and the subscription itself at the same time.

If you change the quantity via their Dashboard, there's an option called "Apply changes with proration and invoice immediately" and it works as expected. And when you check the network tab when doing that, it has a "billing_behavior" parameter set to "immediately-with-proration" in the payload, which doesn't work via the API.

Maybe I'm just blind, or maybe it really doesn't work with their API.

Hopefully, someone of you guys has already discovered this and can help me with this one. Thanks in advance!

0 likes
4 replies
scottzirkel_hbi's avatar

I've been banging my head against my desk trying to figure this out as well. From what I can tell, it's something you can only do in the dashboard, which is quite unfortunate, especially if you offer a subscription with an annual plan.

ricardoarg's avatar

@dylanryan They added "invoice_immediately": true to that endpoint, but now it keeps giving an error 500 using that property or not (At least in test mode, I don't know if it works on production)

2 likes
dylanryan's avatar

@ricardoarg Nice! Thanks for the heads up. It seems to be broken right now; you are right - same for me. I guess or hope that it will be updated in the next few days. I've encountered many bugs today.

1 like

Please or to participate in this conversation.