#Mota
1 messages ยท Page 1 of 1 (latest)
Stripe doesn't support history retrieval. You may listen to webhook events and build your own: https://stripe.com/docs/billing/subscriptions/webhooks
but using events only garanties events for the last 30 days via API, and I need lifetime history
I'm afraid the event API is only up to 30 days. Stripe doesn't provide an API to retrieve lifetime history. I'd recommend start listening to the events, so that event retrieval API isn't required down the road and you will be able to build the history timeline on your own
and is there a way to figure out what happened on the subscription using the invoices, for example?
What do you want to find out about a subscription with a given invoice?
for example, if the plan changed, or if the subscription was reactivated or canceled
For any subscription changed, you can listen to customer.subscription.updated event.
An invoice object contains subscription field which you can find information about it with expanding subscription field.
- Expand an object: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok, thanks I'll take a look a that ๐