#edutomesco
1 messages · Page 1 of 1 (latest)
Hi there, you can listen to the invoice.upcoming event (https://stripe.com/docs/api/events/types#event_types-invoice.upcoming) to get notified when the new invoice is about to be created
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But I want exactly the moment
I mean i want the webhook exactly on the time the subscription renews
invoice.upcoming it's send a couple of days before
The peroid_start timestamp of the invoice tells you when the new cycle starts
but then what webhook I should listen
but I want to receive the webhook and immediately run an action
The event data of invoice.upcoming webhook is an invoice
.
??
I want to receive the webhook immediately the moment it renews
There's no such events dedicated for this. The closest I can find is invoice.paid. However, if the renewal fails then this event will not occur.
and this: invoice.updated
I think it created even the invoice is paid with success or not
This event will be fired whenever an invoice is updated, so you might get a few invoice.updated when the invoice was updated.
Processing a payment takes time, it's not guarantee that these two events will be fired at exactly the renewal time.
I'd suggest you to take the period_start timestamp and schedule a job to execute your micro service
Okey Nice! thank you