#dennis_de

1 messages · Page 1 of 1 (latest)

tidal egretBOT
long umbra
rugged oak
#

I don't have a test record available on hand. Can you send a screenshot of the data you want to get?

long umbra
#

one second

#

Sorry, the screenshot is now in German. But in the end it is the detailed registered usages within a period.

rugged oak
#

Ahhh, okay. So the data won't be aggregated like it is in the Dashboard, but you could pull all the Usage Records via the API and group them by the Subscription Item ID in order to create an aggregation. Aside from that, I don't know of another way to achieve the same view of data

long umbra
rugged oak
#

Right. You would need to transform the data from a list of Usage Records to whatever you are wanting it to look like

long umbra
#

That is clear to me, but where do I find the endpoint that does not give it back to me aggregated but each registered usage individually as in the dashboard?

#

I somehow couldn't find an endpoint to get this data from the API, at least unsummed.

rugged oak
#

but where do I find the endpoint that does not give it back to me aggregated but each registered usage individually as in the dashboard?
There is no API that gives it to you the way you see it in the Dashboard. You have to take the list of Usage Records the API gives you and pull out the data you need from each individual Usage Record

long umbra
#

But how? That seems impossible to me.

#

How am I supposed to get the individual usage records if I only get them totalled for the period? I don't see any chance of recreating this.

rugged oak
long umbra
#

And how do I retrieve the object?

#

The link is only the definition of the object.

#

At the endpoint "usage_record_summaries", the object "usage_record_summary" comes back. But as you say, it's about the object "usage_record" which I don't get back.

rugged oak
#

Ah, apologies, I misread the docs thinking that the usage record summary included individual Usage Record object IDs. That's odd.

I can't read German, but doesn't the usage summary have all the same information? https://stripe.com/docs/api/usage_records/subscription_item_summary_list

long umbra
#

No, the screenshot shows every single registered usage at a timestamp for a period. At the endpoint "usage_record_summaries" only the periods with a "total_usage" (aggregated total) are returned.

#

I'm going to bed now, but feel free to leave the thread open and I'll read the answer tomorrow and reply again with any queries.