#olegc._93209

1 messages · Page 1 of 1 (latest)

exotic starBOT
winged arch
#

Hello! Do you have an example event ID I cn look at that's being sent twice?

exotic starBOT
gaunt steeple
#

Hello. This is the most fresh one: evt_1O9yQDAhWuazYWVija0XAKzh

jade yoke
#

Hi there. Karbi has to step out. Looking

#

Have you seen this happen more than once? Or is this the first time?

gaunt steeple
#

We have ~35 cases before but it's more than 1 month ago so there's probably only basic information left in the records, no idempotency keys

jade yoke
#

In this case this didn't happen due to you not responding to the event in time

#

Both requests were sent to your webhook endpoint at the exact same time

#

2023-11-07 23:11:02 UTC

gaunt steeple
#

We thought it's logical to use the idempotency_key for such cases but it's empty sometimes. What should we use instead, event id?

jade yoke
#

The idempotency key you're referring to is the idempotency key used in the request that triggered the event

#

However this event wasn't triggered by a request

#

So it's expected that field is empty

#

That invoice.paid event was triggered by the subscription's billing logic. It's just a recurring invoice. You didn't make a request to the api to create the invoice

#

Webhook endpoints might occasionally receive the same event more than once. You can guard against duplicated event receipts by making your event processing idempotent. One way of doing this is logging the events you’ve processed, and then not processing already-logged events.

gaunt steeple
#

Strangely enough, I saw nonempty idempotency keys for similar events.
So if I understand it correctly, when Stripe sends two equal requests for the same event, we could use event.id to check if it's the same, right?

jade yoke
#

Yeah

#

It shouldn't happen often though

gaunt steeple
#

Ok. Thank you! Have a good weekend.