Skip to content

Instantly share code, notes, and snippets.

@dodeja
Last active January 23, 2021 22:44
Show Gist options
  • Save dodeja/403c8dd2d5e356bbcb2d3095de915d8a to your computer and use it in GitHub Desktop.
Save dodeja/403c8dd2d5e356bbcb2d3095de915d8a to your computer and use it in GitHub Desktop.
Terminal49 API Guide

Terminal49 API Guide

1. Create a tracking request Cosco Shipment (COSU6283148530) going to LA.

curl --location --request POST 'https://api.terminal49.com/v2/tracking_requests' \
--header 'Authorization: Bearer 7ZhLRrr5Kpu5T9ue5wMaGEco' \
--header 'Content-Type: application/json' \
--data-raw '{
    "data": {
        "type": "tracking_request",
        "attributes": {
            "request_type": "bill_of_lading",
            "request_number": "COSU6283148530",
            "scac": "COSU"
        }
    }
}'

2. Get Tracking Request details to get Shipment ID and Container ID

curl --location --request GET 'https://api.terminal49.com/v2/tracking_requests/c907ed11-26de-422b-8635-08280e771aed' \
--header 'Authorization: Bearer 7ZhLRrr5Kpu5T9ue5wMaGEco' \
--header 'Content-Type: application/json'

