#teddy06894
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- teddy06894, 6 days ago, 8 messages
Hi!
I have some doubts about the webhooks. I am implementing a subscription service and I have a webhooks listening the following events:
customer.subscription.created
customer.subscription.updated
customer.subscription.deleted
invoice.paid
But I am having some problems because when I receive the customer.subscription.created I save in my db some information
But in some cases I receive the invoice.paid or the customer.subscription.updated but I don’t have yet the subscription in my database
Hi, can you share an example of this instance? You can share the event id here with me which starts with evt_.
But the subscription exists in Stripe
I can't comment on how you set you your database, but I can look clarify when events are triggerred and the timeline to help look with you
Is only a problem with the webhooks because they are asynchronous
The timeline is
- Customer.subscription.created
- Customer.subscription.updated
- Invoice.paid
That is right, and the ordering of webhook events is not guaranteed, https://stripe.com/docs/webhooks#event-ordering
That’s the problem
Because in some cases I will try to update a subscription that I don’t have yet in my database
You need to handle this gracefully on your end as the ordering of events is not guaranteed.