title: Shopify API - create webhook (batch request)
body: <p>I've managed to go through creating webhook using Shopify API, but I can create only one webhook per request. I've already tried to customize the request so it could possibly create a few webhooks at once, but it doesn't seem to work.</p>
  
  <p>I'm using GuzzleHttp\Client for my requests and this is what my working request look like:</p>
  
  <pre><code>$client = new Client();
  $response = $client-&gt;request(
  'POST',
  "https://{$store}/admin/webhooks.json",
  [
      'headers' =&gt; [
          'X-Shopify-Access-Token' =&gt; $access_token,
          'X-Shopify-Shop-Domain' =&gt; $store
      ],
      'form_params' =&gt; [
          'webhook' =&gt; [
              "topic" =&gt; "orders/create",
              "address" =&gt; $appAddress,
              "format" =&gt; "json"
          ],
      ]
  ]);
  </code></pre>
  
  <p>But when I try something like this:</p>
  
  <pre><code>$client = new Client();
  $response = $client-&gt;request(
  'POST',
  "https://{$store}/admin/webhooks.json",
  [
      'headers' =&gt; [
          'X-Shopify-Access-Token' =&gt; $access_token,
          'X-Shopify-Shop-Domain' =&gt; $store
      ],
      'form_params' =&gt; [
          'webhook' =&gt; [
              [
                  "topic" =&gt; "orders/create",
                  "address" =&gt; $appAddress,
                  "format" =&gt; "json"
              ],
              [
                  "topic" =&gt; "orders/delete",
                  "address" =&gt; $appAddress,
                  "format" =&gt; "json"
              ]
          ]
      ]
  ]);
  </code></pre>
  
  <p>Im getting this:</p>
  
  <p><strong><code>POST https://smshopify.myshopify.com/admin/webhooks.json</code> resulted in 
  a <code>422 Unprocessable Entity</code> response: {"errors":{"topic":["can't be blank","Invalid topic specified. Topics allowed: app/uninstalled, 
  carts/create, carts/u (truncated...)</strong></p>
  
  <p>Is there a way to create couple webhooks in one request, I couldn't find a word about it in Shopify documentation, and my attempts to modify request body are not very successful. What I've managed to do is just foreach topics array and to the single request for every webhook.</p>