#teddy06894

1 messages · Page 1 of 1 (latest)

silver bisonBOT
#

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.

bold cape
#

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

raw badger
#

Hi, can you share an example of this instance? You can share the event id here with me which starts with evt_.

bold cape
#

But the subscription exists in Stripe

raw badger
#

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

bold cape
#

Is only a problem with the webhooks because they are asynchronous

#

The timeline is

#
  1. Customer.subscription.created
#
  1. Customer.subscription.updated
#
  1. Invoice.paid
raw badger
bold cape
#

That’s the problem

#

Because in some cases I will try to update a subscription that I don’t have yet in my database

raw badger
#

You need to handle this gracefully on your end as the ordering of events is not guaranteed.