{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/terminal49/json-schema/terminal49-container-schema.json",
  "title": "Container model",
  "description": "Represents the equipment during a specific journey.",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/terminal49-openapi.json#/components/schemas/container",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "type": {
      "type": "string",
      "enum": [
        "account"
      ]
    },
    "attributes": {
      "type": "object",
      "properties": {
        "number": {
          "type": "string"
        },
        "ref_numbers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "equipment_type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "dry",
            "reefer",
            "open top",
            "flat rack",
            "bulk",
            "tank",
            null
          ]
        },
        "equipment_length": {
          "type": [
            "integer",
            "null"
          ],
          "enum": [
            null,
            10,
            20,
            40,
            45
          ]
        },
        "equipment_height": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "standard",
            "high_cube",
            null
          ]
        },
        "weight_in_lbs": {
          "type": [
            "number",
            "null"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "seal_number": {
          "type": [
            "string",
            "null"
          ]
        },
        "pickup_lfd": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Coalesces `import_deadlines` values giving preference to `pickup_lfd_line`"
        },
        "pickup_appointment_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When available the pickup appointment time at the terminal is returned."
        },
        "availability_known": {
          "type": "boolean",
          "description": "Whether Terminal 49 is receiving availability status from the terminal."
        },
        "available_for_pickup": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "If availability_known is true, then whether container is available to be picked up at terminal."
        },
        "pod_arrived_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Time the vessel arrived at the POD"
        },
        "pod_discharged_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Discharge time at the port of discharge"
        },
        "pod_full_out_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Full Out time at port of discharge. Null for inland moves."
        },
        "terminal_checked_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the terminal was last checked."
        },
        "pod_full_out_chassis_number": {
          "type": [
            "string",
            "null"
          ],
          "description": "The chassis number used when container was picked up at POD (if available)"
        },
        "location_at_pod_terminal": {
          "type": [
            "string",
            "null"
          ],
          "description": "Location at port of discharge terminal"
        },
        "final_destination_full_out_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Pickup time at final destination for inland moves."
        },
        "empty_terminated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Time empty container was returned."
        },
        "holds_at_pod_terminal": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/terminal_hold"
          }
        },
        "fees_at_pod_terminal": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/terminal_fee"
          }
        },
        "pod_timezone": {
          "type": [
            "string",
            "null"
          ],
          "description": "IANA tz. Applies to attributes pod_arrived_at, pod_discharged_at, pickup_appointment_at, pod_full_out_at."
        },
        "final_destination_timezone": {
          "type": [
            "string",
            "null"
          ],
          "description": "IANA tz. Applies to attribute final_destination_full_out_at."
        },
        "empty_terminated_timezone": {
          "type": [
            "string",
            "null"
          ],
          "description": "IANA tz. Applies to attribute empty_terminated_at."
        },
        "pod_rail_carrier_scac": {
          "type": [
            "string",
            "null"
          ],
          "description": "The SCAC of the rail carrier for the pickup leg of the container's journey.(BETA)"
        },
        "ind_rail_carrier_scac": {
          "type": [
            "string",
            "null"
          ],
          "description": "The SCAC of the rail carrier for the delivery leg of the container's journey.(BETA)"
        },
        "pod_last_tracking_request_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "shipment_last_tracking_request_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "pod_rail_loaded_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "pod_rail_departed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "ind_eta_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Estimated Time of Arrival at the inland destination, as reported by the rail carrier. For the shipping-line view at the shipment's destination, see `destination_eta_at` on the shipment. Corresponding timezone is `final_destination_timezone`."
        },
        "ind_ata_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Actual Time of Arrival at the inland destination, as reported by the rail carrier. For the shipping-line view at the shipment's destination, see `destination_ata_at` on the shipment. Corresponding timezone is `final_destination_timezone`."
        },
        "ind_rail_unloaded_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Time when the container is unloaded from rail at the inland destination."
        },
        "ind_facility_lfd_on": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Please use `import_deadlines.pickup_lfd_rail`",
          "deprecated": true
        },
        "import_deadlines": {
          "type": [
            "object",
            "null"
          ],
          "description": "Import pickup deadlines for the container",
          "properties": {
            "pickup_lfd_terminal": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "The last free day for pickup before demmurage accrues. Corresponding timezone is pod_timezone."
            },
            "pickup_lfd_rail": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "The last free day for pickup at the inland destination, as reported by the rail carrier. Corresponding timezone is final_destination_timezone. Subscribe to `container.pickup_lfd_rail.changed` to be notified of updates."
            },
            "pickup_lfd_line": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "The last free day as reported by the shipping line (carrier dependent). Corresponding timezone is final_destination_timezone or pod_timezone. Preferred source for the coalesced top-level `pickup_lfd` field."
            }
          }
        },
        "current_status": {
          "type": "string",
          "description": "The current status of the container in its journey. [Read guide to learn more.](/api-docs/in-depth-guides/container-statuses)",
          "enum": [
            "new",
            "on_ship",
            "available",
            "not_available",
            "grounded",
            "on_rail",
            "picked_up",
            "off_dock",
            "delivered",
            "dropped",
            "loaded",
            "empty_returned",
            "awaiting_inland_transfer"
          ]
        }
      }
    },
    "relationships": {
      "type": "object",
      "properties": {
        "shipment": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "shipment"
                  ]
                }
              }
            }
          }
        },
        "pickup_facility": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "terminal"
                  ]
                }
              }
            }
          }
        },
        "pod_terminal": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "terminal"
                  ]
                }
              }
            }
          }
        },
        "transport_events": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "transport_event"
                    ]
                  }
                }
              }
            }
          }
        },
        "raw_events": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "raw_event"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "required": [
    "id",
    "type",
    "attributes"
  ],
  "$defs": {
    "terminal_fee": {
      "title": "terminal_fee",
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "demurrage",
            "exam",
            "extended_dwell_time",
            "other",
            "total"
          ]
        },
        "amount": {
          "type": "number",
          "description": "The fee amount in local currency"
        },
        "currency_code": {
          "type": "string",
          "description": "The ISO 4217 currency code of the fee is charged in. E.g. USD"
        }
      },
      "required": [
        "type",
        "amount"
      ]
    },
    "terminal_hold": {
      "title": "terminal_hold",
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "hold"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Text description from the terminal (if any)"
        }
      },
      "required": [
        "name",
        "status"
      ]
    }
  }
}