#dbjpanda
1 messages · Page 1 of 1 (latest)
Hi 👋 our Subscriptions always bill at the beginning of the billing period. So in your scenario, the 25€ that you want your customer to pay, do you want that to be charged at the beginning of the next billing period? (with no prorations included)
A similar example is here https://stackoverflow.com/questions/60969156/stripe-proration-pay-upfront-for-full-billing-cycle-not-the-amount-left-until
What I am asking is Proration needs to be calculated not considering time. But considering only quantity.
That's not a proration then though, prorations are taking into account that your customer already paid for time that they're now not getting access to because their subscription is changing. Is that post the exact scenario you want, if not then I think we should ignore it and focus on what you want to happen.
The question I asked initially is the scenario I want. We can focus on that.
If you read my initial questions at least twice, you can understand my scenario.
So the part I'm still not clear on, is when do you want to charge the 25€ for the new billing period, immediately when the change happens or at the beginning of the next regularly scheduled billing period?
If you want to keep the scheduling the same, but remove the proration calculations, then you would set proration_behavior to none when updating the Subscription.
I want to charge 25€ imdemitiately
And not change the billing period?
Setting Proration behaviour to none doesn't charge anything while upgrading from a plan let's say basic to premium.
No, we can keep the billing period as it was.
Alright, that's going to take a bit of work then. You'll need to suppress our proration calculations, and then create an Invoice to process the one-off payment that you want the customer to pay.
Yes, that can be done. We can set Proration behaviour to none. And simply calculate the amount in our end and ask the customer to pay. But can I pass an amount in update subscription api?
You won't want to, updating the Subscription with any proration_behavior other than always_invoice will not charge the Customer immediately (and using that option will change the billing period so that doesn't sound like what you want either). You will need to instead create an Invoice and advance it through its lifecycle to process a one-off payment for the upgrade.
Well can you please explain a bit about your last line?
How can I create an invoice?
Sure, you can use this endpoint to create an Invoice (setting the subscription parameter to the ID of the Subscription you want the Invoice to be associated with)
https://stripe.com/docs/api/invoices/create
Then this endpoint to finalize the Invoice once you're done creating/editing it:
https://stripe.com/docs/api/invoices/finalize
Okay, and how will I update the subscription from basic to premium once paid?
Or will it be automatically updated once customers pay?
No, it will not be automatically updated, you will need to make a request to update it using this endpoint:
https://stripe.com/docs/api/subscriptions/update
https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
And won't it ask for any further payment? Do I need to pass any necessary parameters?
You'll want to set proration_behavior to none
Well, I am trying it out. Please don't close the thread. I might have a few more questions. Thank you so far.
Happy to help!
How can I set the amount let's say 25€ in create invoice?
You will need to create an Invoice Item for that Invoice, which includes the amount that you want to charge:
https://stripe.com/docs/api/invoiceitems/create?lang=node
You can set amount directly when doing so.
This example shows the steps necessary to create an Invoice:
https://stripe.com/docs/invoicing/integration/quickstart
You can either use Price and Product objects as that sample shows, or use amount directly instead.
An offtopic, Is it possible to set the amount in the create checkout session?