How does the Object table and JSON output of Flexport shipments API function?
In this article, I will clarify the object table and JSON output specifically of Flexport shipments API. As a programmer, you are likely already familiar with object tables and JSON, but understanding the nuances of how they are implemented in the Flexport shipments API can be crucial for efficiently utilizing the data it provides. I will focus solely on the object table and JSON aspects of the API, discussing the structure and format of the data, as well as any specific considerations or peculiarities that programmers should be aware of when working with this API. By the end of this article, you should have a clear understanding of how to work with the object table and JSON output of Flexport shipments API.
Object and description table
Objects | Description |
booking | |
_object | |
ref_type | |
link | |
id | |
transportation_mode | |
freight_type | |
incoterm | |
calculated_weight | |
calculated_volume | |
pieces | |
it_number | |
created_date | |
status | |
priority | |
updated_at | |
estimated_departure_date | |
actual_departure_date | |
estimated_arrival_date | |
actual_arrival_date | |
etc | etc |
booking
: A booking object contains information about a specific booking for the shipment._object
: This object refers to the type of object for which the API request is made.ref_type
: This object contains information about the type of reference provided.link
: A link object contains a URL that points to a related resource.id
: This object contains a unique identifier for the shipment.transportation_mode
: This object contains information about the mode of transportation used for the shipment.freight_type
: This object contains information about the type of freight being shipped.incoterm
: This object contains information about the International Commercial Terms (INCOTERMS) used for the shipment.calculated_weight
: This object contains information about the calculated weight of the shipment.calculated_volume
: This object contains information about the calculated volume of the shipment.pieces
: This object contains information about the number of pieces in the shipment.it_number
: This object contains information about the In-Transit number assigned to the shipment.created_date
: This object contains the date and time when the shipment was created.status
: This object contains information about the current status of the shipment.priority
: This object contains information about the priority level of the shipment.updated_at
: This object contains the date and time when the shipment was last updated.estimated_departure_date
: This object contains the estimated date and time of departure for the shipment.actual_departure_date
: This object contains the actual date and time of departure for the shipment.estimated_arrival_date
: This object contains the estimated date and time of arrival for the shipment.actual_arrival_date
: This object contains the actual date and time of arrival for the shipment.etc
: This object is a placeholder for any additional objects or information that may be available for the shipment.
The information in the table is useful for a variety of reasons, particularly for stakeholders involved in logistics and shipping operations. With detailed information about a shipment's weight, volume, mode of transportation, type of freight, and other key details, stakeholders can make informed decisions about how to optimize logistics operations, such as selecting the most cost-effective mode of transportation, determining appropriate shipping rates, and planning for contingencies such as delays or changes in arrival times. Additionally, having access to accurate and up-to-date information about shipment status, departure and arrival dates, and other key metrics can help stakeholders track shipments more effectively, allowing for greater transparency and accountability throughout the shipping process. Ultimately, the detailed information provided in the table can help streamline logistics operations, reduce costs, and improve overall efficiency in shipping and logistics.
Json output
The given JSON output represents a paginated collection of shipments fetched from the Flexport API. The output includes a link to the current page of results, along with the version of the API used. The data
field contains an array of shipment objects, each of which contains detailed information about a specific shipment, such as the shipment's name, booking details, transportation mode, freight type, incoterm, weight, volume, pieces, status, priority, and various dates related to the shipment's journey, among other information. The shipment objects also include information about related entities such as shippers, consignees, buyers, sellers, importers of record, items, legs, customs entries, commercial invoices, and documents associated with the shipment. The JSON output is useful for developers working with the Flexport API to retrieve and process shipment data for various purposes, such as generating reports, tracking shipments, and analyzing shipping operations.
{
"_object": "/api/response",
"self": "https://api.flexport.com/shipments?page=1&per=20&sort=id&direction=desc",
"version": 2,
"data": {
"_object": "/api/collections/paginated",
"prev": null,
"next": null,
"data": [
{
"metadata": {},
"_object": "/shipments",
"id": 2983,
"name": "ABC Shipment",
"booking": {
"_object": "api/refs/object",
"ref_type": "/booking",
"link": "https://api.flexport.com/bookings/12345",
"id": 12345
},
"transportation_mode": "ocean",
"freight_type": "door_to_door",
"incoterm": "FOB",
"calculated_weight": {
"_object": "/quantity/weight",
"value": 2300.4,
"unit": "kg"
},
"calculated_volume": {
"_object": "/quantity/volume",
"value": 472.62,
"unit": "cbm"
},
"pieces": 8372,
"it_number": "V12345678",
"created_date": "2019-02-06T19:28:25.741Z",
"status": "in_transit_to_arrival_port",
"priority": "high",
"updated_at": "2019-02-06T19:28:25.119Z",
"estimated_departure_date": "2019-02-06T19:28:25+00:00",
"actual_departure_date": "2019-02-06T19:28:25+00:00",
"estimated_arrival_date": "2019-02-06T19:28:25+00:00",
"actual_arrival_date": "2019-02-06T19:28:25+00:00",
"estimated_picked_up_in_full_date": "2019-02-06T19:28:25+00:00",
"actual_picked_up_in_full_date": "2019-02-06T19:28:25+00:00",
"estimated_delivered_in_full_date": "2019-02-06T19:28:25+00:00",
"actual_delivered_in_full_date": "2019-02-06T19:28:25+00:00",
"cargo_ready_date": "2019-02-06",
"wants_export_customs_service": true,
"wants_import_customs_service": true,
"air_shipment": null,
"wants_freight_management_bco": true,
"wants_flexport_freight": true,
"wants_commercial_invoice_transcription": true,
"wants_flexport_insurance": true,
"wants_pickup_service": false,
"wants_trade_declaration_service": false,
"visibility_only": false,
"wants_delivery_service": false,
"belongs_to_a_buyers_consol": false,
"child_shipments": null,
"parent_shipment": null,
"ocean_shipment": {
"_object": "/ocean/shipment",
"is_lcl": false,
"house_bill_number": "TUWSANR18658",
"master_bill_number": "NEWO697216024",
"carrier_booking_number": "697216024",
"confirmed_space_released_at": "2021-06-08T06:18:46.299Z",
"containers": {
"_object": "/api/refs/collection",
"ref_type": "/ocean/shipment_container",
"link": "https://api.flexport.com/ocean/shipment_containers?f.shipment.id=123"
}
},
"dangerous_goods": {
"review_status": "complete",
"classifications": []
},
"shippers": [
{
"_object": "/company_entity",
"id": 9281,
"name": "Zoomit",
"mailing_address": {
"_object": "/address",
"street_address": "1641 Settlers Lane",
"street_address2": "STE 2918",
"city": "Albany",
"state": "MN",
"country": "United States of America",
"country_code": "US",
"zip": "56307",
"unlocode": "US AL2",
"timezone": "America/Chicago",
"ref": "address_ref_1"
},
"ref": "zoomit_ref",
"vat_numbers": [
{
"_object": "company_entity/vat_number",
"country_code": "US",
"number": "US 123746396"
}
]
}
],
"consignees": [
{
"_object": "/company_entity",
"id": 9281,
"name": "Zoomit",
"mailing_address": {
"_object": "/address",
"street_address": "1641 Settlers Lane",
"street_address2": "STE 2918",
"city": "Albany",
"state": "MN",
"country": "United States of America",
"country_code": "US",
"zip": "56307",
"unlocode": "US AL2",
"timezone": "America/Chicago",
"ref": "address_ref_1"
},
"ref": "zoomit_ref",
"vat_numbers": [
{
"_object": "company_entity/vat_number",
"country_code": "US",
"number": "US 123746396"
}
]
}
],
"buyers": [
{
"_object": "/company_entity",
"id": 9281,
"name": "Zoomit",
"mailing_address": {
"_object": "/address",
"street_address": "1641 Settlers Lane",
"street_address2": "STE 2918",
"city": "Albany",
"state": "MN",
"country": "United States of America",
"country_code": "US",
"zip": "56307",
"unlocode": "US AL2",
"timezone": "America/Chicago",
"ref": "address_ref_1"
},
"ref": "zoomit_ref",
"vat_numbers": [
{
"_object": "company_entity/vat_number",
"country_code": "US",
"number": "US 123746396"
}
]
}
],
"sellers": [
{
"_object": "/company_entity",
"id": 9281,
"name": "Zoomit",
"mailing_address": {
"_object": "/address",
"street_address": "1641 Settlers Lane",
"street_address2": "STE 2918",
"city": "Albany",
"state": "MN",
"country": "United States of America",
"country_code": "US",
"zip": "56307",
"unlocode": "US AL2",
"timezone": "America/Chicago",
"ref": "address_ref_1"
},
"ref": "zoomit_ref",
"vat_numbers": [
{
"_object": "company_entity/vat_number",
"country_code": "US",
"number": "US 123746396"
}
]
}
],
"importers_of_record": [
{
"_object": "/company_entity",
"id": 9281,
"name": "Zoomit",
"mailing_address": {
"_object": "/address",
"street_address": "1641 Settlers Lane",
"street_address2": "STE 2918",
"city": "Albany",
"state": "MN",
"country": "United States of America",
"country_code": "US",
"zip": "56307",
"unlocode": "US AL2",
"timezone": "America/Chicago",
"ref": "address_ref_1"
},
"ref": "zoomit_ref",
"vat_numbers": [
{
"_object": "company_entity/vat_number",
"country_code": "US",
"number": "US 123746396"
}
]
}
],
"items": [
{
"_object": "/shipment_item",
"id": 29820,
"total_units": 523,
"total_weight": {
"_object": "/quantity/weight",
"value": 2300.4,
"unit": "kg"
},
"total_volume": {
"_object": "/quantity/volume",
"value": 472.62,
"unit": "cbm"
},
"purchase_order_number": "PO002811",
"product": {
"_object": "/product",
"id": 84291,
"name": "AC Adapter 12V",
"sku": "WDVCDFD-RM00472"
}
}
],
"legs": {
"_object": "/api/refs/collection",
"ref_type": "/shipment_leg",
"link": "https://api.flexport.com/shipment_legs?f.shipment.id=123"
},
"customs_entries": {
"_object": "/api/refs/collection",
"ref_type": "/customs_entry",
"link": "https://api.flexport.com/customs_entries?f.shipment.id=2983"
},
"commercial_invoices": {
"_object": "/api/refs/collection",
"ref_type": "/commercial_invoice",
"link": "https://api.flexport.com/commercial_invoices?f.shipment.id=2983"
},
"documents": {
"_object": "/api/refs/collection",
"ref_type": "/document",
"link": "https://api.flexport.com/documents?f.shipment.id=2983"
},
"departure_date": "2019-02-06T19:28:25+00:00",
"arrival_date": "2019-02-06T19:28:25+00:00",
"picked_up_in_full_date": "2019-02-06T19:28:25+00:00",
"delivered_in_full_date": "2019-02-06T19:28:25+00:00"
}
]
}
}
Ending words
In this article, we discussed the object table and JSON output of Flexport shipments API. The object table provided a list of objects and their descriptions, while the JSON output provided a detailed structure of a shipment object with its various attributes and nested objects. We also discussed the usefulness of this information for developers and users of the API. Overall, this conversation highlights the importance of understanding data structures and their attributes when working with APIs to efficiently access and utilize the desired data.
Endnote
If you are interested in accessing the Flexport shipments API, it is possible to request access through the third-party data marketplace of Worldindata. Worldindata provides access to a variety of data sources, including APIs from companies like Flexport. To request access, you can visit the Worldindata website and search for the Flexport shipments API. Once you find the API, you can follow the instructions to request access. Keep in mind that there may be certain requirements or fees associated with accessing the API through this marketplace, so be sure to review the details carefully before making a request.