#jayy-subscription-proration
1 messages ยท Page 1 of 1 (latest)
jayy-subscription-proration
Hey @keen plaza! I recommend reading https://stripe.com/docs/billing/subscriptions/prorations first which explains how proration works overall.
With your call you are simulating a change from Price A to Price B in the middle of the billing cycle. What we do here is calculate
- The credit for A that was paid but won't be used
- The amount owed for B that wasn't paid yet for the remainder of the month
- The amount owed for B for next month
The first 2 are related to "proration" for the current month and the last one is about next month since the next Invoice would be issued once the period changes
ohh that's why it's not adding up.. price A is being included ..
what i'm trying to do is see how much would the amount be if i'm adding an item to a subscription half way through it's period or after a few days of it starting ..
i think if i keep the subscription as it, and just add the new items it should work
Ah wait in your case you don't switch from A to B, you add B
Let me change wht I said earlier:
With your call you are simulating a change by adding Price B in the middle of the billing cycle. What we do here is calculate
- The amount owed for B that wasn't paid yet for the remainder of the month
- The amount owed for A for next month
- The amount owed for B for next month
alright let me change it and see if the numbers make more sense ๐
but basically the invoice.amount_due should be what the customer is paying instantly yes ?
not at all ๐
it simulates what their next Invoice will be and by default the next Invoice is when the next period starts
We don't charge upfront for proration by default. If your Subscription is on the 1st of the month and on the 15th you add B we say "okay you owe 1/2 of B and we'll add this to your next Invoice"
If you wanted them to pay for that amount immediately you would use proration_behavior: 'always_invoice' when calling the Update Subscription API, see https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior
And you have the same concept on the Retrieve Upcoming Invoice API: https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_proration_behavior