#Ioanna
1 messages · Page 1 of 1 (latest)
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?
Yup excactly
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can you tell me more about this glitch? Happy to look in to it
Yeah I can't seem to turn it off for subscription : sub_1MbguHK9qmDpbyxApxXLTLqX