These events are emitted by the Inventory API when travel routes are created or updated (POST or PUT on travel-routes).
Events
| Action |
Event name |
Endpoint |
| Create a new travel route |
travelroutes.created |
POST /travel-routes |
| Update an existing travel route |
travelroutes.updated |
PUT /travel-routes/:travelRouteId |
Payload example created
{
"attemptId": "1c4cdeb3-d7fc-4a0c-b59b-7590e516e8a3",
"created": 1733411106,
"data": {
"_id": "6751c10db534940506d40fae",
"accountId": "52a377ec430c7d4e220001fc",
"colour": "#998877",
"createdAt": {
"offset": 0,
"value": "2024-12-05T15:04:45.043Z"
},
"createdBy": "55fc2f318791db6e1a0000b6",
"enabled": false,
"externalId": "",
"name": "Second one",
"updatedAt": {
"offset": 0,
"value": "2024-12-05T15:04:45.043Z"
},
"updatedBy": "55fc2f318791db6e1a0000b6"
},
"event": "travelroutes.created",
"id": "333c3e05-e89f-40df-ac6e-b049756571d5",
"livemode": true
}
Payload example updated
{
"attemptId": "21acd7b2-a74a-4bd4-8a99-40e056da76fc",
"created": 1733410946,
"data": {
"_id": "674a1beb1e21aa57dff37185",
"accountId": "52a377ec430c7d4e220001fc",
"colour": "#336699",
"createdAt": {
"offset": 0,
"value": "2024-11-29T19:54:19.479Z"
},
"createdBy": "55fc2f318791db6e1a0000b6",
"enabled": true,
"externalId": "",
"name": "Route 1",
"updatedAt": {
"offset": 0,
"value": "2024-12-05T15:01:53.493Z"
},
"updatedBy": "55fc2f318791db6e1a0000b6"
},
"event": "travelroutes.updated",
"id": "dd335382-fb17-4e1f-b903-f613cd3bfd81",
"livemode": true
}
Payload data fields
| Field |
Type |
Description |
_id |
string |
Travel route id (ObjectId format). |
accountId |
string |
Account id. |
name |
string |
The name of the travel route. |
colour |
string |
The colour of the travel route (hex, e.g. #000000). |
enabled |
boolean |
The status of the travel route. |
externalId |
string |
Id of an external system for the travel route, used for integrations. |
createdBy |
string |
User id that created this resource. |
updatedBy |
string |
User id that last updated this resource. |
createdAt |
object |
BzDate — when the object was created. |
updatedAt |
object |
BzDate — when the object was last updated. |