How to: Receive event notifications with webhooks
Listen for events on your Chord OMS so your integration can automatically trigger reactions.
Chord OMS uses webhooks to notify your application when an event happens in your account. Webhooks are particularly useful for asynchronous events like when an order is completed, canceled, or when a shipment changes status.
Begin using webhooks with your Chord OMS integration in just two steps:
Create a webhook endpoint on your server.
Register the endpoint on the Chord OMS Dashboard to go live.
What are webhooks
Webhooks refer to a combination of elements that collectively create a notification and reaction system within a larger integration.
Metaphorically, webhooks are like a phone number that Chord OMS calls to notify you of activity in your Chord OMS. The webhook endpoint is the person answering that call who takes actions based upon the specific information it receives.
Non-metaphorically, the webhook endpoint is just more code on your server. The webhook endpoint has an associated URL (e.g. https://example.com/webhooks). The Chord OMS notifications are Webhook Event objects. This Webhook Event object contains all the relevant information about what just happened, including the type of event and the data associated with that event.
Build a webhook endpoint
Write the code that properly handles webhook notifications.
The first step to adding webhooks to your Chord OMS integration is to build your own custom endpoint. Creating a webhook endpoint on your server is no different from creating any page on your website.
Key considerations
For each event occurrence, the Chord OMS POSTs the webhook data to your endpoint in JSON format. The full event details are included and can be used directly after parsing the JSON into an Event object. The webhook endpoint needs to expect data through a POST request and confirm successful receipt of that data.
To acknowledge receipt of an event, your endpoint must return an allowed HTTP status code to the Chord OMS. All response codes outside these, including 3xx codes, indicate to the Chord OMS that you did not receive the event.
If the Chord OMS does not receive a valid HTTP status code, the notification attempt is repeated up to 5 times.
Because properly acknowledging receipt of the webhook notification is so important, your endpoint should return an allowed HTTP status code prior to any complex logic that could cause a timeout.
Allowed HTTP status code
200
201
202
204
Event types
This is a list of all the types of events we currently send.
shipping_delivery_status_updated can only be used if you have a Fulfillment Integration with EasyPost.
Your webhook endpoints should be configured to receive only the types of events required by your integration. Listening for extra events (or all events) will put undue strain on your server and is not recommended.
Examples of event payloads
Complete your webhooks integration
After building, and deploying your webhook, set up the endpoint so the Chord OMS knows where to send the events.
Add endpoints from the Dashboard
Add endpoints with the API
Manage webhook endpoints
Existing webhook endpoints can be updated or deleted in the Dashboard’s Webhooks settings section.
View events
When viewing information about a specific endpoint through the Dashboard, you can check all the attempts related to an endpoint by clicking on that endpoint edit icon in the Webhooks section:
This shows the latest response from your endpoint, a list of all attempted webhooks, and the respective HTTP status codes the Chord OMS received:
Last updated