Webhook event notifications
Introduction
Webhook typically are used to connect two different applications. When an event happens on the trigger application, it serializes data about that event and sends it to a webhook URL from the action application—the one you want to do something based on the data from the first application.
On your Chord OMS you can listen to events so your integration can automatically trigger the desired actions
Architecture
Chord OMS uses webhook to notify your application when an event happens in your account. Webhook are particularly useful for asynchronous events like when an order is completed, canceled, or when a shipment changes status.
Begin using webhook 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 webhook?
Metaphorically, webhook 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. ). 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.
Webhook refer to a combination of elements that collectively create a notification and reaction system within a larger integration.
Build a webhook endpoint
The first step to adding webhook 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.
Event Name | Payload Object | Description |
order_completed | Order | Occurs whenever an order is completed |
order_cancelled | Order | Occurs when an order is cancelled |
shipment_shipped | Shipment | Occurs whenever a shipment is shipped |
shipment_updated | Shipment | Occurs whenever a shipment receives an update (like a status change different from shipped or a tracking details update) |
shipment_delivery_status_updated | Shipment | Occurs whenever the tracking code related to the shipment receives a delivery status update |
stock_item_back_in_stock | Stock Item | Occurs whenever a product variant is back in stock |
stock_item_out_of_stock | Stock Item | Occurs whenever a product variant goes out of stock |
| | |
| | |
"shipment_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.
Filter Types
Examples of Events Payload:
Shipment

Stock Item

Complete your webhooks integrations
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
curl http://localhost:3000/api/webhook/endpoints \ -H 'Accept: */*' \ -H "Authorization: Bearer 1dad20831dc47cb20f8a3a8dc73a0ae41d83b32efadae4c2" \ -H 'Content-Type: application/json' \ -d '{ "endpoint": { "target_url": "https://example.com/my/webhook/endpoint", "events": ["order_completed", "order_cancelled"] } }'
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:



If you have any questions or need help, please get in touch with us at help@chord.co.