Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Hi,
I have webhook on create orders.
{
"id":146780353,
"address":"https:\/\/supperbellapp.info\/api\/events_after_created_order",
"topic":"orders\/create",
"created_at":"2016-01-26T05:52:25-07:00",
"updated_at":"2016-01-26T05:52:25-07:00",
"format":"json",
"fields":[
],
"metafield_namespaces":[
]
},
We added inventory check in our project (in this webhook) and then I noticed, that we sometimes get twice webhook on create orders.
I added check in our code, but can you help me understand reason for error?
Part of my logs in app and my comments here: https://drive.google.com/open?id=0B703S72xAJ5qdENwWVpQX1JLM0U
Hello Valentina,
It looks like we're occasionally not receiving a response within 5 seconds when sending webhooks to your service. It then times out and assumes that the webhook was not received as per our webhook response guidelines here.
More often than not, prioritizing responding to the webhook before actually doing any processing of it helps cut down on occurrences like this pretty drastically.
Josh | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Dear Josh,
How can i send a 200 response back to Shopify?
I am using the php as the language to communicate with Shopify.
Much appreciated,
Kind regards,
Remie
Remie,
I believed to response back to Shopify is simply use a header()
A good example is
$data = file_get_contents("php://input");
header('HTTP/1.1 200 OK');
...
http_response_code(200):
Thank you!