#dbjpanda

1 messages · Page 1 of 1 (latest)

true coyoteBOT
timid leaf
#

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)

spring bay
#

What I am asking is Proration needs to be calculated not considering time. But considering only quantity.

timid leaf
#

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.

spring bay
#

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.

timid leaf
#

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.

spring bay
#

I want to charge 25€ imdemitiately

timid leaf
#

And not change the billing period?

spring bay
#

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.

timid leaf
#

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.

spring bay
#

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?

timid leaf
#

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.

spring bay
#

Well can you please explain a bit about your last line?

How can I create an invoice?

timid leaf
spring bay
#

Okay, and how will I update the subscription from basic to premium once paid?

#

Or will it be automatically updated once customers pay?

timid leaf
spring bay
#

And won't it ask for any further payment? Do I need to pass any necessary parameters?

timid leaf
#

You'll want to set proration_behavior to none

spring bay
#

Well, I am trying it out. Please don't close the thread. I might have a few more questions. Thank you so far.

timid leaf
#

Happy to help!

spring bay
#

How can I set the amount let's say 25€ in create invoice?

timid leaf
#

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.

Learn how to create and send an invoice with code.

spring bay
#

An offtopic, Is it possible to set the amount in the create checkout session?