{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unvtd.unece.org/dangerous-goods-declaration-schema.json",
  "title": "Dangerous Goods Declaration",
  "description": "A document completed by the consignor declaring that dangerous goods in a consignment are properly described, classified, packaged, marked and labelled in accordance with the applicable dangerous goods regulations.",
  "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/dangerous-goods-declaration-context.jsonld"
      ]
    },
    "type": {
      "type": "array",
      "description": "Credential types.",
      "const": [
        "VerifiableCredential",
        "DangerousGoodsDeclarationCredential"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable name of the credential, for display.",
      "example": "Dangerous Goods Declaration"
    },
    "credentialSchema": {
      "type": "object",
      "description": "Reference to the credential schema for validation",
      "properties": {
        "id": {
          "type": "string",
          "format": "uri",
          "const": "https://unvtd.unece.org/dangerous-goods-declaration-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:dgd-2025-au-001234"
    },
    "validFrom": {
      "example": "2025-03-11T00:00:00.000Z",
      "type": "string",
      "format": "date-time",
      "description": "Credential validity start date"
    },
    "validUntil": {
      "example": "2026-03-11T00:00:00.000Z",
      "type": "string",
      "format": "date-time",
      "description": "Date until which this credential is valid."
    },
    "issuer": {
      "description": "Identifier of the consignor issuing the dangerous goods declaration (e.g., DID)",
      "type": "string",
      "format": "uri",
      "example": "did:web:surfpro-electric.example.com"
    },
    "credentialSubject": {
      "name": "DangerousGoodsDeclaration",
      "description": "Dangerous goods declaration details",
      "type": "object",
      "required": [
        "type",
        "consignor",
        "consignee"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the business document.",
          "const": "DangerousGoodsDeclaration"
        },
        "documentIdentifier": {
          "example": "DGD-2025-AU-001234",
          "type": "string",
          "description": "Reference number identifying this dangerous goods declaration."
        },
        "dangerousGoodsDeclarationIdentifier": {
          "example": "IATA-DGD-2025-AU-001234",
          "type": "string",
          "description": "Identifier assigned to the dangerous goods declaration by the issuing authority or regulation."
        },
        "houseWaybillDocumentIdentifier": {
          "example": "GFS-HAWB-2025-001",
          "type": "string",
          "description": "Reference number of the associated house waybill."
        },
        "transportDocumentNumber": {
          "example": "POSL-2025-001234",
          "type": "string",
          "description": "Reference number of the associated transport document (e.g., bill of lading or air waybill)."
        },
        "ucr": {
          "example": "AU2025SURF001234",
          "type": "string",
          "description": "Unique Consignment Reference for the dangerous goods consignment."
        },
        "goodsItemSequenceIdentifier": {
          "example": "1",
          "type": "string",
          "description": "Sequence number identifying which goods item in the consignment this declaration relates to."
        },
        "issueDate": {
          "example": "2025-03-11T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date this dangerous goods declaration was issued."
        },
        "consignor": {
          "description": "Party consigning the dangerous goods (the shipper/declarant).",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:surfpro-electric.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "SurfPro Electric 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": "150 Industrial Drive",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "Gold Coast",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "QLD",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "4217",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "consignee": {
          "description": "Party to whom the dangerous goods consignment is addressed.",
          "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."
                }
              }
            }
          }
        },
        "deliveryLocation": {
          "description": "Location to which the dangerous goods consignment is to be delivered.",
          "type": "object",
          "properties": {
            "name": {
              "example": "Wave Rider Supplies Warehouse",
              "type": "string",
              "description": "Location name."
            },
            "addressLocality": {
              "example": "Williamsburg",
              "type": "string",
              "description": "City."
            },
            "addressRegion": {
              "example": "VA",
              "type": "string",
              "description": "State."
            },
            "addressCountry": {
              "example": "US",
              "type": "string",
              "description": "Country."
            }
          }
        },
        "placeOfTakingOver": {
          "description": "Place where the carrier takes over the dangerous goods from the consignor.",
          "type": "object",
          "properties": {
            "addressLocality": {
              "example": "Gold Coast",
              "type": "string",
              "description": "City."
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country."
            }
          }
        },
        "placeOfIssue": {
          "description": "Location where this dangerous goods declaration was issued.",
          "type": "object",
          "properties": {
            "addressLocality": {
              "example": "Gold Coast",
              "type": "string",
              "description": "City."
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country."
            }
          }
        },
        "emergencyContact": {
          "description": "Emergency contact for dangerous goods incidents during transport.",
          "type": "object",
          "properties": {
            "name": {
              "example": "SurfPro Electric Emergency Response",
              "type": "string",
              "description": "Emergency contact name or organisation."
            },
            "phone": {
              "example": "+61-7-5500-0000",
              "type": "string",
              "description": "Emergency contact telephone number (24-hour)."
            }
          }
        },
        "handlingInstructions": {
          "example": "Keep upright. Store away from heat sources. Do not short circuit.",
          "type": "string",
          "description": "Special handling instructions for the dangerous goods."
        },
        "securityInformation": {
          "example": "Screened per IATA Chapter 9 requirements",
          "type": "string",
          "description": "Security information relating to the dangerous goods consignment."
        },
        "documentEndorsement": {
          "example": "I hereby declare that the contents of this consignment are fully and accurately described above by the proper shipping name, and are classified, packaged, marked and labelled/placarded, and are in all respects in proper condition for transport according to applicable international and national governmental regulations.",
          "type": "string",
          "description": "Shipper's declaration statement authenticating the dangerous goods declaration."
        },
        "undgNumber": {
          "example": "UN3480",
          "type": "string",
          "description": "United Nations dangerous goods number (UN number) identifying the substance."
        },
        "dangerousGoodsTechnicalName": {
          "example": "Lithium ion batteries",
          "type": "string",
          "description": "Proper shipping name or technical name of the dangerous goods."
        },
        "dangerousGoodsRegulationCode": {
          "example": "IMDG",
          "type": "string",
          "description": "Code identifying the dangerous goods regulation applicable to this shipment (e.g., IMDG, IATA-DGR, ADR)."
        },
        "packagingDangerLevel": {
          "example": "II",
          "type": "string",
          "description": "Packing group indicating the degree of danger of the substance (I=great, II=medium, III=minor)."
        },
        "dangerousGoodsClassNumber": {
          "example": "9",
          "type": "string",
          "description": "Dangerous goods class number per the applicable regulation (e.g., Class 9 for miscellaneous dangerous goods)."
        },
        "transportMeansTypeCode": {
          "example": "1",
          "type": "string",
          "description": "Code specifying the type of transport means carrying the dangerous goods (1=maritime, 4=air)."
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
