#rzzz | Real Deal
1 messages ยท Page 1 of 1 (latest)
Hello ๐
How can I help? ๐
Also, I am assuming you've read this doc already right?
https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
Yes, Already referred to the docs. But i still can't achieve the behavior that i want
Can you elaborate on the behavior you're looking for?
for the metered subscription I want it to be like this. but this is for the standard pricing subscription
here's the metered based subscription
What have you tried so far?
same as the standard pricing i tried the setting the proration_behavior: 'always_invoice',
I think metered usage prorations work differently than standard pricing.. You can't show a whole amount as prorated amount as the total is calculated at the end of the billing period.
I see "Prorations are created only for licensed (per-seat) subscriptions because theyโre billed at the start of each billing period."
yup
If you did want to differentiate and charge different rates depending on when the usage was added, you could do something this:
- Add a new subscription item for the new metered price (do not update the existing subscription item)
- Stop reporting usage for the original subscription item, and report all new usage for the new subscription item
- After the period is over and the invoice has been generated, delete the original subscription item
We won't calculate it automatically though
I'll try this one. Thanks
๐
Is this for the total for the upcoming invoice?
no, for the prorations. The total should be automatically calculated with reported usages.
sorry, I should've been more clearer ๐
No worries. Thanks for the idea
Hi again
@slender stump sorry for the ping.
for the flat fee should it be prorated?
It should be yes but since we don't calculate prorations on metered sub at all, you'd likely need to add a negative invoice item to offset the flat fee
what i did on this scenario is the customers subscription is premium and he had 20 usage for example. then he downgrade his subscription from premium to starter
what do you mean by negative invoice item?
You can think of it as a one-time line item for the invoice
https://stripe.com/docs/api/invoiceitems
https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount
It allows you to add an amount (positive or negative) to offset the final invoice amount
I'll try this one first