Setting Up Webhooks
ShipEngine allows you to subscribe to webhooks to receive real-time updates for long-running asynchronous operations. This is useful because it allows your application to move on to other work while the operation is running rather than being blocked until it completes.
It also allows ShipEngine to push updates to your application rather than having your application continually poll for updates.
For example, you may subscribe to the track
webhook event to automatically receive an update anytime a tracking event occurs.
Rather than continually sending a request to the /v1/labels/:label_id/track
endpoint to see if the tracking information has been
updated since the last time you checked, you can subscribe to the track
webhook event and ShipEngine will push the notification
to your application via a webhook whenever the tracking details are updated.
If you're new to webhooks, you can read this guide for more information.
Configuring Webhooks
Before you can begin receiving webhooks, you must configure your ShipEngine account with the HTTP endpoints you'd like for the webhooks to be sent to. You can do this through the ShipEngine Dashboard or through the API.
Configure Using the Dashboard
- Log into the ShipEngine Dashboard.
- Select API Management.
- Select the Webhooks tab.
- You should see a screen similar to the following which lists all the types of events you can subscribe to. For each webhook type you wish to subscribe to, enter a unique, publicly accessible URL where you want the webhooks to be sent and toggle the Status option so that the webhook is active.
- Don't forget to click the Save button.

Configure Using the API
To configure a webhook using the API, you'll need to provide a url
and an event
that will trigger the webhook.
You'll send this data in an HTTP POST request to /v1/environments/webhooks
.
You may only configure one URL per event.
The payload for each type of webhook event will have a unique resource_type
which indicates which type of event triggered the webhook.
The event
names you use in your payload when you configure a webhook through the API as well as the corresponding resource_type
that will be sent in the webhook request for that event are listed below.
Description | event | resource_type |
---|---|---|
Batch completed | batch | API_BATCH |
Shipment rate updated | rate | API_RATE |
Any tracking event | track | API_TRACK |
Carrier connected | carrier_connected | API_CARRIER_CONNECTED |
Sales Orders imported (Beta) | sales_orders_imported | API_SALES_ORDERS_IMPORTED |
Order Source refresh complete (Beta) | order_source_refresh_complete | API_ORDER_SOURCE_REFRESH_COMPLETE |
A requested report is ready | report_complete | API_REPORT_COMPLETE |
Example Request
Testing Webhooks
You can use a service like requestbin.com to create temporary URLs to test webhooks. Any HTTP requests sent to that endpoint will be recorded with the associated payload and headers so you can observe the data sent from our webhooks before configuring your application to accept it.
Webhook Payloads
These are example payloads for the types of webhooks you can subscribe to. You can expect to receive a message with the same structure
as these examples whenever you subscribe to the corresponding event. You'll notice that each payload includes a resource_type
and
a resource_url
. Some payloads will contain additional information as well.