src/ShopifyApp/Services/WebhookManager.php
public function createWebhooks()
    {
        $configWebhooks = $this->configWebhooks();

        // Create if it does not exist
        $created = [];
        foreach ($configWebhooks as $webhook) {
            // Check if the required webhook exists on the shop
            if (!$this->webhookExists($webhook)) {
                // It does not... create the webhook
                $this->api->rest('POST', '/admin/webhooks.json', ['webhook' => $webhook]);
                $created[] = $webhook;
            }
        }

        return $created;
    }
public function createWebhooks()
    {
        $configWebhooks = $this->configWebhooks();

        // Create if it does not exist
        $created = [];
        foreach ($configWebhooks as $webhook) {
            // Check if the required webhook exists on the shop
            if (!$this->webhookExists($webhook)) {
                // It does not... create the webhook
                $this->api->rest('POST', '/admin/webhooks.json', ['webhook' => $webhook]);
                $created[] = $webhook;
            }
        }

        return $created;
    }
public function createWebhooks ( ) { $ configWebhooks = $ this -> configWebhooks ( ) ; // Create if it does not exist $ created = [ ] ; foreach ( $ configWebhooks as $ webhook ) { // Check if the required webhook exists on the shop if ( ! $ this -> webhookExists ( $ webhook ) ) { // It does not... create the webhook $ this -> api -> rest ( 'POST' , '/admin/webhooks.json' , [ 'webhook' => $ webhook ] ) ; $ created [ ] = $ webhook ; } } return $ created ; }
Creates webhooks (if they do not exist).

@return array
Creates webhooks ( if they do not exist ) .