#aleem-subscription-updates

1 messages · Page 1 of 1 (latest)

chrome anvil
#

Hi there, let's chat in this thread.

#

You said: "My first instinct was to use the events api but it doesn't look like I can scope that down to just a specific customer or subscription? Is there a way to get all the events for a particular customer/subscription?"

#

To accomplish what you are looking for you want to implement Webhooks

#

Then you listen for customer.subscription.updated events and update your database and show the changes for a Subscription.

shrewd fox
#

I was hoping to just use the API and not have to store the event data on my end - can I query Stripe for this information?

#

I see the dashboard shows all the events for a subscription - is there an equivalent api call?

chrome anvil
#

Yes you can retrieve the Subscription via the API if you prefer to go that route.

#

You wouldn't retrieve the events in this case

#

That doesn't really make sense

shrewd fox
#

Why doesnt it make sense? THe dashboard shows it

chrome anvil
#

Because Events are for Webhooks

#

Like if you want to do that you could, but it is essentially an extra step

#

And you can only list and retrieve events from the past 30 days

#

Why would you want to retrieve events as opposed to just retrieving the Subscription object itself?

shrewd fox
#

I want to build a page like this in our internal tools:

#

but I dont want to store all the event data ourselves

chrome anvil
#

Like I said, that is impossible. You would have to store this data yourself.

shrewd fox
#

given I havent been storing the events in the past, is it impossible to get this data

#

like if i started storing events today then going forward i could show history, but any ideas for what i could do for historical data?

#

does sigma have this data?

chrome anvil
#

No you can't retrieve Event data past 30 days.

#

Sigma does not have Event data

#

So yeah... if you wanted the above it would only be forward looking

#

Even our events in the Dashboard get cut to just a small summary after 30 days

shrewd fox
#

i wonder if I can reconstruct it from all the invoices generated

lost lintel
#

👋 I'm hopping in since bismark has to head out soon

#

You could try, but I imagine it'll really depend on what specific changes you want to show to your customers