#Ioanna

1 messages · Page 1 of 1 (latest)

frank heartBOT
amber sigil
#

Good question, still looking in to this.

#

And I assume the scenario is accidentally recording too much usage on a specific subscription or something similar?

#

And that the aggregate_usage type is sum here?

spark ruin
#

Yup excactly

amber sigil
#

So it does look like set is how we recommend correcting these. If you are already using set to create a usage record you can just create another usage record at the same time and set quantity to 0:

  -u sk_test_xxx: \
  -d quantity=0 \
  -d timestamp={{TIMESTAMP}} \
  -d action=set```
If you are creating them with `action: incriment`  you can retrieve the total usage reported for the timestamp, subtract the quantity that you want to delete, and then create a new usage record at that time with `action: set`
```curl https://api.stripe.com/v1/subscription_items/si_xxx/usage_records \
  -u sk_test_xxx: \
  -d quantity={{TOTAL_USAGE - QUANTITY_TO_DELETE}} \
  -d timestamp={{TIMESTAMP}} \
  -d action=set```
How to get the current usage at that time: https://stripe.com/docs/api/usage_records/subscription_item_summary_list
spark ruin
#

Got it thanks.

#

It looks like there is a glitch on turning off the billing threshold

amber sigil
#

Can you tell me more about this glitch? Happy to look in to it

spark ruin
#

Yeah I can't seem to turn it off for subscription : sub_1MbguHK9qmDpbyxApxXLTLqX

drowsy wind
#

👋 stepping in here

#

Taking a look at the sub

#

What exactly do you mean by "turn it off"?