Webhooks

Updated on 04th June 2022 in Notifications

Webhooks are a great way to notify your (or 3rd party) applications when an event occurs, such as a new order being created, or a customer being updated. 

Some common examples of webhook use cases are:

  1. Update your own database, or sync the data with your CRM when an order is created in Shoprocket
  2. Get notified when a product is created or updated; then sync your Shoprocket catalogue with your local database
  3. Add or remove email addresses from your mailing list when they subscribe or unsubscribe via Shoprocket

To set up a webhook, head to 'Developer' in the 'Settings' section of your Shoprocket dashboard and then:

  1. Click on "Add Webhook" and then select which event(s) you want to be notified of from the "Select Events" dropdown.
  2. Next, enter the URL that you would like the webhook payload sent to (this must be an absolute URL, such as https://mysite.com/webhooks)
  3. Click on "Save Webhook"
  4. In the next page, you'll see a summary of your webhook, including the status, the events it is sending, and the secret key.

The secret key can be used in your receiver to verify that a request to your callback URL is a valid request from Shoprocket.

We currently support the following webhook events:

  1. order.created - fired when an order is created
  2. order.updated - fired when an order is updated 
  3. order.deleted - fired when an order is deleted
  4. customer.created - fired when a customer is created
  5. customer.updated - fired when a customer is updated
  6. customer.deleted - fired when a customer is deleted

You can also click on "Send test data" in the top-right menu, where you can choose which event to test. We will then send a test webhook event to your endpoint with dummy data, which you can then verify your end. We will also verify the webhook response and display the output in the modal.

Below is an example webhook payload for order.created:

We suggest using https://webhook.site to quickly test webhooks with instant visual feedback on the payload.

Can’t find what you’re looking for?

Chat with us 👋

or contact us on [email protected]


as featured in