Radu Dragomir
Radu Dragomir

Reputation: 660

Webhook not created but no error either

I'm trying to create a webhook through the Shopify API. Everything seems fine, but I can't see the webhook created in the backend.

Also, when using the ID received through the response to the API call, I try fetching the webhook (/admin/webhooks/{#id}.json) and I get a 404 not found error.

Here is my PHP code that calls the webhook:

$key = '123456';
$data = array('webhook' => array(
    'topic'   => 'orders/create',
    'address' => BASEURL.'/webhook?key='.$key,
    'format'  => 'json'
));
$webhook = $shopify->post('webhooks.json',$data);
echo '<pre>'; var_dump($webhook); die();

Upvotes: 0

Views: 743

Answers (2)

Radu Dragomir
Radu Dragomir

Reputation: 660

It turns out that webhooks created through the api are not visible form the backend. Also, they are lost once the app is uninstalled.

Upvotes: 1

Vikas Gautam
Vikas Gautam

Reputation: 978

{
  "webhook": {
    "topic": "orders/create",
    "address": "BASEURL.'/webhook?key='.$key",
    "format": "json"
  }
}

also this may help you

Error Creating Shopify Webhook through the API

Upvotes: 0

Related Questions