TimeToCargo

Qubictron

Migrate from Qubictron to TimeToCargo API v2: authentication, requests and response handling

This guide covers migration from Qubictron Container Tracking API v1 to TimeToCargo API v2. Qubictron requests route data through the route_details parameter of /ocean.

See the migration workflow for importing references and setting up notifications. Full TimeToCargo schemas are in the API reference.

Authentication

Qubictron uses the x-api-key header. The Qubictron base URL is https://api.qubictron.com/tracking/v1.

To switch to TimeToCargo:

  1. Create a key in your TimeToCargo account.
  2. Change the base URL to https://tracking.timetocargo.com/v2. For example, the full tracking endpoint is https://tracking.timetocargo.com/v2/tracking.
  3. Send the new key in the api_key query parameter of every request, including batch tasks and webhook management. Keys and tokens from the former provider cannot be reused.

See authentication for key usage and request limits.

Tracking records and identifiers

QubictronTimeToCargoRequired change
shipmentdataRead shipment summary data from data.summary and containers from data.containers instead of the shipment object.
facilities / locationsterminals / locationsResolve event locations and terminals using location and terminal in the new response arrays. Source numeric IDs are not retained.
transportscontainers[].events[].vessel / voyageRead the vessel name and voyage from each event's vessel and voyage. There is no separate transports array.

Operation mapping

QubictronTimeToCargoRequired change
GET /oceanGET /v2/trackingPass the reference as value, its type as type, and the carrier SCAC as company. Use POST /v2/tracking/batch for several references.
GET /ocean/carriersGET /v2/companiesMatch the carrier by SCAC and check support for your reference type in cn, bl and bk.

Request parameters

QubictronTimeToCargoRequired change
reference_numbervalueCopy reference_number into the value query parameter without changing the reference.
reference_typetypeUse container for a container, bl for a bill of lading, and bk instead of booking for a booking. The type is required.
carrier_codecompanyVerify carrier_code through GET /v2/companies and pass the matching SCAC in company.
route_detailsneed_routeReplace route_details=true with need_route=true. Update response handling to use the route_info structure.

Response fields

Paths in this table start at the root of a GET /v2/tracking response. In /v2/shipments, shipment data is nested inside each record at tracked_item.data.data. See the webhook guide for notification formats.

QubictronTimeToCargoResponse handling
success / status_codesuccess / statusCheck JSON success and status even when HTTP status is 200. Update error handling for the new status values.
data.shipment.reference_numberrequest.track_number.valueRead the requested reference from request.track_number.value. Save the separate data.tracking_metadata.id for tracking management.
data.shipment.carrierdata.summary.companyReplace carrier.code handling with the company.scacs array. Read the name from company.name or company.full_name.
data.shipment.statusdata.shipment_statusRead shipment progress from data.shipment_status and update the set of values your application handles.
events[].datetime / is_actualevents[].date / actualIn container events, replace datetime with date and is_actual with actual. Keep actual and planned dates distinct.
events[].event_codeevents[].status_codeCheck the loading stage: origin-port LOAD corresponds to CLL, while transshipment loading corresponds to CLT. Do not use one replacement for every LOAD.
events[].location_id / facility_idevents[].location / terminalMatch location to an id in data.locations and terminal to one in data.terminals. Do not reuse Qubictron numeric IDs.
data.routedata.summaryRead the loading port from data.summary.pol and the discharge port from data.summary.pod. Route geometry is separate in data.route_info.
data.containers[].route_detailsdata.route_infoRead the path from route_info.route[].path and the current point from route_info.current_position. Qubictron-specific AIS fields may be absent.

Response examples

Each pair labels the former-provider and TimeToCargo responses. Expand the longer JSON examples when you need them; the mapping tables remain visible. These are shortened examples with illustrative data. The path above each JSON block identifies the part shown. Paths in the following table start from that part.

Reference, carrier and equipment type

How to map

QubictronTimeToCargoRequired change
data.shipment.reference_type = "CONTAINER"request.track_number.type = "container"Use lowercase container in requests. Do not copy the source response value CONTAINER into type.
data.shipment.reference_number = "MSCU1234567"request.track_number.value = "MSCU1234567"The reference is unchanged. Read it from request.track_number.value.
data.shipment.carrier.code = "MSCU"data.summary.company.scacs = ["MEDU","MSCU"]Check whether scacs contains MSCU instead of comparing the field with one string.
data.shipment.status = "IN_TRANSIT"data.shipment_status = "IN_TRANSIT"Read IN_TRANSIT from shipment_status. Check the subscription separately in tracking_metadata.status.
data.containers[0].type = "High Cube Dry"data.containers[0].type = "40' High Cube Dry"Size and type are combined in the containers[].type string. Update how your application displays them.
data.containers[0].iso_code = "45G1"No direct equivalentThere is no separate iso_code. Retain the source code locally if equipment classification depends on it.

Actual and planned events

How to map

QubictronTimeToCargoRequired change
containers[0].events[0].event_code = "LOAD"containers[0].events[1].status_code = "CLL"This example shows loading at the origin port, so use CLL. Transshipment loading uses CLT.
containers[0].events[1].event_code = "ARRI"containers[0].events[0].status_code = "VAD"Vessel arrival at the discharge port is VAD. It does not itself confirm container discharge or delivery.
containers[0].events[1].is_actual = falsecontainers[0].events[0].actual = falsefalse keeps the date marked as planned. Do not display this event as already completed.
containers[0].events[0].location_id = 10containers[0].events[1].location = 0The event location has ID 0 in the new locations array. Look it up by this ID, not the former 10.
containers[0].events[0].transport_id = 5containers[0].events[1].vessel = "EXAMPLE VESSEL"The vessel name is now stored on the event. Remove the lookup by transport_id in transports.
containers[0].events[0].voyage_number = "126E"containers[0].events[1].voyage = "126E"Read the voyage from event.voyage. The example value remains 126E.

Dates illustrate field formats. Preserve source offset and timezone meaning: deleting Z or +08:00 is not a timezone conversion.

Geometry and current position

How to map

QubictronTimeToCargoRequired change
predicted_position.coordinatescurrent_position = [1.25,103.75]Read the current position as a [latitude, longitude] array rather than an object with coordinate properties.
route_legs[0].route_pathroute[0].pathIterate over route_info.route[] and each segment's path instead of route_legs[].route_path.
route_legs[0].transport_mode = "VESSEL"route[0].type = "sea"For a sea segment, use type: "sea" instead of transport_mode: "VESSEL".
latest_ais_dataNo direct equivalentDo not substitute the route position for the last AIS measurement. Retain the measurement and its timestamp separately if needed.

Data to retain separately

Some Qubictron AIS fields and predictions may be absent from the TimeToCargo response. Check which fields your application uses and retain required data before switching. Qubictron webhook support is not described in the available public documentation. If you already receive these notifications, check your account settings and configure TimeToCargo webhooks separately using the webhook guide.

Last updated on