#shoryudotcom
1 messages · Page 1 of 1 (latest)
hello! do you have example event ids that you can share?
evt_1NY0QBKBXzfl9USoxMOROyKo this one was manually triggered
evt_1NXxDDKBXzfl9USo5n9ginqA this one appears to have been triggered via the network
can you point me to where you're looking at regarding the request body?
anyway! Sorry, but there's no parameter for you can’t distinguish whether it came from your code or the dashboard. While it’s not possible directly, there are ways to work around this depending on how certain you need to be.
The easiest solution is to explicitly pass metadata when you create an object indicating that this comes from your code. This means that when you create a customer in the dashboard for example you won’t add metadata. The webhook handler can then check the metadata on the object to determine if it comes from the code or not.
It has limitations though as if you update a customer in the dashboard, it would have the metadata already and you would make the wrong assumption.
Another solution is to track all requests made by your code so that you can associated them with the events you receive. Some of our libraries support the ability to retrieve the id of each API request you make, req_1234. You can then match it to the request id coming back in the event in request[id] and be sure that your code did cause that event.
ahhh okay, was planning on the metadata approach but was wondering if there was anything built in. let me see if i can get screengrabs of the entire webhook event emitted with the request body
the auto updated event looks like this:
the "manually" updated event looks like this:
oh hrm, actually you're right, it looks like that request parameter would work. Totally missed out on that : https://stripe.com/docs/api/events/object#event_object-request-id
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I would recommend verifying across different scenarios to be sure though