{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api.trackingmore.com/v4/schemas/air-waybill",
  "title": "AirWaybill",
  "description": "An air cargo shipment tracked via Master Air Waybill (MAWB) number",
  "type": "object",
  "properties": {
    "awb_number": {
      "type": "string",
      "description": "Master Air Waybill number in format XXX-XXXXXXXX",
      "pattern": "^\\d{3}[ -]?(\\d{8})$",
      "example": "020-12345678"
    },
    "airline": {
      "type": "string",
      "description": "Name of the airline carrying the cargo"
    },
    "origin": {
      "type": "string",
      "description": "Origin airport IATA code",
      "example": "LAX"
    },
    "destination": {
      "type": "string",
      "description": "Destination airport IATA code",
      "example": "LHR"
    },
    "status": {
      "type": "string",
      "description": "Current shipment status"
    },
    "events": {
      "type": "array",
      "description": "List of tracking events for this air waybill",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time of this event"
          },
          "location": {
            "type": "string",
            "description": "Location of the event"
          },
          "description": {
            "type": "string",
            "description": "Human-readable description of the event"
          }
        }
      }
    }
  },
  "required": ["awb_number"]
}
