#Laekipia-usage-timestamp
1 messages · Page 1 of 1 (latest)
Hey, you want the timestamp field on the object (which you will have set when you created it): https://stripe.com/docs/api/usage_records/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes, I want to retrieve the timestamp of a usage record object using the node API. How do I do this?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You can't retrieve individual usage records
So I did try listUsageRecordSummaries() but the result doesn't show the timestamp of the usage record. It only shows the timestamp for the current billing period (start and end). I need the timestamp for the usage record so I can change its value
I need the timestamp for the usage record so I can change its value
Change which value?
I'm trying to change the usage record quantity value. I was told that to do that, I need to replace it with the new value using the exact same timestamp that was initially used. The problem is, I don't know how to get that timestamp. How can I replace the quantity value of a particular usage record?
Yeah, that's right – the records are immutable
This is generally why we recommend people also persist the usage records in your own DB
You might be able to find the usage record and related timestamp in the Dashboard
I made a mistake and created a usage record with the wrong quantity. Is there no way to change it then? Or substract that quantity to the total the customer owes at the end of the billing period?
Or substract that quantity to the total the customer owes at the end of the billing period?
I think that's the best option here if you've no record of the timestamp. Did you check the Dashboard?
The Dashboard only shows the time up to the minute, not seconds and milliseconds
How do I substract the quantity then?
You can't decrement, unfortunately
My recommendation would to just adjust the net usage of a future record
Ok thank you for your help
np! Going forward I'd recommend persisting your usage records elsewhere too