3. Get Container details for container CBHU9032042 (#2)

curl --location --request GET 'https://api.terminal49.com/v2/containers/6cc83974-e421-48ab-84f4-6c7875a9802d' \
--header 'Authorization: Bearer 7ZhLRrr5Kpu5T9ue5wMaGEco' \
--header 'Content-Type: application/json'
{
"data": {
"id": "c907ed11-26de-422b-8635-08280e771aed",
"type": "tracking_request",
"attributes": {
"request_number": "COSU6283148530",
"request_type": "bill_of_lading",
"scac": "COSU",
"ref_numbers": [],
"created_at": "2021-01-23T22:19:59Z",
"status": "pending",
"failed_reason": null,
"is_retrying": false,
"retry_count": null
},
"relationships": {
"tracked_object": {
"data": null
}
},
"links": {
"self": "/v2/tracking_requests/c907ed11-26de-422b-8635-08280e771aed"
}
}
}
{
"data": {
"id": "c907ed11-26de-422b-8635-08280e771aed",
"type": "tracking_request",
"attributes": {
"request_number": "COSU6283148530",
"request_type": "bill_of_lading",
"scac": "COSU",
"ref_numbers": [],
"created_at": "2021-01-23T22:19:59Z",
"status": "created",
"failed_reason": null,
"is_retrying": false,
"retry_count": null
},
"relationships": {
"tracked_object": {
"data": {
"id": "0a0c6ed5-bedf-474b-a135-cc9e9c5c3d18",
"type": "shipment"
}
}
},
"links": {
"self": "/v2/tracking_requests/c907ed11-26de-422b-8635-08280e771aed"
}
},
"links": {
"self": "https://api.terminal49.com/v2/tracking_requests/c907ed11-26de-422b-8635-08280e771aed"
},
"included": [
{
"id": "0a0c6ed5-bedf-474b-a135-cc9e9c5c3d18",
"type": "shipment",
"attributes": {
"created_at": "2021-01-23T22:19:59Z",
"ref_numbers": null,
"bill_of_lading_number": "COSU6283148530",
"shipping_line_scac": "COSU",
"shipping_line_name": "China Ocean Shipping Company",
"port_of_lading_locode": null,
"port_of_lading_name": "Zhapu",
"port_of_discharge_locode": "USLGB",
"port_of_discharge_name": "Long Beach",
"pod_vessel_name": "COSCO KAOHSIUNG",
"pod_vessel_imo": null,
"pod_voyage_number": "079E",
"destination_locode": null,
"destination_name": null,
"destination_timezone": null,
"destination_ata_at": null,
"destination_eta_at": null,
"pol_etd_at": null,
"pol_atd_at": "2020-11-28T05:00:00Z",
"pol_timezone": null,
"pod_eta_at": null,
"pod_ata_at": "2020-12-30T22:54:00Z",
"pod_timezone": "America/Los_Angeles"
},
"relationships": {
"port_of_lading": {
"data": null
},
"port_of_discharge": {
"data": {
"id": "ce1f3283-4396-4b3f-b26a-025983bd8167",
"type": "port"
}
},
"pod_terminal": {
"data": {
"id": "52a6e5ec-a3fa-4ee3-9a66-c0c07c13fb86",
"type": "terminal"
}
},
"destination": {
"data": null
},
"destination_terminal": {
"data": null
},
"containers": {
"data": [
{
"id": "8b33f250-1988-4c11-8812-838a9f28d490",
"type": "container"
},
{
"id": "6cc83974-e421-48ab-84f4-6c7875a9802d",
"type": "container"
},
{
"id": "800d024c-4e5b-4567-b592-110445130f3f",
"type": "container"
},
{
"id": "ed32fbce-98f5-4b57-8f4e-4316eac44002",
"type": "container"
}
]
}
},
"links": {
"self": "/v2/shipments/0a0c6ed5-bedf-474b-a135-cc9e9c5c3d18"
}
}
]
}
{
"data": {
"id": "6cc83974-e421-48ab-84f4-6c7875a9802d",
"type": "container",
"attributes": {
"number": "CBHU9032042",
"seal_number": "P679489",
"created_at": "2021-01-23T00:20:44Z",
"equipment_type": "dry",
"equipment_length": 40,
"equipment_height": "high_cube",
"weight_in_lbs": 21142,
"fees_at_pod_terminal": [],
"holds_at_pod_terminal": [
{
"name": "freight",
"status": null,
"description": "RELEASED"
}
],
"pickup_lfd": "2021-01-25T08:00:00Z",
"pickup_appointment_at": null,
"availability_known": true,
"available_for_pickup": true,
"pod_arrived_at": "2020-12-30T22:54:00Z",
"pod_discharged_at": "2021-01-11T13:00:00Z",
"final_destination_full_out_at": null,
"pod_full_out_at": null,
"empty_terminated_at": null
},
"relationships": {
"shipment": {
"data": {
"id": "0a0c6ed5-bedf-474b-a135-cc9e9c5c3d18",
"type": "shipment"
}
},
"pod_terminal": {
"data": {
"id": "52a6e5ec-a3fa-4ee3-9a66-c0c07c13fb86",
"type": "terminal"
}
},
"transport_events": {
"data": [
{
"id": "1059599e-d19d-4407-bf04-dd2d35ef30a2",
"type": "transport_event"
},
{
"id": "7603692b-912f-4d5d-b473-5139c7181f7c",
"type": "transport_event"
},
{
"id": "20cb8521-68ef-41c0-9239-8ac395a9a4e8",
"type": "transport_event"
},
{
"id": "1732840c-be1a-448b-ab3a-c52a3d025ec4",
"type": "transport_event"
},
{
"id": "ebe399a2-ba75-4cde-b7da-d43480fe9a86",
"type": "transport_event"
},
{
"id": "ed26c008-521d-442b-b73f-24ce36b35e4f",
"type": "transport_event"
}
]
}
}
},
"links": {
"self": "https://api.terminal49.com/v2/containers/6cc83974-e421-48ab-84f4-6c7875a9802d"
}
}
{
"data": {
"id": "c37c9cee-9111-4666-a462-8a6a3d4e4957",
"type": "container",
"attributes": {
"number": "KKTU7759373",
"seal_number": "CNC924735",
"created_at": "2021-01-23T22:41:40Z",
"equipment_type": "dry",
"equipment_length": 20,
"equipment_height": "standard",
"weight_in_lbs": 7114,
"fees_at_pod_terminal": null,
"holds_at_pod_terminal": null,
"pickup_lfd": null,
"pickup_appointment_at": null,
"availability_known": false,
"available_for_pickup": false,
"pod_arrived_at": null,
"pod_discharged_at": null,
"final_destination_full_out_at": null,
"pod_full_out_at": null,
"empty_terminated_at": null
},
"relationships": {
"shipment": {
"data": {
"id": "c5e206c7-ae8c-447f-9506-9d02365e0c98",
"type": "shipment"
}
},
"pod_terminal": {
"data": {
"id": "3137b8ce-51a8-46cf-918d-f579ee038d56",
"type": "terminal"
}
},
"transport_events": {
"data": [
{
"id": "0915b577-039a-41c8-ab5e-8cc17c4c26c4",
"type": "transport_event"
},
{
"id": "368103c4-da98-4a4f-9a7f-77329326ff96",
"type": "transport_event"
}
]
}
}
},
"links": {
"self": "https://api.terminal49.com/v2/containers/c37c9cee-9111-4666-a462-8a6a3d4e4957"
}
}
{
"data": {
"id": "50a993bb-955b-4175-b22a-e4021917ce89",
"type": "tracking_request",
"attributes": {
"request_number": "ONEYSH9FP2588600",
"request_type": "bill_of_lading",
"scac": "ONEY",
"ref_numbers": [],
"created_at": "2021-01-23T22:40:54Z",
"status": "created",
"failed_reason": null,
"is_retrying": false,
"retry_count": null
},
"relationships": {
"tracked_object": {
"data": {
"id": "c5e206c7-ae8c-447f-9506-9d02365e0c98",
"type": "shipment"
}
}
},
"links": {
"self": "/v2/tracking_requests/50a993bb-955b-4175-b22a-e4021917ce89"
}
},
"links": {
"self": "https://api.terminal49.com/v2/tracking_requests/50a993bb-955b-4175-b22a-e4021917ce89"
},
"included": [
{
"id": "c5e206c7-ae8c-447f-9506-9d02365e0c98",
"type": "shipment",
"attributes": {
"created_at": "2021-01-23T22:41:41Z",
"ref_numbers": null,
"bill_of_lading_number": "ONEYSH9FP2588600",
"shipping_line_scac": "ONEY",
"shipping_line_name": "Ocean Network Express",
"port_of_lading_locode": "CNSHA",
"port_of_lading_name": "Shanghai",
"port_of_discharge_locode": "USLAX",
"port_of_discharge_name": "Los Angeles",
"pod_vessel_name": "HYUNDAI GLOBAL",
"pod_vessel_imo": null,
"pod_voyage_number": "081E",
"destination_locode": null,
"destination_name": null,
"destination_timezone": null,
"destination_ata_at": null,
"destination_eta_at": "2021-02-06T04:00:00Z",
"pol_etd_at": null,
"pol_atd_at": "2021-01-16T18:30:00Z",
"pol_timezone": "Asia/Shanghai",
"pod_eta_at": "2021-02-01T21:00:00Z",
"pod_ata_at": null,
"pod_timezone": "America/Los_Angeles"
},
"relationships": {
"port_of_lading": {
"data": {
"id": "fa21bb72-975b-4dd4-a768-1109ff628dc5",
"type": "port"
}
},
"port_of_discharge": {
"data": {
"id": "47b27584-4ec9-4e2f-95e1-7a42928cc40c",
"type": "port"
}
},
"pod_terminal": {
"data": {
"id": "3137b8ce-51a8-46cf-918d-f579ee038d56",
"type": "terminal"
}
},
"destination": {
"data": null
},
"destination_terminal": {
"data": null
},
"containers": {
"data": [
{
"id": "c37c9cee-9111-4666-a462-8a6a3d4e4957",
"type": "container"
}
]
}
},
"links": {
"self": "/v2/shipments/c5e206c7-ae8c-447f-9506-9d02365e0c98"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment