The Container Events API provides a list of events that affect a specific container.
In addition to retrieving past container events, users can receive a message when a new event occurs by subscribing to a container with a callback URL.
Endpoints
POST /container-events
POST /container-events/subscriptions
POST /container-events/subscriptions/file
GET /container-events/subscriptions/file/:id
GET /container-events/subscriptions
DELETE /container-events/subscriptions/:id
Supported Event Types
Container Position
Container Availability
Rail
Truck
Vessel
Barge
The container events object
Attributes
container string
details object($containerDetails)
events array of object($containerEvent)
The container events object
{
"container": "APZU4812090",
"details": { ... },
"events": [ ... ]
}
The container details object
Attributes
freightKind string
iso string
terminal string
shipmentState string
shipmentStatus string
shipmentAction string
carrierBookingNumber string
billOfLadingNumber string
carrierScac string
carrierName string
yardBlock string
isHazardous boolean
isReefer boolean
holds array of string
freeTimeExpiration datetime
weight string
weightUnit string
weightQualifier string
inTime datetime
inCarrierMode string
inCarrierScac string
outTime datetime
outCarrierMode string
outCarrierScac string
The container details object
{
"freightKind": "LADEN",
"iso": "4500",
"terminal": "NIT",
"shipmentState": "DEPARTED",
"shipmentStatus": "Not Available",
"shipmentAction": null,
"carrierBookingNumber": null,
"billOfLadingNumber": "123456789",
"carrierScac": "SQQY",
"carrierName": "SLS",
"yardBlock": null,
"isHazardous": false,
"isReefer": false,
"holds": [ ],
"freeTimeExpiration": null,
"weight": "10700",
"weightUnit": "K",
"weightQualifier": "N",
"inTime": "2022-05-15T15:35:53.471",
"inCarrierMode": "VESSEL",
"inCarrierScac": "SQQY",
"outTime": "2022-05-18T13:55:49.465",
"outCarrierMode": "TRUCK",
"outCarrierScac": "ABCD"
}
The container event object
Attributes
eventType string
eventTime datetime
eventCreatedTime datetime
eventData object($eventData)
notes string
The container event object
{
"eventType": "UnitGateOutEstimated",
"eventTime": "2022-05-18T12:00:00",
"eventCreatedTime": "2022-05-18T11:45:19.104",
"eventData": { ... },
"notes": "License Plate: VTW-9999"
}
The event data object
Attributes
terminal string
holds array of string
yardSlot string
chassis string
chassisType string
carrierScac string
vehicleId string
voyageId string
vesselPhase string
vesselType string
vesselCell string
The event data object
{
"terminal": "NIT",
"holds": null,
"yardSlot": null,
"chassis": "CHAZ123456",
"chassisType": "CH40",
"carrierScac": "ABCD",
"vehicleId": "9354167",
"voyageId": "2202E",
"vesselPhase": "INBOUND",
"vesselType": "DEEPSEA",
"vesselCell": "221214"
}
Get Conatiner Events
Query Parameters
equipmentId
referenceId
Returns
Status 200
The container events object.
GET /container-events
RESPONSE
{
"container": "BEAU2752848",
"details": { ... },
"events": [
{
"eventType": "UnitVesselArrivalEstimated",
"eventTime": "2022-05-10T08:00:00",
"eventCreatedTime": "2022-05-01T11:14:08.2066667",
"eventData": { ... },
"notes": "HAKM-2202W ETA is 5/10/2022 8:00:00 AM."
},
{
"eventType": "UnitCustomsRelease",
"eventTime": "2022-05-11T03:05:55.4223484",
"eventCreatedTime": "2022-05-11T03:05:55.4223484",
"eventData": { ... },
"notes": null
},
{
"eventType": "UnitVesselDischargeActual",
"eventTime": "2022-05-15T15:35:53.485",
"eventCreatedTime": "2022-05-15T15:35:53.485",
"eventData": { ... },
"notes": null
}
]
}
Get Conatiner Events (Bulk)
Get container events for up to 100 containers.
Requests for must include a bill of lading or booking that is associated with the container.
The endpoint takes a JSON encoded list of up to 100 container event request objects in the POST body and returns a list of container event response objects.
Parameters
A list of container event request objects (100 max). Each object must contain the following properties:
equipmentId
referenceId
Returns
Status 200
A list of container event response objects.
equipmentId
referenceId
data
message
POST /container-events
RESPONSE
[
{
"equipmentId": "BEAU2752848",
"referenceId": "123456789",
"data": {
"container": "BEAU2752848",
"details": { ... },
"events": [ ... ]
}
}
]
Create Subscriptions
Subscribe to container events. Each time a new event occurs, the container event object will be POST-ed to the callback URL provided. Only new events will be included in these messages. There may be multiple events in a single message if they occur closely in time.
The endpoint takes a JSON encoded list of up to 100 container event request objects in the POST body and returns a list of container event response objects.
Parameters
A list of container event request objects (100 max). Each object must contain the following properties:
equipmentId
referenceId
callback
Returns
Status 200
A list of container event response objects.
equipmentId
referenceId
data
message
POST /container-events
RESPONSE
[
{
"equipmentId": "BEAU2752848",
"referenceId": "123456789",
"data": {
"subscriptionId": "0382b97e-0a51-4b10-883e-a5e822d18d3f",
"callbackUrl": "https://www.portofvirginia.com/container-events",
"equipmentId": "BEAU2752848",
"referenceId": "123456789",
"terminal": "NIT"
},
"message": null
}
]
Create Subscriptions from File
Subscribe to container events. Each time a new event occurs, the container event object will be POST-ed to the callback URL provided. Only new events will be included in these messages. There may be multiple events in a single message if they occur closely in time.
The endpoint takes a presigned url in the POST body. The url should point to a file that contains a list of containers and BOLs for which subscriptions will be created.
Parameters
An object with the following properties:
presignedUrl
fileType
callback
callbackMessageType
Returns
Status 200
A request id that can be used to reference the file processing request. The file will be processed by a background job.
requestId
message
POST /container-events/subscriptions/file
RESPONSE
{
"requestId": "0382b97e-0a51-4b10-883e-a5e822d18d3f",
"message": null
}
Get Subscriptions File Status
Returns the status of the subscription file
Query Parameters
None
Returns
Status 200
A subscription request status object.
GET /container-events/subscriptions/file/{id}
RESPONSE
{
"requestId": "0382b97e-0a51-4b10-883e-a5e822d18d3f",
"createdTime": "2023-06-09T09:19:42.1633333",
"processedTime": "2023-06-09T09:23:00.6866667",
"processedSuccessfully": true,
"processingError": null,
"itemsCreated": 100,
"itemsDuplicated": 0,
"itemsNotFound": 0,
"itemsErrored": 0
}
Get Subscriptions
This endpoint returns container event subscriptions. A maxmium of 100 subscriptions are returned at a time.
Query Parameters
page
Returns
Status 200
A list of subscription objects.
GET /container-events/subscriptions
RESPONSE
[
{
"subscriptionId": "0382b97e-0a51-4b10-883e-a5e822d18d3f",
"callbackUrl": "https://www.portofvirginia.com/container-events",
"equipmentId": "BEAU2752848",
"referenceId": "123456789",
"terminal": "NIT"
}
]
Remove Subscription
This endpoint removes a container events subscription. Once the subscription is removed, you will no longer receive events at your endpoint for the container. Removing subscriptions is not required, as they will automatically expire after the container leaves the terminal. Use this endpoint if you need to remove a subscription before it expires.
Query Parameters
None
Returns
Status 200
DELETE /container-events/subscriptions/{id}
RESPONSE
None