#tobias-meterd-subs

1 messages · Page 1 of 1 (latest)

narrow peakBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

storm hedge
ashen sand
#

Im thinking more alomg the lines of, each usage is 10 USD, automatic billing via the threshold property is enabled

#

You add more and more, no problem. But if the usage is the last reported value. And you go from 10 to 5

#

Then I wonder what logic will be executed

storm hedge
#

I see, you'd need to track this on your end accurately, then create the usage, https://stripe.com/docs/api/usage_records/create#usage_record_create-quantity. When you report this usage, and if there more than one usage record with the same timestamp, Stripe adds the quantity values together. In this case, you'd want to accurately report the usage of 5. You can't later update the usage to a lower amount.

narrow peakBOT
#

metered-sub

#

tobias-meterd-subs

ashen sand
#

But the usage is the last value in the period

storm hedge
#

What do you mean by this?

ashen sand
#

aggregate_usage=last_during_period

storm hedge
#

Can you add more details here? I don't understand what you're specifically asking

ashen sand
#

If a plan has aggregate_usage=last_during _period and the goes from 10 to 5 usages but it invoiced 10 because of the billing.threshold

#

That happens next

storm hedge
ashen sand
#

So if I report 10 then 5, I would need to get the 10, and calculate a credit-note

#

If I plan on swapping plans or end a subscription

storm hedge
#

I think the best approach here for you is not to report inaccurate usage. Only report the usage after it's confirmed.

ashen sand
#

What if the usage is e.g. 10 USD for renting a hammer for 10 days, but after 5 days you return it, and I want to charge early so I charge 10, but then give back 5.

Here the scenario is that you don't know for sure how many usages it is before the period is over.

#

Along the same lines, we don't for stripe have an easy way of adding the usage after the period is over.

#

Because of the draft invoice only being there for an hour after a sub ended.

#

But you are saying add 1 usage per day, I assume.

storm hedge
#

That is correct, you can report the usage per day.

ashen sand
#

Roger. Thanks for the help. I hoped the mechanics would auto generate a credit-note

#

Per day it is

storm hedge
#

Your business use case seems a bit unique. As you'd like to charge the customer upfront and then refund any funds back to them. It almost makes me think if what you're looking for us https://stripe.com/docs/payments/place-a-hold-on-a-payment-method. When you create an authorization where funds will be held for you and then days later, you can capture the funds. The above document has more information on the limitations.

With reporting the usage per day, as you scale and become a larger company this won't work. You'll make so many calls each day.

ashen sand
#

I was thinking I could report the day usage early each day.

storm hedge
#

That works when you have a small client, but as you grow, that will be hard to scale.

ashen sand
#

We don't need to hold the money, but was nice of you to think about that case

#

If you have 50k customers then it would take about 500 seconds to report the usage, as I understand it