Keeping in sync

Webhooks are the best way to keep your app up-to-date with the data in your merchants' stores. Channel apps have access to all of Shopify's app webhook topics and six channel-specific topics: product_listings/add, product_listings/update, product_listings/remove, collection_listings/add, collection_listings/update, and collection_listings/remove.

The add webhooks will fire when a merchant publishes a product in your channel. Remove webhooks are triggered when a product is destroyed, or unpublished from your channel. Keep in mind that an unpublished product may not have been permanently deleted, and could be added again in the future.

Sample webhook creation request:

POST /admin/webhooks.json HTTP/1.1
Host: channelsrule.myshopify.com
X-Shopify-Access-Token: 085abas8bd90325c3f81s8e9c88befc0
Content-Type: application/json

{
    "webhook": {
        "topic": "product_listings/add",
        "address": "https://yourchannelapp.com/webhooks",
        "format": "json",
    }
}

View Response

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
X-Shopify-Shop-Api-Call-Limit: 1/40

{
    "webhook": {
        "id": 125777732,
        "address": "https://yourchannelapp.com/webhooks",
        "topic": "product_listings/add",
        "created_at": "2015-12-08T06:16:53+01:00",
        "updated_at": "2015-12-08T06:16:53+01:00",
        "format": "json",
        "fields": [],
        "metafield_namespaces": []
    }
}

Updating orders

From time to time, your sales channel may need to update an order that has been created in Shopify. Refer to the Refunds API, the Transactions API and the Orders API for more information about changes that you can make to the order after the purchase is complete.