Environments. Everything below works identically in test and production.
Point non-production traffic at the sandbox so you can integrate before your
shipments go live.
Environment Base URL Sandbox (test) https://api-test.freightlens.ioProduction https://api.freightlens.io
GET /v2/shipments, by carrier booking numbercarrierCode + carrierBookingReference), Bill of LadingbillOfLadingNumber), or container (equipmentReference).exceptions[] are inline in the payload.Real-time webhook push (FreightLens posting transmissions to your endpoint as
events occur) is on the roadmap, not part of this read-only v1.
client_id and client_secret for each environment. You exchange them for a{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "track-and-trace.read"
}expires_in (seconds). Cache the token and reuse it until shortly before itclient_secret in browser or mobile code; keep it server-side.transmissionHeader — metadata about this delivery: a unique ID, when ittriggerType), which event triggered ittriggeredByEvent), sender/receiver, and the schema version.shipmentTracking — the shipment itself: identifiers, route, schedule, and| Field | Description |
|---|---|
transmissionID | Unique ID for this transmission. Use it for idempotency and de-duplication. |
transmissionDateTime | UTC timestamp (ISO 8601) when FreightLens sent the transmission. |
triggerType | Why this transmission was sent — see the enum below. |
triggeredByEvent | The eventID that caused this transmission (null for manual/full snapshots). |
senderID | Always FREIGHTLENS. |
receiverID | Your client identifier. |
schemaVersion | Payload schema version. Current: 1.2. |
triggerType valuesMANUAL_TRIGGER (a full current snapshot). The remainingGET response in v1.| Value | Meaning |
|---|---|
MANUAL_TRIGGER | A full snapshot — what GET /v2/shipments returns. |
SCHEDULED_TRIGGER | A periodic refresh of the shipment state (webhook, roadmap). |
EVENT_TRIGGER | A new milestone arrived (webhook, roadmap). |
EXCEPTION_DETECTED | A new exception was raised (webhook, roadmap). |
EXCEPTION_RESOLVED | A previously raised exception cleared (webhook, roadmap). |
shipmentTracking always carries the identifiers you use to match the shipment to| Field | Description |
|---|---|
bookingReference | FreightLens / forwarder booking reference. |
carrierBookingReference | The carrier's booking number. |
billOfLadingNumber | Bill of Lading (B/L) number. |
carrierCode | Carrier SCAC (e.g. HLCU = Hapag-Lloyd). |
carrierName | Human-readable carrier name. |
serviceType | Scope of carriage (e.g. PORT_TO_DOOR, DOOR_TO_DOOR). |
etd / eta | Current estimated departure / arrival (UTC, ISO 8601). |
portOfLoading, portOfDischarge, placeOfReceipt, placeOfDelivery)locationName and a UN/LOCODE (unLocationCode), plus an optionalfacilityCode and its code-list provider (BIC, SMDG).shipmentEvents — document and booking milestones. Carry ashipmentEventTypeCode (e.g. CONF = booking confirmed, ISSU = B/L issued).transportEvents — vessel movements at a port call. Carry atransportEventTypeCode (DEPA = departure, ARRI = arrival) and atransportCall describing the vessel, location, and voyage.containers[] entry, as latestEvent andeventHistory[]) — container movements. Carry an equipmentEventTypeCodeGTOT = gate out, GTIN = gate in, LOAD = loaded, DISC = discharged) andemptyIndicatorCode (LADEN / EMPTY).eventClassifierCode that tells you how firm the| Code | Meaning |
|---|---|
ACT | Actual — the event has happened. |
EST | Estimated — a forward-looking prediction. |
PLN | Planned — from the carrier's schedule. |
Key point for consumers: when an event's eventClassifierCodechanges fromEST/PLNtoACT, the milestone has actually occurred. When anEST
timestamp moves, the schedule has shifted — which is what raises the schedule
exceptions in Section 6.
01_standard_event_v1.json.{
"transmissionHeader": {
"transmissionID": "TXN-1783526651038",
"transmissionDateTime": "2026-07-29T00:00:00Z",
"triggerType": "MANUAL_TRIGGER",
"triggeredByEvent": null,
"senderID": "FREIGHTLENS",
"receiverID": "CLIENT",
"schemaVersion": "1.2"
},
"shipmentTracking": {
"bookingReference": "29402735",
"carrierBookingReference": "95954888",
"billOfLadingNumber": "HLCUBSC2606CBSF8",
"carrierCode": "HLCU",
"carrierName": "Hapag-Lloyd",
"vesselName": "ULSAN EXPRESS",
"voyageNumber": "631W",
"portOfLoading": { "locationName": "NEW YORK, NY", "unLocationCode": "USNYC" },
"portOfDischarge": { "locationName": "VUNG TAU", "unLocationCode": "VNVUT" },
"placeOfDelivery": { "locationName": "CAN THO", "unLocationCode": "VNVCA" },
"serviceType": "PORT_TO_DOOR",
"etd": "2026-07-28T12:15:00Z",
"eta": "2026-10-01T01:00:00Z",
"shipmentEvents": [
{
"eventID": "9714eff8-9043-44f0-a6dc-14327f12e532",
"eventType": "SHIPMENT",
"eventDateTime": "2026-07-15T16:36:27Z",
"eventClassifierCode": "ACT",
"shipmentEventTypeCode": "CONF"
}
],
"transportEvents": [
{
"eventID": "a77e8aff-613a-4534-8233-025bd983412d",
"eventType": "TRANSPORT",
"eventDateTime": "2026-07-28T12:15:00Z",
"eventClassifierCode": "ACT",
"transportEventTypeCode": "DEPA",
"transportCall": {
"vessel": { "vesselName": "ULSAN EXPRESS", "vesselIMONumber": "9613020" },
"location": { "locationName": "NEW YORK, NY", "unLocationCode": "USNYC" },
"modeOfTransport": "VESSEL",
"exportVoyageNumber": "631W",
"transportCallSequenceNumber": 1
}
}
],
"containers": [
{
"containerNumber": "HAMU4486106",
"isoType": "45GP",
"latestEvent": {
"eventID": "9d68e872-5eed-4430-8f89-960d266164d0",
"eventType": "EQUIPMENT",
"eventDateTime": "2026-10-03T17:00:00Z",
"equipmentEventTypeCode": "GTOT",
"emptyIndicatorCode": "LADEN",
"eventClassifierCode": "PLN",
"equipmentReference": "HAMU4486106"
}
}
]
}
}CONF, ACT), the vessel hasDEPA, ACT), and the container's next planned move is a gateGTOT, PLN). The eta of 2026-10-01T01:00:00Z is theexceptions[] array carries it withstatus: DETECTED. You see it inline the next time you GET the shipment. (TheSCHEDULE — timing problems such as ETA delays and missed connectionsOPERATIONAL — action-required problems such as rollovers, demurrage, orseverity (WARNING / CRITICAL), a statusDETECTED / RESOLVED), the affectedContainers, an impact block showingrecommendedAction.eta is updated and a SCHEDULE / ETA_DELAY exception is raised.02_exception_detected_v1.json.{
"transmissionHeader": {
"transmissionID": "TXN-1783794512661",
"transmissionDateTime": "2026-09-14T08:42:00Z",
"triggerType": "EXCEPTION_DETECTED",
"triggeredByEvent": "5d06372d-1f66-48f9-882c-45802b9a9225",
"senderID": "FREIGHTLENS",
"receiverID": "CLIENT",
"schemaVersion": "1.2"
},
"shipmentTracking": {
"bookingReference": "29402735",
"carrierBookingReference": "95954888",
"billOfLadingNumber": "HLCUBSC2606CBSF8",
"carrierCode": "HLCU",
"carrierName": "Hapag-Lloyd",
"eta": "2026-10-08T09:00:00Z",
"exceptions": [
{
"exceptionID": "3f2a91c4-6b0e-4a77-9d21-8c4e0f5a71bd",
"exceptionType": "ETA_DELAY",
"exceptionCategory": "SCHEDULE",
"severity": "WARNING",
"status": "DETECTED",
"detectedDateTime": "2026-09-14T08:42:00Z",
"title": "Arrival at Vung Tau delayed by 7 days",
"description": "Carrier schedule update for ULSAN EXPRESS voyage 631W pushed the estimated arrival at Vung Tau (VNVUT) from 2026-10-01T01:00:00Z to 2026-10-08T09:00:00Z.",
"relatedEventID": "5d06372d-1f66-48f9-882c-45802b9a9225",
"affectedContainers": ["HAMU4486106"],
"impact": {
"field": "eta",
"previousValue": "2026-10-01T01:00:00Z",
"revisedValue": "2026-10-08T09:00:00Z",
"delayHours": 176
},
"recommendedAction": "Notify the consignee of the revised arrival window and review any downstream delivery or free-time commitments at Can Tho (VNVCA)."
}
]
}
}| Field | Description |
|---|---|
exceptionID | Stable ID for the exception. The matching EXCEPTION_RESOLVED reuses this same ID. |
exceptionType | Specific issue — e.g. ETA_DELAY, ROLLOVER, DEMURRAGE_RISK, DETENTION_RISK, MISSED_CONNECTION. |
exceptionCategory | SCHEDULE (amber) or OPERATIONAL (red). |
severity | WARNING or CRITICAL. |
status | DETECTED or RESOLVED. |
detectedDateTime | When FreightLens first raised the exception. |
relatedEventID | The event that triggered the exception. |
affectedContainers | Container numbers impacted. |
impact | What changed: field, previousValue, revisedValue, and (for delays) delayHours. |
recommendedAction | Suggested next step. |
Idempotency tip: key your handling on exceptionID. If the delay worsens,
the nextGETreturns an updatedDETECTEDexception with the sameexceptionID— update your record rather than creating a duplicate.
status: RESOLVED, carrying the same exceptionID plus a resolvedDateTime,resolutionType, and a resolutionNote. Here the carrier recovered most of theeta moves back in and the exception closes. Full file:03_exception_resolved_v1.json.{
"transmissionHeader": {
"transmissionID": "TXN-1783969347902",
"transmissionDateTime": "2026-09-22T15:10:00Z",
"triggerType": "EXCEPTION_RESOLVED",
"triggeredByEvent": "5d06372d-1f66-48f9-882c-45802b9a9225",
"senderID": "FREIGHTLENS",
"receiverID": "CLIENT",
"schemaVersion": "1.2"
},
"shipmentTracking": {
"bookingReference": "29402735",
"carrierBookingReference": "95954888",
"billOfLadingNumber": "HLCUBSC2606CBSF8",
"carrierCode": "HLCU",
"carrierName": "Hapag-Lloyd",
"eta": "2026-10-02T14:00:00Z",
"exceptions": [
{
"exceptionID": "3f2a91c4-6b0e-4a77-9d21-8c4e0f5a71bd",
"exceptionType": "ETA_DELAY",
"exceptionCategory": "SCHEDULE",
"severity": "WARNING",
"status": "RESOLVED",
"detectedDateTime": "2026-09-14T08:42:00Z",
"resolvedDateTime": "2026-09-22T15:10:00Z",
"resolutionType": "SCHEDULE_RECOVERED",
"resolutionNote": "Carrier re-optimized the rotation for ULSAN EXPRESS voyage 631W. Estimated arrival at Vung Tau (VNVUT) recovered from 2026-10-08T09:00:00Z to 2026-10-02T14:00:00Z, reducing the delay against the original plan to 37 hours.",
"relatedEventID": "5d06372d-1f66-48f9-882c-45802b9a9225",
"affectedContainers": ["HAMU4486106"],
"impact": {
"field": "eta",
"previousValue": "2026-10-08T09:00:00Z",
"revisedValue": "2026-10-02T14:00:00Z",
"delayHours": 37
}
}
]
}
}| Field | Description |
|---|---|
resolvedDateTime | When the exception cleared. |
resolutionType | How it cleared — e.g. SCHEDULE_RECOVERED, REBOOKED, MANUAL_CLEAR, EVENT_ACTUALIZED. |
resolutionNote | Human-readable explanation. |
The impacton a resolved exception shows the movement from the exception
state to the recovered state, so you can display "delay reduced from 176h to
37h" without recomputing it.
GET /v2/shipments again on a cadence that suits the shipment's stage. AexceptionID so a re-reported exception updates the sameeventClassifierCode flipping toACT to know a milestone actually happened.Real-time webhook push — FreightLens POSTing each change to a callback URL of
yours, signed with anX-FreightLens-Signature(HMAC-SHA256) header — is on the
roadmap. Until then, polling is the supported model.
| Task | Call |
|---|---|
| Get an access token | POST /oauth/token |
| Look up a shipment by carrier booking | GET /v2/shipments?carrierCode=…&carrierBookingReference=… |
| Look up a shipment by B/L | GET /v2/shipments?billOfLadingNumber=… |
| Look up a shipment by container | GET /v2/shipments?equipmentReference=… |
https://api-test.freightlens.io · Production:https://api.freightlens.io.