Webhooks
The events performed by OMS, such as the results of actions carried out in the OMS and the new states of the domain objects, are transferred by OMS to third-party software via webhooks.
When a particular event occurs, webhooks asynchronously notify users who have subscribed to that event via a URL. The webhooks under the roof of OMS are grouped under the four headings below:
- Creating Packages and Status Updates
- Changing Shipment Status
- Creating Transfers and Status Updates
- Creating and Updating Stock Locations
Subscribe
To monitor the actions relating to a particular event, an OMS webhook object must be created containing information such as target_url
, event_type
, etc.
Parameter | Detail |
---|---|
event_type | Event subject to notification |
target_url | URL with the event information |
retry_countdown_config | Can be defined for retry time (fixed-linear-exponential-random) |
additional_headers | If additional header information is required for the requested service, this can be filled (can be null) |
secret_key | can be used if an encrypted key is required for the request. (can be null) |
curl -X POST \
> -H "Authorization: Token <secret login token>" \
> -H "Content-Type: application/json" \
> -d '{"event_type": "package-created",
"target_url": "http://example.com/", "secret_key": "secret", }' \
> http://oms-app.com/whisperer/hooks/
Unsubscribe
curl -X DELETE http://oms-app.com/whisperer/hooks/{webhook-id}/
> -H "Authorization: Token <secret login token>" \
Creating Packages and Status Updates
package.created
Triggered when a new package is created.Triggered when the
package.status.transitioned
status of a package is updated totransitioned
.Triggered when the
package.status.packed
status of a package is updated topacked
.Triggered when the
package.status.cancelled
status of a package is updated tocancelled
.Triggered when the
package.status.shipped
status of a package is updated toshipped
.Triggered when the
package.status.packed_for_refund
status of a package is updated topacked_for_refund
.Triggered when the
awb_number
of apackage.shipment.awb_number
package is set.
Changing Shipment Status
shipment.created
Triggered when a new “shipment” is created for a package or a transfer is set to be made to another location.shipment.status.updated
Triggered when the “shipment” or transfer status of a package is updated.shipment.cancelled
Triggered when the “shipment” or inter-location transfer of a package is canceled.
Creating Transfers and Status Updates
transfer.status.created
Triggered when new transfers are created.Triggered when the
transfer.status.transitioned
status of a transfer is updated totransitioned
.Triggered when the
transfer.status.in_transit
status of a transfer is updated toin_transit
.Triggered when the
transfer.status.transferred
status of a transfer is updated totransferred
.Triggered when the
transfer.status.cancelled
status of a transfer is updated tocancelled
.Triggered when the
transfer.status.ready_to_shipment
status of a transfer is updated toready_to_shipment
.
Creating and Updating Stock Locations
stock_location.created
Triggered when a new stock location is created.stock_location.updated
when a stock location is updated