[SOLVED] Stripe doesn't charge the user when updating the current subscription upon adding an extra quantity

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

  1. 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’.

  2. 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.

  1. 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.
    stripe-action
  • 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. :muscle:

3 Likes

You saved me from an imminent headache trying to pro-rate charge a customer after updating their sub. This is a big oversight that it’s not a setting in bubble’s stripe integration. Thanks for this!!

1 Like

I’m now with the same issue, and was about to implement the same actions to charge subscription updates throw an API call.

However, i’ve tried the workflow actions below before go to API and it works well. So, i was able to charge immediately and I don’t need the API workaround anymore.


(WORKFLOW OVERVIEW)


(SUBSCRIBE USER TO A PLAN ACTION, with UPDATE EXISTING SUBSCRIPTION FLAGGED)


(CREATE AN INVOICE ITEM ACTION)


(PAY AN INVOICE ACTION)

I know the plugin must have had numerous changes from 2022 to today (and maybe what I did today coudn’t be avaiable in that period). For this reason I wanted to record what I did to solve the problem reported initially. I hope it will be useful for other developers with the same question.

2 Likes