{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unvtd.unece.org/air-waybill-schema.json",
  "title": "Air Waybill",
  "description": "A non-negotiable transport document issued by or on behalf of an air carrier acknowledging receipt of goods for carriage and evidencing the contract of air carriage between the carrier and the shipper.",
  "type": "object",
  "required": [
    "@context",
    "type",
    "issuer",
    "credentialSubject",
    "credentialSchema"
  ],
  "properties": {
    "@context": {
      "type": "array",
      "description": "JSON-LD contexts: the W3C Verifiable Credentials v2 context, followed by this document's context.",
      "const": [
        "https://www.w3.org/ns/credentials/v2",
        "https://unvtd.unece.org/air-waybill-context.jsonld"
      ]
    },
    "type": {
      "type": "array",
      "description": "Credential types.",
      "const": [
        "VerifiableCredential",
        "AirWaybillCredential"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable name of the credential, for display.",
      "example": "Air Waybill"
    },
    "credentialSchema": {
      "type": "object",
      "description": "Reference to the credential schema for validation",
      "properties": {
        "id": {
          "type": "string",
          "format": "uri",
          "const": "https://unvtd.unece.org/air-waybill-schema.json",
          "description": "Public location of the schema"
        },
        "type": {
          "type": "string",
          "const": "JsonSchema",
          "description": "Schema type identifier"
        }
      },
      "required": [
        "id",
        "type"
      ]
    },
    "id": {
      "type": "string",
      "format": "uri",
      "description": "Unique identifier for the credential",
      "example": "urn:uuid:aw-2025-081-12345678"
    },
    "validFrom": {
      "example": "2025-03-15T00:00:00.000Z",
      "type": "string",
      "format": "date-time",
      "description": "Credential validity start date"
    },
    "validUntil": {
      "example": "2026-03-15T00:00:00.000Z",
      "type": "string",
      "format": "date-time",
      "description": "Date until which this credential is valid."
    },
    "issuer": {
      "description": "Identifier of the air carrier issuing the air waybill (e.g., DID)",
      "type": "string",
      "format": "uri",
      "example": "did:web:qantasfreight.example.com"
    },
    "credentialSubject": {
      "name": "AirWaybill",
      "description": "Air waybill details",
      "type": "object",
      "required": [
        "type",
        "airWaybillNumber",
        "houseWaybillDocumentIdentifier",
        "estimatedTimeOfDeparture",
        "estimatedTimeOfArrival",
        "carrier",
        "consignor",
        "consignee",
        "originalLoadingLocation",
        "placeOfDeparture",
        "arrivalLocation",
        "transportContractConditions",
        "grossWeight",
        "volume",
        "descriptionOfGoods",
        "consignmentSummaryDescription",
        "numberOfPackages",
        "hsCode",
        "conveyanceReferenceNumber",
        "freightForwarder",
        "transportEquipmentOperator"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the business document.",
          "const": "AirWaybill"
        },
        "airWaybillNumber": {
          "example": "081-12345678",
          "type": "string",
          "description": "Reference number of the master air waybill issued by the carrier."
        },
        "houseWaybillDocumentIdentifier": {
          "example": "GFS-HAWB-2025-001",
          "type": "string",
          "description": "Reference number of the house air waybill issued by the freight forwarder."
        },
        "estimatedTimeOfDeparture": {
          "example": "2025-03-15T23:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date and time when the aircraft is scheduled to depart."
        },
        "estimatedTimeOfArrival": {
          "example": "2025-03-16T18:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date and time of the estimated arrival of the aircraft at destination."
        },
        "consignor": {
          "description": "Party consigning goods as stipulated in the air transport contract.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:surfproexports.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "SurfPro Exports Pty Ltd",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "streetAddress": {
                  "example": "12 Harbour Drive",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "Sydney",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "NSW",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "2000",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "consignee": {
          "description": "Party to which the air cargo is consigned.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:waveridersupplies.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Wave Rider Supplies, Inc",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "streetAddress": {
                  "example": "210 Ocean Road",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "Williamsburg",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "VA",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "23185",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "carrier": {
          "description": "Air carrier providing the transport of goods.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:qantasfreight.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Qantas Freight",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "freightForwarder": {
          "description": "Party arranging the transport of goods on behalf of the consignor.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:globalfreightsolutions.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Global Freight Solutions Pty Ltd",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "transportEquipmentOperator": {
          "description": "Party operating the transport equipment (e.g., ULD operator at the airport).",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:sydneyairportground.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Sydney Airport Ground Services",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "notifyParty": {
          "description": "Party to be notified of the cargo's arrival.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:waveridersupplies.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Wave Rider Supplies, Inc",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "originalLoadingLocation": {
          "description": "Airport at which the cargo is first loaded onto an aircraft.",
          "type": "object",
          "properties": {
            "name": {
              "example": "Sydney Airport",
              "type": "string",
              "description": "Location name."
            },
            "addressLocality": {
              "example": "Sydney",
              "type": "string",
              "description": "City."
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country."
            },
            "unLocode": {
              "example": "https://service.unece.org/trade/locode/au.htm#AUSYD",
              "type": "string",
              "format": "uri",
              "description": "UN/LOCODE identifier."
            }
          }
        },
        "placeOfDeparture": {
          "description": "Airport from which the aircraft departs.",
          "type": "object",
          "properties": {
            "name": {
              "example": "Sydney Airport",
              "type": "string",
              "description": "Location name."
            },
            "iataCode": {
              "example": "SYD",
              "type": "string",
              "description": "IATA airport code."
            },
            "addressLocality": {
              "example": "Sydney",
              "type": "string",
              "description": "City."
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country."
            }
          }
        },
        "arrivalLocation": {
          "description": "Airport at which the aircraft arrives at destination.",
          "type": "object",
          "properties": {
            "name": {
              "example": "Los Angeles International Airport",
              "type": "string",
              "description": "Location name."
            },
            "iataCode": {
              "example": "LAX",
              "type": "string",
              "description": "IATA airport code."
            },
            "addressLocality": {
              "example": "Los Angeles",
              "type": "string",
              "description": "City."
            },
            "addressCountry": {
              "example": "US",
              "type": "string",
              "description": "Country."
            }
          }
        },
        "conveyanceReferenceNumber": {
          "example": "QF 107",
          "type": "string",
          "description": "Flight number or other journey identifier for the means of transport."
        },
        "transportContractConditions": {
          "example": "Subject to IATA Standard Conditions of Contract",
          "type": "string",
          "description": "Reference to the carrier's conditions of carriage."
        },
        "loadingInstructions": {
          "example": "Handle with care — fragile sporting equipment",
          "type": "string",
          "description": "Instructions for the loading of the goods."
        },
        "grossWeight": {
          "description": "Total gross weight of the consignment including packaging.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Quantity",
              "enum": [
                "Quantity"
              ]
            },
            "amount": {
              "example": 520,
              "type": "number",
              "format": "float",
              "description": "Weight amount."
            },
            "unit": {
              "example": "KGS",
              "type": "string",
              "description": "Weight unit."
            }
          }
        },
        "volume": {
          "description": "Total volume of the consignment.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Quantity",
              "enum": [
                "Quantity"
              ]
            },
            "amount": {
              "example": 8.5,
              "type": "number",
              "format": "float",
              "description": "Volume amount."
            },
            "unit": {
              "example": "CBM",
              "type": "string",
              "description": "Volume unit."
            }
          }
        },
        "numberOfPackages": {
          "example": 18,
          "type": "number",
          "description": "Number of packages in the consignment."
        },
        "descriptionOfGoods": {
          "example": "Surfboards, fins and wetsuits for water sports retail",
          "type": "string",
          "description": "Plain language description of the nature of the goods."
        },
        "consignmentSummaryDescription": {
          "example": "Sports equipment - surfing products",
          "type": "string",
          "description": "Plain language description of the consignment in summary terms."
        },
        "hsCode": {
          "example": "950630",
          "type": "string",
          "description": "Harmonized System code specifying the type of goods for customs purposes."
        },
        "freightAndChargesAmount": {
          "description": "Total freight and ancillary charges for the air carriage.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "MonetaryAmount",
              "enum": [
                "MonetaryAmount"
              ]
            },
            "amount": {
              "example": 3200,
              "type": "number",
              "format": "float",
              "description": "Monetary amount."
            },
            "currency": {
              "example": "USD",
              "type": "string",
              "minLength": 3,
              "maxLength": 3,
              "description": "ISO 4217 three-letter currency code."
            }
          }
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
