Skip to main content
In this tutorial, you will list the shipment and container records created from your tracking requests. Use this step after you have created at least one tracking request.

Shipment and container data in Terminal49

After Terminal49 accepts a tracking request, it starts collecting available data from carriers and terminals. You can retrieve the latest stored data at any time with the Shipments and Containers endpoints. Use these endpoints for on-demand lookups. For ongoing status monitoring, use webhooks instead of polling.

Which object holds which field?

Tracking data is split across two resources. If you query the wrong endpoint you will not see the field you expect — for example, pod_eta_at is not returned by GET /containers because it lives on the shipment.

Fetching shipment fields alongside a container

If you already have a container ID (or are filtering by container number) and want the shipment ETA fields in the same response, use the include query parameter to embed the related shipment:
The shipment record — including pod_eta_at, pod_original_eta_at, and destination_eta_at — is returned in the top-level included array. See Include related resources for the full syntax.

Authentication

As in the previous steps, every request sends your API key in the Authorization header:
If you don’t have an API key yet, get one from the developer portal as described in Start Here.

List all your tracked shipments

If your tracking request was successful, you will now be able to list your tracked shipments. Replace YOUR_API_KEY with your API key:
Sometimes it takes a few minutes for a new tracking request to appear as a shipment. Copy the response into a text editor so you can inspect it while continuing the tutorial.
Responses follow the JSON:API format, which is why they are larger and more structured than plain JSON. See the JSON:API note in Track Shipments and Containers for tips on parsing it.

Inspect the shipment response

The /shipments response returns an array of shipment objects. Each shipment includes attributes, relationships to related records, and a self link. For clarity, some fields have been replaced with ellipses (...), and inline comments call out the key fields. The data attribute contains an array of objects. Each object is of type shipment and includes attributes such as bill of lading number and port of lading. Each shipment object also has relationships to structured data objects like ports and terminals, as well as a list of containers on the shipment. You can access these structured elements through the API. Terminal49 cleans and enhances the data from the shipping line, so you get a pre-defined object for each port, terminal, and other entity.

Sample code: listing tracked shipments in a Google Sheet

Below is code written in Google App Script that lists the current shipments into the current sheet of a spreadsheet. App Script is very similar to Javascript. Because Google App Script does not have native JSON:API support, you need to parse the JSON directly, making this example an ideal real world application of the API.

List all your tracked containers

You can also list out all of your containers. Container data includes terminal availability, last free day, holds, fees, and other logistical information that you might use for drayage operations at port.
To learn how to use holds and fees data to determine if a container is ready for pickup, see Container Holds, Fees, and Release Readiness.
Replace YOUR_API_KEY with your API key:
We suggest copying the response into a text editor so you can examine it while continuing the tutorial.

Anatomy of containers JSON response

Now that you’ve got a list of containers, let’s examine the response you’ve received. The example below is partial: it shows a single container object from the data array, with some fields omitted and inline comments calling out the key fields.

Next up: receive status updates

You can now list your tracked shipments and containers on demand. The final step is to register a webhook so Terminal49 pushes updates to you as they happen.

Receive status updates

Register a webhook endpoint and handle your first notification.