Create a new Webhook

YouShop
New Member
1 0 0

I am trying to create a webhook as described in https://shopify.dev/api/admin-rest/2021-10/resources/webhook#[post]/admin/api/2021-10/webhooks.json

My request:

$response = $this->client->request('POST', $url, [
'headers' => [
'Content-Type' => 'application/json',
'X-Shopify-Access-Token' => $company->getShopifyAccessToken(),
],
'json' => [
'path' => 'webhooks',
'body' =>' {
"webhook": {
"topic": "orders/create",
"address": "https://example.com",
"format": "json",
"fields": [
"id",
"note"
]
}
}',
],
]);

123.png

And I get the answer 

"HTTP/2 400  returned for \"https://test-yougiver.myshopify.com/admin/api/2021-10/webhooks.json\".",

 without explaining what the error is

Replies 0 (0)