#nstripe-metered-billing
1 messages · Page 1 of 1 (latest)
The Stripe request ID: req_3oKj7N7xYC8DMC
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
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.
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
@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.
ah sorry let me check further. will take some time, channel is extremely busy, and same internally
No worries, I appreciate it
@sharp whale Do you have an example of some of the successful requests you have? Just want to be able to compare
@fluid timber Yes, here's an example request that worked req_smVmjKrVv5OqCO
@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?
Does that mean after we enable and disable a billing threshold, we can't use setting of usage records?
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
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.
plausibly yes
Which isn't clearable via the Stripe Dashboard UI
you'd need to use the API for this in that case
Good to know, thanks for investigating. I'll give that a try.
Of course. We'll still flag internally that the error message is confusing, and we could do better validating the real billing thresholds
FYI, it worked! Thanks