#amur0501
1 messages · Page 1 of 1 (latest)
Are you providing an idempotency key in the header of the creation requests for those objects? If so, do you have a Request ID for the creation request(s) that prove(s) this?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
yes, this is the request i'm sending, so here there is an idempotency key
but then in the following webhook event there is nothing
I think this is because there's a separation between those -- your API request with the idempotency key is not what triggers the session completion, thats happening following a user action on teh checkout page
indeed, so there is no way to have an indempotency key there? like tell stripe to automatically add idempotency keys to the webhook events?
No, not as far as I know. Can you explain what you're trying to accomplish?
I might be able to offer another way
I was just thinking of adding an additional check on the idempotency key to make sure that the event won't be processed twice on my side. i guess it's pretty unlikely but lets say if stripe would send the same webhook event twice for some reason
Well if we did, it would have the same idempotency ley value too
You should use the event ID for this
eg, ensure you only process/ingest evt_123 once
and is the event id going to be different after the webhook event retries?
we can and do deliver events more than once sometimes, so its good to be prepared to handle that
No, retried delivery is the same event, same ID
but then lets say in the first try my DB is down so i return an error response, then the retry mechanism sends the event again, but i check if that event has been handled already or not and in this case i will see that i've already handled that event
so i'm not gonna handle it again even though i should
well that would depend on how/when you record that ingestion, yea
but the same issue would apply with an idempotency key value, right?
yea it would, i thought they would be different for each try
Gotcha -- yea that's no how that works, so you'll need to try event ingestion/process by event ID and ensure that handles your edge cases
Yupp, thanks for the help!