#nobodylovesm3-usage-record
1 messages ยท Page 1 of 1 (latest)
I'll check if we can reduce usage, but for already charged items, what could also work is to make a refund: apply it as a discount on the next month, or partially refund the previous month charge.
Hi ๐ I'm not sure I understand the scenario. Would you mind clarifying? If the subscription is progressing to the next billing period, then yes usage will reset.
Let's say we have a system that creates a basket with fruits - you can have up to 10 fruits per basket and unlimited baskets
once you create a basket with 5 fruits, we send to Stripe that the user has used "5" fruits thus increasing the quantity
1 month passes, the user pays XX amount
@long flame if I'm correct, you are correcting a user's usage from the previous cycle, in the new cycle, right ?
but decides to edit the basket, makes it 7 fruits - we need to send those 2 to Stripe, and if he changes it to 3, we would send -2 (so he must be refunded the amount for those 2 fruits)
I would recommend you to simply partially refund the previous cycle's charge.
Sounds like you might want to be using Licensed usage instead of Metered
@proper violet i will look into this
@random patio not really because we would like to have tiers as well and pricing to be based on quantity
or perhaps i don't understand it clearly, i'll look into that as well
We have that as an option also, it's our Graducated pricing model.
and the payment has to be at the end of the period*
Ah, only metered does that.
yes. so I'll resort to refunds then, I guess, thanks
i forgot to ask about the other case - to edit the current cycle's usage, is that possible? because i saw that only "action: increment" is available for metered billing @random patio
That's going to depend on what recurring.aggregate_usage is set to on your Price:
https://stripe.com/docs/api/prices/create#create_price-recurring-aggregate_usage
If it's set to sum then you can only use increment
https://stripe.com/docs/api/usage_records/create#usage_record_create-action
But if you're using last_during_period or last_ever then you can use set to set the current usage rather than only being able to increment.
https://stripe.com/docs/products-prices/pricing-models#reporting-usage
it's sum, yes ๐ฆ
so there's no option to reduce it but have to use refunds here as well?
I think it's pretty worth it for you to rewrite a bit of code to use last_during_period rather than sum.
This will be better for handling your refunds issues for current periods, with refunds in last resort in case the cycle is over !
I see, thanks
Refunds/customer credits are an option. But you can also intercept the invoice when it gets created as there is a 1-hour delay before they finalize. You could then manually update the invoice to adjust how much it bills for.