#arfath - unit proration
1 messages · Page 1 of 1 (latest)
Hello, apologies in the delay in reply. To be clear, are these 200 units each 1/200th of a month
Or is this something the user uses up unit by unit?
Can you tell me a bit more about what these units are and how you track them here?
@glossy ivy The user uses unit by unit. I do not track the units in stripe, I track them in my database.
Gotcha. I am consulting a colleague on how you can prorate like that and will get back to you
Thank you!
Hi there. Quick question. So does a user always use all the units every month? Or are there scenarios in which they only use part of their allotted units?
It depends on the user, they have one month to use the units, and the units will expire if not used.
for instance if someone uses all the units of the pack in 10 days and want to upgrade to a higher plan in that case we will not prorate any amount, but if the user has used 150 units in 10 days and now the user wants to upgrade then, in this case, I want to prorate the amount of 50 unit i.e 40$/200 units x 50 units remaining = 10$ prorate
Gotcha. Unfortunately there's not a good way to prorate based on amount with standard subscription quantity billing. The way to do this would be to use metered billing: https://stripe.com/docs/billing/subscriptions/usage-based. You would report usage as the customer uses their units. So, if they would want to upgrade, they would only be charged for the units used. And since you do charge them for unused units, you could just report usage for the unused units at the end of the month
Thanks, but in usage-based, the charge is done in arrears and not advance. We want to charge the customer in advance for some standard units.
So the other option would be to disable prorations on the upgrade and manually calculate the credit amount you want to apply to the invoice
Then issue an invoice item for that credit amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Glad we could help!