#nstripe-metered-billing

1 messages · Page 1 of 1 (latest)

gloomy cove
sharp whale
#

The Stripe request ID: req_3oKj7N7xYC8DMC

gloomy cove
#

hello, haven't run into that but looks like just a limitation, that with billing thresholds you can only use increment

and it kinda makes sense too, you work up to the different thresholds and can't arbitrarily increase/decrease the usage amount whenever as that would break the billing threshold mechanism

sharp whale
#

Hmm, we're actively using set for setting usage for this product without issue.

So I'm trying to figure out why this particular one isn't working. Maybe it's the way the subscription is setup.

upper swan
#

Sorry, missed you replied my bad, looking

#

@sharp whale the error message is a big confusing but what it means is "if your subscription has billing thresholds, you are not allowed to use set you can only use increment"

#

the idea is that if you have a billing threshold to charge after $10 of usage, increment quantity to 100 => charge, then you set it to 10 what happens? Should we refund?
So we don't support this

sharp whale
#

@upper swan Thanks. I don't think I have billing thresholds set for the subscription or the subscription item though... that's what's making me scratch my head.

upper swan
#

ah sorry let me check further. will take some time, channel is extremely busy, and same internally

sharp whale
#

No worries, I appreciate it

fluid timber
#

@sharp whale Do you have an example of some of the successful requests you have? Just want to be able to compare

sharp whale
#

@fluid timber Yes, here's an example request that worked req_smVmjKrVv5OqCO

upper swan
#

@sharp whale okay so we looked and you did set billing_thresholds on that Subscription at some point. At least you passed that parameter explicitly even though you didn't really enable a specific one

#

and our code basically just say unless subscription.billing_thresholds.nil?

sharp whale
#

Does that mean after we enable and disable a billing threshold, we can't use setting of usage records?

upper swan
#

we're going to improve our code to be resilient to this, but that's mostly the error here and you should go and unset the billing thresholds explicitly by passing billing_thresholds: "" top-level on that subscription

#

you disabled it on the subscription item, not the subscription itself I think

sharp whale
#

I believe we set it via the Stripe Dashboard for testing triggering an invoice to be generated... and then we would go in and remove it... but sounds like a residual value is left on the subscription.

upper swan
#

plausibly yes

sharp whale
#

Which isn't clearable via the Stripe Dashboard UI

upper swan
#

you'd need to use the API for this in that case

sharp whale
#

Good to know, thanks for investigating. I'll give that a try.

upper swan
#

Of course. We'll still flag internally that the error message is confusing, and we could do better validating the real billing thresholds

sharp whale
#

FYI, it worked! Thanks