{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unvtd.unece.org/packing-list-schema.json",
  "title": "Packing List",
  "description": "A detailed inventory of the contents of packages in a shipment, including item descriptions, quantities, weights, and package marks for shipping and receiving purposes.",
  "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/packing-list-context.jsonld"
      ]
    },
    "type": {
      "type": "array",
      "description": "Credential types.",
      "const": [
        "VerifiableCredential",
        "PackingListCredential"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable name of the credential, for display.",
      "example": "Packing List"
    },
    "credentialSchema": {
      "type": "object",
      "description": "Reference to the credential schema for validation",
      "properties": {
        "id": {
          "type": "string",
          "format": "uri",
          "const": "https://unvtd.unece.org/packing-list-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:pl-2025-surfpro-001"
    },
    "validFrom": {
      "example": "2025-03-09:10:00",
      "type": "string",
      "format": "date-time",
      "description": "Credential validity start date"
    },
    "validUntil": {
      "example": "2026-03-09:10:00",
      "type": "string",
      "format": "date-time",
      "description": "Date until which this credential is valid."
    },
    "issuer": {
      "name": "Issuer",
      "description": "Identifier of the party issuing the packing list (e.g., DID)",
      "type": "string",
      "format": "uri",
      "example": "did:web:surfpro.example.com"
    },
    "credentialSubject": {
      "name": "PackingList",
      "description": "Packing list details",
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the business document.",
          "const": "PackingList"
        },
        "issueDate": {
          "example": "2025-03-09T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date that a document was issued."
        },
        "despatchDate": {
          "example": "2025-03-11T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date on which goods are despatched or consigned."
        },
        "purchaseOrderNumber": {
          "example": "PO-2025-001",
          "type": "string",
          "description": "Identifier assigned by the buyer to an order."
        },
        "contractNumber": {
          "example": "CTR-2025-SURF-001",
          "type": "string",
          "description": "Identifier of a contract concluded between parties."
        },
        "invoiceNumber": {
          "example": "INV-2025-031-001",
          "type": "string",
          "description": "Reference number to identify an invoice."
        },
        "transportContractNumber": {
          "example": "BKG123456789",
          "type": "string",
          "description": "Reference number to identify a document evidencing a transport contract."
        },
        "buyer": {
          "description": "Party to which merchandise or services are sold.",
          "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": "NSW",
                  "type": "string",
                  "description": "The state component of the address"
                },
                "postalCode": {
                  "example": "75002",
                  "type": "string",
                  "description": "Postal code"
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "seller": {
          "description": "Party selling merchandise or services to a buyer.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:surfpro.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "SurfPro Manufacturing 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": "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 which goods are 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": "NSW",
                  "type": "string",
                  "description": "The state component of the address"
                },
                "postalCode": {
                  "example": "75002",
                  "type": "string",
                  "description": "Postal code"
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "carrier": {
          "description": "Party providing the transport of goods between named points.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:pacificshipping.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Pacific Ocean Shipping Lines",
              "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": "88 Harbour Street",
                  "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."
                }
              }
            }
          }
        },
        "deliveryLocation": {
          "description": "Location to which a consignment is to be delivered.",
          "type": "object",
          "properties": {
            "name": {
              "example": "Wave Rider Supplies Warehouse",
              "type": "string",
              "description": "Location name"
            },
            "streetAddress": {
              "example": "210 Ocean Road",
              "type": "string",
              "description": "Street address"
            },
            "addressLocality": {
              "example": "Williamsburg",
              "type": "string",
              "description": "City"
            },
            "addressRegion": {
              "example": "NSW",
              "type": "string",
              "description": "State"
            },
            "postalCode": {
              "example": "75002",
              "type": "string",
              "description": "Postal code"
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country"
            }
          }
        },
        "despatchLocation": {
          "description": "Place from which despatch is to take place.",
          "type": "object",
          "properties": {
            "name": {
              "example": "SurfPro Manufacturing Facility",
              "type": "string",
              "description": "Location name"
            },
            "streetAddress": {
              "example": "150 Industrial Drive",
              "type": "string",
              "description": "Street address"
            },
            "addressLocality": {
              "example": "Gold Coast",
              "type": "string",
              "description": "City"
            },
            "addressRegion": {
              "example": "QLD",
              "type": "string",
              "description": "State"
            },
            "postalCode": {
              "example": "4217",
              "type": "string",
              "description": "Postal code"
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country"
            }
          }
        },
        "originCountry": {
          "description": "Country where the goods were produced.",
          "type": "object",
          "properties": {
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "ISO country code"
            },
            "name": {
              "example": "Australia",
              "type": "string",
              "description": "Country name"
            }
          }
        },
        "baseportUnloadingLocation": {
          "description": "The place or port at which the cargo is discharged.",
          "type": "object",
          "properties": {
            "name": {
              "example": "Port of Sydney",
              "type": "string",
              "description": "Location name"
            },
            "addressLocality": {
              "example": "Sydney",
              "type": "string",
              "description": "City"
            },
            "addressRegion": {
              "example": "NSW",
              "type": "string",
              "description": "State"
            },
            "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"
            }
          }
        },
        "totalGrossWeight": {
          "description": "Total gross weight of all packages.",
          "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"
            }
          }
        },
        "totalNetWeight": {
          "description": "Total net weight of all items.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Quantity",
              "enum": [
                "Quantity"
              ]
            },
            "amount": {
              "example": 475,
              "type": "number",
              "format": "float",
              "description": "Weight amount"
            },
            "unit": {
              "example": "KGS",
              "type": "string",
              "description": "Weight unit"
            }
          }
        },
        "totalPackages": {
          "example": 18,
          "type": "number",
          "description": "Total number of packages."
        },
        "totalVolume": {
          "description": "Total volume of all packages.",
          "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 (cubic meters)"
            }
          }
        },
        "handlingInstructions": {
          "example": "Handle with care. Keep dry. This side up.",
          "type": "string",
          "description": "Instructions on how packages should be handled."
        },
        "transportTemperature": {
          "example": "Ambient temperature",
          "type": "string",
          "description": "Instructions regarding the temperature under which the cargo has to be transported."
        },
        "conveyanceReferenceNumber": {
          "example": "VOYAGE-2025-AU-001",
          "type": "string",
          "description": "Identifier of a journey of a means of transport, such as a voyage or flight number (UID:8028)."
        },
        "vehicleRegistrationNumber": {
          "example": "IMO9876543",
          "type": "string",
          "description": "Identifier of the specific means of transport such as IMO number or vessel registration (UID:8213)."
        },
        "packages": {
          "name": "Packages",
          "description": "Details of individual packages",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "packageNumber": {
                "example": 1,
                "type": "number",
                "description": "Sequential package number"
              },
              "packageType": {
                "example": "CT",
                "type": "string",
                "description": "Code specifying the type of packaging (CT=Carton)."
              },
              "shippingMark": {
                "example": "SURFPRO/WRS/001",
                "type": "string",
                "description": "Marks and numbers on the package."
              },
              "length": {
                "description": "Package length measurement.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 250,
                    "type": "number",
                    "description": "Length value"
                  },
                  "unit": {
                    "example": "CM",
                    "type": "string",
                    "description": "Length unit"
                  }
                }
              },
              "width": {
                "description": "Package width measurement.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 50,
                    "type": "number",
                    "description": "Width value"
                  },
                  "unit": {
                    "example": "CM",
                    "type": "string",
                    "description": "Width unit"
                  }
                }
              },
              "height": {
                "description": "Package height measurement.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 40,
                    "type": "number",
                    "description": "Height value"
                  },
                  "unit": {
                    "example": "CM",
                    "type": "string",
                    "description": "Height unit"
                  }
                }
              },
              "grossWeight": {
                "description": "Gross weight of the package.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 40,
                    "type": "number",
                    "format": "float",
                    "description": "Weight amount"
                  },
                  "unit": {
                    "example": "KGS",
                    "type": "string",
                    "description": "Weight unit"
                  }
                }
              },
              "netWeight": {
                "description": "Net weight of items in the package.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 37.5,
                    "type": "number",
                    "format": "float",
                    "description": "Weight amount"
                  },
                  "unit": {
                    "example": "KGS",
                    "type": "string",
                    "description": "Weight unit"
                  }
                }
              },
              "volume": {
                "description": "Volume of the package.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 0.5,
                    "type": "number",
                    "format": "float",
                    "description": "Volume amount"
                  },
                  "unit": {
                    "example": "CBM",
                    "type": "string",
                    "description": "Volume unit"
                  }
                }
              },
              "items": {
                "name": "Package Items",
                "description": "Items contained in this package",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "description": {
                      "example": "Professional Longboard - Ocean Series",
                      "type": "string",
                      "description": "Description of the item."
                    },
                    "sku": {
                      "example": "SURF-LB-001",
                      "type": "string",
                      "description": "Stock keeping unit identifier."
                    },
                    "quantity": {
                      "example": 5,
                      "type": "number",
                      "description": "Number of units in this package."
                    },
                    "hsCode": {
                      "example": "950630",
                      "type": "string",
                      "description": "Harmonized System code."
                    },
                    "originCountry": {
                      "example": "AU",
                      "type": "string",
                      "description": "Country of origin."
                    },
                    "unitWeight": {
                      "description": "Weight per unit.",
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "default": "Quantity",
                          "enum": [
                            "Quantity"
                          ]
                        },
                        "amount": {
                          "example": 7.5,
                          "type": "number",
                          "format": "float",
                          "description": "Weight amount"
                        },
                        "unit": {
                          "example": "KGS",
                          "type": "string",
                          "description": "Weight unit"
                        }
                      }
                    }
                  },
                  "description": "An item contained in the package."
                }
              }
            },
            "description": "Details of a specific package."
          }
        }
      },
      "required": [
        "type",
        "issueDate",
        "conveyanceReferenceNumber",
        "vehicleRegistrationNumber",
        "packages",
        "buyer",
        "seller",
        "consignee",
        "deliveryLocation",
        "totalNetWeight",
        "totalPackages",
        "totalVolume"
      ],
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
