Webhooks

Webhooks are a tool for retrieving and storing data from a certain event. They allow you to register an https:// URL where the event data can be stored in JSON or XML formats. Webhooks are commonly used for:

  • Placing an order
  • Changing a product's price
  • Notifying your IM client or your pager when you are offline
  • Collecting data for data-warehousing
  • Integrating your accounting software
  • Filtering the order items and informing various shippers about the order
  • Removing customer data from your database when they uninstall your app

Create webhooks

Steps:

  1. From your Shopify admin, go to Settings > Notifications.
  2. Scroll down to the Webhooks section.
  3. Click the Create webhook button. A new window should appear.
  4. From the first drop-down, select the "Event" from the following list:
    • Cart creation: a webhook will be sent every time a cart is created.
    • Cart update: a webhook will be sent every time a cart is updated.
    • Checkout creation: a webhook will be sent every time a checkout is created.
    • Checkout deletion: a webhook will be sent every time a checkout is deleted.
    • Checkout update: a webhook will be sent every time a checkout is updated.
    • Collection creation: a webhook will be sent every time a collection is created.
    • Collection deletion: a webhook will be sent every time a collection is deleted.
    • Collection update: a webhook will be sent every time a collection is updated.
    • Customer group creation: a webhook will be sent every time a customer group is created.
    • Customer group deletion: a webhook will be sent every time a customer group is deleted.
    • Customer group update: a webhook will be sent every time a customer group is updated.
    • Customer creation: a webhook will be sent every time a new customer is created.
    • Customer deletion: a webhook will be sent every time a customer record is deleted.
    • Customer disable: a webhook will be sent every time a customer account is disabled.
    • Customer enable: a webhook will be sent every time a customer account is enabled.
    • Customer update: a webhook will be sent every time a customer record is updated.
    • Draft order creation: a webhook will be sent every time a draft order is created.
    • Draft order deletion: a webhook will be sent every time a draft order is deleted.
    • Draft order update: a webhook will be sent every time a draft order has been updated.
    • Fulfillment creation: a webhook will be sent every time a fulfillment is created on an order.
    • Fulfillment update: a webhook will be sent every time fulfillment is updated on an order.
    • Order cancellation: a webhook will be sent every time an order is canceled.
    • Order creation: a webhook will be sent every time an order is created.
    • Order deletion: a webhook will be sent every time an order is deleted.
    • Order edit: a webhook will be sent every time an order is edited.
    • Order fulfillment: a webhook will be sent every time an order is fulfilled.
    • Order payment: a webhook will be sent every time an order has been paid.
    • Order update: a webhook will be sent every time an order has been updated.
    • Product creation: a webhook will be sent every time a product has been created.
    • Product deletion: a webhook will be sent every time a product has been deleted.
    • Product update: a webhook will be sent every time a product has been updated.
    • Refund create: a webhook will be sent every time a refund is issued.
    • Shop update: a webhook will be sent every time a shop property is updated.
    • Theme creation: a webhook will be sent every time a theme is created.
    • Theme deletion: a webhook will be sent every time a theme is deleted.
    • Theme update: a webhook will be sent every time a theme property is updated.
  5. From the second drop-down, choose the format in which you would like Shopify to send this information to you. The two choices are JSON or XML.
  6. Under URL, enter the URL where you would like data to be stored. It is important to note that webhooks cannot be returned to the following URLs:
    • Localhost
    • Any URL ending in the word "internal" (i.e. thisshop.com/internal)
    • Any URL from any custom domain attached to the store
    • "Fake" domains like www.example.com
    • Shopify domains (i.e. shopify.com and myshopify.com)
  7. Click Add webhook. Your webhook should now appear under the "Webhooks" section.
  8. You also have the ability to test your webhook, to make sure the information you want is being sent to the correct URL. To do this click the send test notification link. Verify at the URL that you specified that this works.

Delete webhooks

Steps:

  1. From your Shopify admin, go to Settings > Notifications.
  2. Scroll down to the Webhooks section.
  3. Next to the webhook you created, there should be a little trash can icon.
  4. Click the trash can icon to delete the webhook.

Ready to start selling with Shopify?Try it free