#Laekipia-usage-timestamp

1 messages · Page 1 of 1 (latest)

past niche
polar spindle
#

Yes, I want to retrieve the timestamp of a usage record object using the node API. How do I do this?

past niche
#

You can't retrieve individual usage records

polar spindle
#

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

past niche
#

I need the timestamp for the usage record so I can change its value
Change which value?

polar spindle
#

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?

past niche
#

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

polar spindle
#

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?

past niche
#

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?

polar spindle
#

The Dashboard only shows the time up to the minute, not seconds and milliseconds

#

How do I substract the quantity then?

past niche
#

You can't decrement, unfortunately

#

My recommendation would to just adjust the net usage of a future record

polar spindle
#

Ok thank you for your help

past niche
#

np! Going forward I'd recommend persisting your usage records elsewhere too