#alexisadeveloper
1 messages · Page 1 of 1 (latest)
https://stripe.com/docs/billing/subscriptions/prorations
https://stripe.com/docs/api/invoices/upcoming
https://stripe.com/docs/billing/subscriptions/prorations#preview-proration
The way proration works in Stripe by default is
- you have a subscription that is from 1 Oct -> 1 Nov for $100
- on Oct 20 you change to a plan that is $200
- we generate two prorations
- a charge for 10 days of $200
- a refund for 10 days of $100
- on 1 Nov, the Invoice(and if you use retrieveUpcoming this is what you are previewing) has three line items, the charge, the refund, and the $200 for the upcoming Nov 1 -> Dec 1.
Is there any way to accurately calculate this without actually updating the subscription? I need clients to be able to accurately see what their next invoice is before they actually upgrade their subscription.
You can using this API:
https://stripe.com/docs/api/invoices/upcoming
Thank you I will try this out