Hi everyone!
I’m working on a project that requires a user to subscribe to a plan. Then he can invite other users and add a number of additional users to his subscription. The problem is that Stripe doesn’t charge the user for the additional number at the moment. Stripe just draws an upcoming invoice for the next billing period for x2 amount of money (roughly speaking).
Stripe pricing.
We have two prices with Monthly and Yearly billing periods. The pricing model is ‘Graduating pricing’. So, if a user subscribes to a plan, Stripe charges him. Then he adds any number of users and doesn’t pay for them until the next billing period. At the beginning of the next billing period Stripe charges the user twice (x2). It’s because Stripe says: ‘When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.’ Link to docs: Stripe API reference – Update a subscription – curl
Subscription workflow
-
The user subscribes to a plan with a Yearly billing period. Here we use a standard Bubble’s action ‘Subscribe the user to a plan’.
-
Then he adds a number of users. Here we use the action ‘Subscribe the user to a plan’ with the ‘quantity’ parameter and with the checked ‘Update existing subscription’ checkbox.
-
Now we can see the total number of users on Stripe’s dashboard. And the first user pays nothing for them during the whole current billing period. But it will pay twice for the next billing period.
-
Definitely, in the ‘Subscribe the user to a plan’ we need a ‘Charge immediately’ checkbox.
- Ok, let’s try to upgrade the subscription with a standard Bubble’s action ‘Update a subscription item’. Oops! It hasn’t the ‘quantity’ parameter.
- Here we experience the same behavior.
- Indeed, in the ‘Update a subscription item’ we need a ‘Charge immediately’ checkbox and the ‘quantity’ parameter.
The solvation.
Stripe says: ‘If you want to charge for an upgrade immediately, pass proration_behavior
as always_invoice
to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment.’ in the docs (the link is above).We go to the API Connector and create a call where we add three parameters:
- for the subscription item id
- for the quantity and
- the ‘proration_behaviour’ parameter with the value ‘always_invoice’.
That’s it. Now Stripe adds an extra quantity to an existing subscription and charges immediately for this additional quantity.
The appeal to Bubble.
It’s very annoying to see such unpleasantness before handing over a project. When you know that all works perfectly, because you created and tested many times the Subscription plan in Stripe:
- User subscribed? Yes.
- A number of users are added? Yes.
- Perfect!
But the project’s owner will see the first profit a year later. So, please, add to the ‘Subscribe user to a plan’ action a ‘Charge immediately’ checkbox with a link to the documentation where a user will see the above nuances of the Stripe subscription update.
Also, please, add to the ‘Update a subscription item’ action a ‘Charge immediately’ checkbox and the ‘quantity’ parameter.
@cminwk, I thank you for solving the problem.