Knowledgebase

What are Webhooks and how are they used?

 

A webhook is a notification that can be posted from a website to another when certain actions are taken on the originating website. For example, let's say you have an online service for managing orders that accepts webhooks. Using Shift4Shop's specific webhooks you can trigger a notification to that online service that will send the applicable information from your Shift4Shop store to the service.

To create a webhook, follow these steps:

  1. Log into your Shift4Shop Online Store Manager
  2. Using the left hand navigation menu, go to Modules
  3. Use the search bar at the top to search for "Webhook"

This will bring up the Webhook module which will contain a link labeled "Edit Webhooks"

  1. Click on the "Edit Webhooks" link
  2. Look to the top right and click on the "Add Webhook" button
  3. Enter a name for your webhook
    This can be any name you choose and is only used for reference
  4. Next, enter the URL to your external service's Webhook URL This will be supplied by your external service
  5. Select whether you'd like for the transmitted data to be posted in either JSON or XML format.

Note
The data payload will be formatted using the REST API format. More information can be found here.

  1. Next, select the event that will be sent in the payload to the webhook

Currently there are 7 events that can be used for Webhooks:

  • Customer New
    New customer registers on your store
  • Order New
    New order is created
  • Order Status Change
    When an order's status is updated
  • Product Changed
    When a product is edited or otherwise updated in the admin
  • Product Deleted
    When a product is deleted from the store
  • Product New
    When a product is added to the store
  • Product Stock Changed
    When a product's inventory is updated within the admin.
  1. Finally, make sure the Webhook is enabled and click "Save" at the top right to have it ready

The webhook will trigger each time the event occurs and send its payload to your external service.


Help Desk Software by Kayako fusion