{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trackingmcp-com/json-schema/trackingmcp-com-container-lookup-schema.json",
  "title": "ContainerLookup",
  "description": "The payload. Everything an endpoint returns sits under this key.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trackingmcp-com-openapi.json#/components/schemas/ContainerLookup",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Stable identifier for the record. On the tracking endpoints this is the container UUID, except on a portfolio summary row, where it is the container number."
    },
    "container_number": {
      "type": "string",
      "description": "The container number, or null when the record was tracked by a bill of lading or booking that has not yet resolved to a box."
    },
    "bl_number": {
      "type": [
        "string",
        "null"
      ],
      "description": "The bill of lading, or null when the record was not tracked by one."
    },
    "identifier": {
      "type": "string",
      "description": "The container number, bill of lading or booking this record tracks."
    },
    "identifier_type": {
      "type": "string",
      "description": "What the identifier is. The keyed surface uses container_id, bill_of_lading or booking; the public tracker returns booking_number for the third."
    },
    "booking_number": {
      "type": [
        "string",
        "null"
      ],
      "description": "The booking reference, or null when the record was not tracked by one."
    },
    "container_size": {
      "type": "string",
      "description": "Equipment size, for example 40HC. Null when the carrier did not state it."
    },
    "equipment_type": {
      "type": "string",
      "description": "Equipment family as the carrier names it. Null when unstated."
    },
    "iso_type_code": {
      "type": "string",
      "description": "The type half of the ISO 6346 code (G1 for a general-purpose box, R1 for a reefer). Null when unstated."
    },
    "child_containers": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "Container number of the box, or TBA for a group of boxes the line has not numbered yet."
          },
          "iso_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO equipment type code of the box, for example 45G1."
          },
          "size_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "The line's own size and type label for the box."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "The box's own status, which can differ from the status of the document.",
            "enum": [
              "pre_departure",
              "in_transit",
              "at_transshipment",
              "arriving",
              "at_anchor",
              "at_berth",
              "discharged",
              "customs_hold",
              "available",
              "delivered",
              "returned_empty",
              null
            ]
          },
          "status_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where the box status came from: its own tracked row, the line's events for that box, or the document status.",
            "enum": [
              "tracked",
              "line",
              "document",
              null
            ]
          },
          "events": {
            "type": "array",
            "description": "The box's own timeline; an empty array when no per-box timeline is known yet.",
            "items": {
              "type": "object",
              "description": "One move on this box, in the shape the line reported it.",
              "properties": {
                "event_code": {
                  "type": "string",
                  "description": "Milestone code of the move, for example GTIN, LOAD, DEPA, ARRI, DISC or GTOT."
                },
                "event_name": {
                  "type": "string",
                  "description": "Readable name of the move, the same wording the dashboard shows."
                },
                "event_family": {
                  "type": "string",
                  "description": "Family the move belongs to.",
                  "enum": [
                    "EQUIPMENT",
                    "TRANSPORT",
                    "SHIPMENT"
                  ]
                },
                "transport_mode": {
                  "type": "string",
                  "description": "Conveyance the line stated for the move.",
                  "enum": [
                    "VESSEL",
                    "RAIL",
                    "TRUCK",
                    "BARGE"
                  ]
                },
                "is_actual": {
                  "type": "boolean",
                  "description": "True when the move has happened, false when it is planned or estimated."
                },
                "implied_actual": {
                  "type": "boolean",
                  "description": "True when a planned move is served as done because a later actual move proves it happened.",
                  "enum": [
                    true
                  ]
                },
                "provenance": {
                  "type": "object",
                  "description": "Present only on a port call of the ship, made while the box was aboard, that AIS saw the vessel make: the move is actual and its time is the AIS one. Absent = the line's word.",
                  "properties": {
                    "basis": {
                      "type": "string",
                      "enum": [
                        "enrichment"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "ais"
                      ]
                    }
                  }
                },
                "datetime": {
                  "type": "string",
                  "description": "When the move happened or is planned, as a UTC instant when the port time zone is known."
                },
                "datetime_local": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The same moment on the port wall clock, without an offset."
                },
                "timezone": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "IANA time zone of the port, for example Asia/Shanghai."
                },
                "utc_offset_minutes": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Minutes to add to UTC to get the port wall clock."
                },
                "time_semantics": {
                  "type": "string",
                  "description": "How the timestamp was obtained, so a client knows whether it is a true instant.",
                  "enum": [
                    "carrier_offset",
                    "tz_resolved",
                    "date_only",
                    "local_unplaced",
                    "legacy_unknown"
                  ]
                },
                "unlocode": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "UN/LOCODE of the place of the move."
                },
                "location_code_source": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Where the served UN/LOCODE came from.",
                  "enum": [
                    "carrier",
                    "matched_in_country",
                    "matched_port_name",
                    "corrected",
                    "not_determined",
                    "recorded",
                    null
                  ]
                },
                "port_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Place name as the line wrote it."
                },
                "facility": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Terminal, depot or other facility name as the line wrote it."
                },
                "vessel_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Name of the ship for this move."
                },
                "vessel_imo": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "IMO number of the ship for this move, as a string."
                },
                "voyage_number": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Voyage number the line stated for this move."
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The line's own wording for the move."
                },
                "carrier_status_text": {
                  "type": "string",
                  "description": "The line's own status remark for the move."
                },
                "empty_indicator": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Whether the box was empty or laden at this move.",
                  "enum": [
                    "EMPTY",
                    "LADEN",
                    null
                  ]
                },
                "empty_indicator_source": {
                  "type": "string",
                  "description": "Who stated the fill state: the line, or nobody.",
                  "enum": [
                    "carrier",
                    "not_reported"
                  ]
                },
                "gate_out_role": {
                  "type": "string",
                  "description": "What a gate-out did: moved the box on, or handed it to the consignee.",
                  "enum": [
                    "transfer",
                    "consignee_delivery",
                    "not_reported"
                  ]
                },
                "gate_out_role_source": {
                  "type": "string",
                  "description": "Who decided gate_out_role: the line, our reading of the box's own order, or nobody.",
                  "enum": [
                    "line",
                    "sequence",
                    "not_reported"
                  ]
                }
              }
            }
          }
        }
      },
      "description": "The boxes a bill of lading or booking resolves to, each with its own timeline and its own `status` (with `status_source`: `tracked` when your organisation also tracks the box on its own line, `line` when read from the events the line filed for that box on this document, `document` when the document holds no per-box events and none of its events names another box, so the box shows the document's own status, which can be a stage read from the vessel's AIS, such as at_berth or at_anchor; both null when none has reported one). Null on a plain container lookup."
    },
    "status": {
      "type": "string",
      "description": "Current normalised status of the shipment. Ocean lifecycle order: discharged, available, delivered, returned_empty. Two values end a shipment, delivered and returned_empty, and returned_empty outranks delivered."
    },
    "carrier": {
      "type": "string",
      "description": "Carrier name, falling back to the SCAC when we hold no name."
    },
    "vessel_name": {
      "type": "string",
      "description": "Name of the carrying vessel, or null when the carrier named none."
    },
    "vessel_imo": {
      "type": "string",
      "description": "IMO number of the carrying vessel, or null when unknown."
    },
    "planned_vessel": {
      "$ref": "#/$defs/PlannedVessel",
      "description": "The ship the box is waiting for: before its first actual load while its planned load at the port of loading is still ahead or at most 3 days past, or at a transshipment hub before the reload. An object with name, imo, voyage, position (lat, lng, updated_at; that vessel's own latest AIS fix, null when older than 48 hours or when the planned load date passed more than 3 days ago with no actual load), heading_to (unlocode, name of the port it loads the box at), planned_load_at and status 'planned'. Never the box's position, which stays at the port. Null while the box is aboard, after its final discharge, or when the line names no planned vessel."
    },
    "vessel_position": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "Latitude."
        },
        "lng": {
          "type": "number",
          "description": "Longitude."
        }
      },
      "description": "Live AIS position of the carrying vessel. Null when we hold no IMO or no fix yet."
    },
    "origin_name": {
      "type": "string",
      "description": "Origin port name, falling back to its UN/LOCODE."
    },
    "destination_name": {
      "type": "string",
      "description": "Destination port name, falling back to its UN/LOCODE."
    },
    "eta": {
      "type": "string",
      "description": "Arrival time (ISO 8601) of the vessel (the ARRI event) at the port in destination_unlocode: planned until it arrives, actual after (see eta_is_estimated). It is not the discharge (DISC) and not the moment the cargo is ready for pickup. When a line files no arrival event, its discharge at that port stands in. Null when the carrier publishes none and we cannot predict one. When the line gave only a date, this reads 00:00 UTC on that date, which is padding, and some real ETAs also fall exactly on 00:00 UTC. On the detail answer (GET /v1/containers/{id}, and the refresh that returns it), `eta_local` tells them apart (a bare `YYYY-MM-DD` for a date, a time for a real ETA): take the day from it rather than converting this instant (west of UTC a padded date shows the day before). GET /v1/containers/lookup/{identifier} serves no `eta_local`."
    },
    "eta_confidence_pct": {
      "type": "integer",
      "description": "How often this lane arrives on time, as a percentage. Null on a lane too thin to score."
    },
    "last_updated_at": {
      "type": "string",
      "description": "The more recent of the carrier check and the AIS fix: when we last learned anything about this shipment."
    },
    "last_updated_source": {
      "type": "string",
      "description": "Which of the two produced last_updated_at: carrier_poll or ais_vessel_position. Null when neither has happened yet."
    },
    "last_polled_at": {
      "type": "string",
      "description": "When we last asked the carrier (ISO 8601)."
    },
    "last_ais_fix_at": {
      "type": "string",
      "description": "When the vessel was last actually observed by AIS, or null when we hold no fix."
    },
    "field_provenance": {
      "type": "object",
      "description": "Per-field account of WHY a declared field is empty, keyed by field name. This is the difference between \"the carrier does not publish it\", \"your contract terms would unlock it\" and \"it does not apply to this shipment\". Keys are data, not contract: they vary by shipment.",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "description": "Why the field stands where it does: resolved, contract_required, not_published, not_applicable or awaiting_carrier."
          },
          "action": {
            "type": "string",
            "description": "What would change the state: supply_terms, wait, or do_not_expect when nothing will."
          },
          "source": {
            "type": "string",
            "description": "Where the answer on this call came from: direct_carrier or warm_db."
          },
          "confidence": {
            "type": "string",
            "description": "On a card, whether the slot partners agree with each other. On a prediction, how much to trust the shifted arrival."
          },
          "evidence": {
            "type": "string",
            "description": "The reasoning behind the state, in one sentence, so a support answer does not need our source."
          }
        }
      }
    },
    "demurrage_free_days_left": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Days of free time left, or null when no terms are on file."
    },
    "ai_narrative": {
      "type": [
        "string",
        "null"
      ],
      "description": "Reserved for a written summary of the shipment. Currently always null."
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Event code, for example DEPA or LOAD."
          },
          "classifier": {
            "type": "string",
            "description": "DCSA classifier: ACT for actual, EST for estimated, PLN for planned."
          },
          "is_actual": {
            "type": "boolean",
            "description": "True when the event happened. False means planned or estimated."
          },
          "label": {
            "type": "string",
            "description": "The event in plain words. A non-actual event is tagged \"(planned)\"."
          },
          "timestamp": {
            "type": "string",
            "description": "Event timestamp (ISO 8601)."
          },
          "event_local_datetime": {
            "type": "string",
            "description": "The port wall-clock for the same moment, naive and with no offset, exactly as a terminal prints it. Null when we could not place the port, and a null here means we do not know, never assume UTC."
          },
          "utc_offset_minutes": {
            "type": "integer",
            "description": "Minutes to add to the UTC instant to reach the local wall-clock. Null with the local time."
          },
          "event_timezone": {
            "type": "string",
            "description": "IANA zone of the port, which survives a DST change in a way a bare offset cannot. Null when the port could not be resolved."
          },
          "date_only": {
            "type": "boolean",
            "description": "True when the carrier published a calendar date with no time of day. The time is then padding, not an observed time: read the day from `event_date`, never from the instant. On GET /v1/containers/{id} it is 00:00 on the port's own clock with `utc_offset_minutes` set (east of UTC the instant falls on the evening before), or 00:00 UTC when we cannot place the port, and an arrival or discharge can be served later that day, no earlier than the same ship's call at another port on that day. On GET /v1/containers/lookup/{identifier} it is 00:00 UTC with `utc_offset_minutes` null, `event_local_datetime` repeats those UTC digits and `event_timezone` only names the port: do not convert it to another zone (west of UTC it shows the day before)."
          },
          "event_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "The calendar date, YYYY-MM-DD, when `date_only` is true. Null for events that carry a real time of day."
          },
          "location": {
            "type": "string",
            "description": "UN/LOCODE for the event, or null when the carrier gave no place."
          },
          "empty_indicator": {
            "type": [
              "string",
              "null"
            ],
            "description": "EMPTY or LADEN, on equipment events. Null when the carrier did not report the fill state: the standard has no unknown value and we do not invent one, and this is not an end-of-shipment signal."
          },
          "empty_indicator_source": {
            "type": "string",
            "description": "Who stated the fill state of an equipment event: carrier when the line reported EMPTY or LADEN, not_reported when it did not. Absent on vessel and document events, which have no fill state. We never fill the gap ourselves, so not_reported means the line did not say."
          },
          "gate_out_role": {
            "type": "string",
            "description": "What a gate-out did: transfer when the line says the box moved on (to another terminal, a rail ramp or a train), consignee_delivery when the line says the consignee took the box or when the box's own order shows it (see gate_out_role_source), not_reported otherwise. Only a consignee_delivery the line states or an unstated gate-out at the destination can mark the box delivered; the order reading never changes the status. Present on gate-out (GTOT) events only."
          },
          "equipment_reference": {
            "type": "string",
            "description": "The container the event happened to."
          },
          "gate_out_role_source": {
            "type": "string",
            "description": "Who decided gate_out_role: the line, our reading of the box's own order, or nobody.",
            "enum": [
              "line",
              "sequence",
              "not_reported"
            ]
          },
          "vessel_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the ship for this move."
          },
          "vessel_imo": {
            "type": [
              "string",
              "null"
            ],
            "description": "IMO number of the ship for this move, as a string."
          },
          "voyage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Voyage number the line stated for this move."
          },
          "line_date_suspect": {
            "type": "boolean",
            "description": "True on a past plan the line left behind a later actual move.",
            "enum": [
              true
            ]
          },
          "provenance": {
            "type": "object",
            "description": "Present only on a port call of the ship, made while the box was aboard, that AIS saw the vessel make: the move is actual and its time is the AIS one. Absent = the line's word.",
            "properties": {
              "basis": {
                "type": "string",
                "enum": [
                  "enrichment"
                ]
              },
              "source": {
                "type": "string",
                "enum": [
                  "ais"
                ]
              }
            }
          },
          "has_facility": {
            "type": "boolean",
            "description": "True when the line named a terminal, hub or depot for this arrival."
          }
        },
        "description": "Milestone timeline, oldest to newest."
      },
      "description": "Milestone timeline, oldest to newest."
    },
    "carrier_document_reply": {
      "$ref": "#/$defs/CarrierDocumentReply",
      "description": "Latest retained, exact-reference OOCL document reply. Separate from shipment event history; does not imply a fresh carrier check."
    },
    "carrier_notice": {
      "$ref": "#/$defs/CarrierNotice",
      "description": "Latest reference-specific reply from the named carrier. SHIPMENT_CANCELLED is an explicit matched Maersk cancellation, independent of retained movement history. no_longer_available is Swire stating it no longer serves tracking details for this shipment, or Hapag-Lloyd refusing a number it answered before (the record keeps the line's last data; refused_since and data_as_of date the two). ZIM notices clear after useful tracking, the Hapag-Lloyd one when the line answers the number again."
    },
    "status_partial": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "True when the boxes of a multi-box document are at different stages; null when it cannot be worked out."
    },
    "discharge_partial": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "True when some but not all boxes of a multi-box document have been discharged; null when it cannot be worked out."
    },
    "predictive_eta": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Our own arrival forecast when it differs from the ETA served in eta; null when we have none, when it equals eta, or once the arrival is a fact."
    },
    "ais_pol_departure": {
      "$ref": "#/$defs/AisPolDeparture",
      "description": "AIS saw the vessel carrying the box leave its port of loading while the line has not reported a departure there: the box's last actual load at that port names the vessel, nothing has discharged it there since, and the vessel's call at that port spans the load. An object with observed_at (the vessel's departure from the port), port_unlocode, port_name, timezone, vessel_imo, vessel_name, source 'ais' and note. An observation of the vessel, never the line's departure and never one of its events; null once the line reports the departure itself, and null otherwise."
    },
    "ais_pod_arrival": {
      "$ref": "#/$defs/AisPodArrival",
      "description": "Our AIS observation of the carrying vessel arriving at the port of discharge, when the line has not filed the arrival yet. Null otherwise."
    },
    "eta_is_estimated": {
      "type": "boolean",
      "description": "True when the ETA is still a forecast, false when it is the actual arrival, null when there is no ETA at all. Never read a date alone as a promise."
    },
    "pol_departure": {
      "$ref": "#/$defs/PolDeparture",
      "description": "When the box left `pol_unlocode`: the line's actual departure there, else the vessel seen leaving by AIS, else the line's planned departure (`actual: false`). Null when none is known; a load alone is not a departure. A line's move carries the same date and clock as its entry in `events`."
    },
    "pod_unlocode": {
      "type": [
        "string",
        "null"
      ],
      "description": "UN/LOCODE of the port of discharge: where the box comes off its last ship on this trip. The same port the compatibility surface returns as route.pod. A port the line shows as a transshipment hub is never served here; the box then goes on to the port of discharge the line states, else its destination when that is a port. Differs from destination_unlocode on a door move, where the destination is inland. Null when no port of discharge is known."
    },
    "pod_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Name of the port of discharge as the line states it. Null with pod_unlocode, unless the line named the place without a code."
    },
    "pod_basis": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "line",
        "computed",
        "enrichment",
        null
      ],
      "description": "Who named the port's role, as route.pod.basis.location on the compatibility surface. `line`: the line's own route or steps say the box ended its sea leg there (its stated port of discharge, a step there naming that role, an import step, or a move inland or an empty return after the discharge). `computed`: only our rule picked the port. Null with pod_unlocode."
    }
  },
  "$defs": {
    "AisPodArrival": {
      "type": [
        "object",
        "null"
      ],
      "description": "Our AIS observation of the carrying vessel arriving at the port of discharge, when the line has not filed the arrival yet. Null otherwise.",
      "properties": {
        "observed_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the vessel was first seen at the port on its final stay there."
        },
        "port_unlocode": {
          "type": "string",
          "description": "UN/LOCODE of the port of discharge."
        },
        "port_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the port."
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ],
          "description": "IANA zone of the port, for printing observed_at on the port clock."
        },
        "vessel_imo": {
          "type": "integer",
          "description": "IMO number of the vessel."
        },
        "vessel_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the vessel."
        },
        "distance_km": {
          "type": "number",
          "description": "How far from the port the qualifying position lay."
        },
        "source": {
          "type": "string",
          "enum": [
            "ais"
          ],
          "description": "Always ais: our observation of the vessel, never an event the line filed."
        },
        "note": {
          "type": "string",
          "description": "One sentence you can show as-is."
        }
      }
    },
    "AisPolDeparture": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "observed_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the ship left the port of loading, by our AIS port call record."
        },
        "port_unlocode": {
          "type": "string",
          "description": "UN/LOCODE of the port of loading."
        },
        "port_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the port of loading."
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ],
          "description": "IANA time zone of the port of loading."
        },
        "vessel_imo": {
          "type": "integer",
          "description": "IMO number of the ship."
        },
        "vessel_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the ship."
        },
        "source": {
          "type": "string",
          "description": "Always ais.",
          "enum": [
            "ais"
          ]
        },
        "note": {
          "type": "string",
          "description": "A sentence you can show as-is."
        }
      },
      "description": "AIS saw the vessel carrying the box leave its port of loading while the line has not reported a departure there: the box's last actual load at that port names the vessel, nothing has discharged it there since, and the vessel's call at that port spans the load. An object with observed_at (the vessel's departure from the port), port_unlocode, port_name, timezone, vessel_imo, vessel_name, source 'ais' and note. An observation of the vessel, never the line's departure and never one of its events; null once the line reports the departure itself, and null otherwise."
    },
    "CarrierDocumentReply": {
      "type": [
        "object",
        "null"
      ],
      "description": "Latest retained, exact-reference OOCL document reply. Separate from shipment event history; does not imply a fresh carrier check.",
      "properties": {
        "carrier_code": {
          "type": "string",
          "enum": [
            "OOLU"
          ]
        },
        "reference": {
          "type": "string"
        },
        "reference_type": {
          "type": "string",
          "enum": [
            "bl",
            "booking"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "cancelled",
            "declined"
          ]
        },
        "carrier_reference": {
          "type": "string"
        }
      }
    },
    "CarrierNotice": {
      "type": [
        "object",
        "null"
      ],
      "description": "Latest reference-specific reply from the named carrier. SHIPMENT_CANCELLED is an explicit matched Maersk cancellation, independent of retained movement history. no_longer_available is Swire stating it no longer serves tracking details for this shipment, or Hapag-Lloyd refusing a number it answered before (the record keeps the line's last data; refused_since and data_as_of date the two). ZIM notices clear after useful tracking, the Hapag-Lloyd one when the line answers the number again.",
      "properties": {
        "carrier_code": {
          "type": "string",
          "enum": [
            "ZIMU",
            "MAEU",
            "CHVW",
            "HLCU"
          ]
        },
        "reference": {
          "type": "string"
        },
        "reference_type": {
          "type": "string",
          "enum": [
            "container",
            "bl",
            "booking"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "other_carrier",
            "temporarily_unavailable",
            "not_found",
            "invalid_reference",
            "SHIPMENT_CANCELLED",
            "no_longer_available"
          ]
        },
        "message": {
          "type": "string"
        },
        "checked_at": {
          "type": "string",
          "format": "date-time"
        },
        "suggested_carrier": {
          "type": [
            "string",
            "null"
          ]
        },
        "suggested_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "refused_since": {
          "type": "string",
          "format": "date-time",
          "description": "Hapag-Lloyd only: when the line first refused the number after its last answer."
        },
        "data_as_of": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Hapag-Lloyd only: the line's last answer about this number, null when none is on record."
        }
      }
    },
    "PlannedVessel": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the planned ship."
        },
        "imo": {
          "type": [
            "string",
            "null"
          ],
          "description": "IMO number of the planned ship, as a string."
        },
        "voyage": {
          "type": [
            "string",
            "null"
          ],
          "description": "Voyage number of the planned sailing."
        },
        "position": {
          "type": [
            "object",
            "null"
          ],
          "description": "Latest AIS position of the planned ship; null when the fix is older than 48 hours, the plan has lapsed, or the ship has already left the load port.",
          "properties": {
            "lat": {
              "type": "number",
              "description": "Latitude of the ship."
            },
            "lng": {
              "type": "number",
              "description": "Longitude of the ship."
            },
            "updated_at": {
              "type": "string",
              "format": "date-time",
              "description": "When the ship was observed at this position."
            }
          }
        },
        "heading_to": {
          "type": "object",
          "description": "The port where the box is planned to load.",
          "properties": {
            "unlocode": {
              "type": [
                "string",
                "null"
              ],
              "description": "UN/LOCODE of the planned load port."
            },
            "name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Name of the planned load port."
            }
          }
        },
        "planned_load_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the box is planned to load onto this ship."
        },
        "status": {
          "type": "string",
          "description": "Always planned.",
          "enum": [
            "planned"
          ]
        }
      },
      "description": "The ship the box is waiting for: before its first actual load while its planned load at the port of loading is still ahead or at most 3 days past, or at a transshipment hub before the reload. An object with name, imo, voyage, position (lat, lng, updated_at; that vessel's own latest AIS fix, null when older than 48 hours or when the planned load date passed more than 3 days ago with no actual load), heading_to (unlocode, name of the port it loads the box at), planned_load_at and status 'planned'. Never the box's position, which stays at the port. Null while the box is aboard, after its final discharge, or when the line names no planned vessel."
    },
    "PolDeparture": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "date": {
          "type": "string",
          "description": "ISO 8601. Carries an offset when the port's zone is known; otherwise the port's wall clock without one, as in `events`."
        },
        "date_local": {
          "type": [
            "string",
            "null"
          ],
          "description": "The port's wall clock. Null when unknown."
        },
        "utc_offset_minutes": {
          "type": [
            "integer",
            "null"
          ]
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ],
          "description": "IANA zone of the port. Null when unresolved."
        },
        "date_only": {
          "type": "boolean",
          "description": "True when the line gave a day only; its time of day means nothing."
        },
        "actual": {
          "type": "boolean",
          "description": "False for a departure the line has only planned."
        },
        "port_unlocode": {
          "type": "string"
        },
        "provenance": {
          "type": "object",
          "description": "`basis: line` for a departure the line filed; `basis: computed` for one the line planned that we serve as done because the box moved on after it; `basis: enrichment, source: ais` for the vessel seen leaving by AIS.",
          "properties": {
            "basis": {
              "type": "string",
              "enum": [
                "line",
                "computed",
                "enrichment"
              ]
            },
            "source": {
              "type": "string",
              "enum": [
                "ais"
              ]
            }
          }
        }
      },
      "description": "When the box left `pol_unlocode`: the line's actual departure there, else the vessel seen leaving by AIS, else the line's planned departure (`actual: false`). Null when none is known; a load alone is not a departure. A line's move carries the same date and clock as its entry in `events`."
    }
  }
}