These events are emitted by the Inventory API (btrz-api-inventory) when trips are added to or removed from the filtered-trips blacklist.
Events
| Action | Event name | Endpoint |
|---|---|---|
| Add trip to blacklist | filteredtrip.created | POST /filtered-trips |
| Remove trip from blacklist | filteredtrip.deleted | DELETE /filtered-trip/:filteredTripId |
Payload example (created)
{
"attemptId": "15b0691c-77f5-4b83-9d2d-ad74d9fbbf1e",
"created": 1623793727,
"data": {
"_id": "60c9200d17bda93f5c896bf3",
"accountId": "52a377ec430c7d4e220001fc",
"productId": "507f1f77bcf86cd799439011",
"originId": "52a377ec430c7d4e22000200",
"destinationId": "52a377ec430c7d4e22000201",
"origin": "Origin Station",
"destination": "Destination Station",
"tripSegmentsId": "eyJhY2NvdW50SWQiOiI1MmEzNzdlYzQzMDdjNGQ0ZTIyMDAwMWZjIn0=",
"hashedTripSegmentsId": "a1b2c3d4e5f6",
"segments": [
{
"scheduleId": "schedule-1",
"scheduleDisplayName": "Schedule A",
"originId": "52a377ec430c7d4e22000200",
"destinationId": "52a377ec430c7d4e22000201",
"origin": "Origin Station",
"destination": "Destination Station",
"stops": ["Origin Station", "Destination Station"]
}
]
},
"event": "filteredtrip.created",
"id": "ed7c890d-783e-43f7-8891-f87a02101c02",
"livemode": true
}
Field descriptions — data (filteredtrip.created / filteredtrip.deleted)
| Field | Type | Description |
|---|---|---|
| _id | string | Unique ID for this filtered trip record (24 hex). |
| accountId | string | Account (provider) id. |
| productId | string | Product id this blacklisted trip applies to. |
| originId | string | Id of the origin station for this trip. |
| destinationId | string | Id of the destination station for this trip. |
| origin | string | Name of the origin station. |
| destination | string | Name of the destination station. |
| tripSegmentsId | string | Base64-encoded ID that encodes details of the trip. |
| hashedTripSegmentsId | string | Hash of the tripSegmentsId. |
| segments | array | Segments of the trip (scheduleId, originId, destinationId, origin, destination, scheduleDisplayName, stops). |
Payload example (deleted)
The data object for filteredtrip.deleted has the same shape as the filtered trip that was deleted (same fields as above).
(Field descriptions for data are the same as for filteredtrip.created above.)