{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unvtd.unece.org/bill-of-lading-schema.json",
  "title": "Bill of Lading",
  "description": "A transport document issued by a carrier acknowledging receipt of cargo for shipment and evidencing the contract of carriage and title to the goods.",
  "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/bill-of-lading-context.jsonld"
      ]
    },
    "type": {
      "type": "array",
      "description": "Credential types.",
      "const": [
        "VerifiableCredential",
        "BillOfLadingCredential"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable name of the credential, for display.",
      "example": "Bill of Lading"
    },
    "credentialSchema": {
      "type": "object",
      "description": "Reference to the credential schema for validation",
      "properties": {
        "id": {
          "type": "string",
          "format": "uri",
          "const": "https://unvtd.unece.org/bill-of-lading-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:bol-2025-pacific-001"
    },
    "validFrom": {
      "example": "2025-03-11T10:00:00Z",
      "type": "string",
      "format": "date-time",
      "description": "Credential validity start date"
    },
    "validUntil": {
      "example": "2026-03-11T10:00:00Z",
      "type": "string",
      "format": "date-time",
      "description": "Date until which this credential is valid."
    },
    "issuer": {
      "name": "Issuer",
      "description": "Identifier of the carrier issuing the bill of lading (e.g., DID)",
      "type": "string",
      "format": "uri",
      "example": "did:web:pacificshipping.example.com"
    },
    "credentialSubject": {
      "name": "BillOfLading",
      "description": "Bill of lading details",
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the business document.",
          "const": "BillOfLading"
        },
        "billOfLadingNumber": {
          "example": "POSL-2025-001234",
          "type": "string",
          "description": "Reference number to identify a document evidencing a transport contract."
        },
        "documentIdentifier": {
          "example": "BL-2025-AU-001234",
          "type": "string",
          "description": "Reference number identifying a specific document."
        },
        "bookingReferenceNumber": {
          "example": "BKG123456789",
          "type": "string",
          "description": "Reference number assigned by a carrier to identify a specific consignment."
        },
        "issueDate": {
          "example": "2025-03-11",
          "type": "string",
          "format": "date",
          "description": "Date that a document was issued."
        },
        "consignmentLoadingDate": {
          "example": "2025-03-11",
          "type": "string",
          "format": "date",
          "description": "Date when a consignment is loaded onto a means of transport."
        },
        "estimatedTimeOfDeparture": {
          "example": "2025-03-12T08:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date and time when a transport means is scheduled to depart."
        },
        "estimatedTimeOfArrival": {
          "example": "2025-03-13T14:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date and time of the estimated arrival of means of transport."
        },
        "consignor": {
          "description": "Party consigning goods as stipulated in the transport contract.",
          "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."
                }
              }
            }
          }
        },
        "notifyParty": {
          "description": "Party to be notified.",
          "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."
                }
              }
            }
          }
        },
        "freightPayer": {
          "description": "Party responsible for the payment of freight charges.",
          "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."
                }
              }
            }
          }
        },
        "originalLoadingLocation": {
          "description": "Location where the goods were first loaded onto the means of transport.",
          "type": "object",
          "properties": {
            "name": {
              "example": "Port of Gold Coast",
              "type": "string",
              "description": "Location name"
            },
            "addressLocality": {
              "example": "Gold Coast",
              "type": "string",
              "description": "City"
            },
            "addressRegion": {
              "example": "QLD",
              "type": "string",
              "description": "State"
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country"
            },
            "unLocode": {
              "example": "AUGOL",
              "type": "string",
              "description": "UN/LOCODE identifier (5 characters)."
            }
          }
        },
        "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": "AUSYD",
              "type": "string",
              "description": "UN/LOCODE identifier (5 characters)."
            }
          }
        },
        "deliveryLocation": {
          "description": "Location to which a consignment is to be delivered to the final consignee.",
          "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"
            }
          }
        },
        "placeOfDeparture": {
          "description": "Port from which a means of transport is scheduled to depart.",
          "type": "object",
          "properties": {
            "name": {
              "example": "Port of Gold Coast",
              "type": "string",
              "description": "Location name"
            },
            "addressLocality": {
              "example": "Gold Coast",
              "type": "string",
              "description": "City"
            },
            "addressRegion": {
              "example": "QLD",
              "type": "string",
              "description": "State"
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country"
            },
            "unLocode": {
              "example": "AUGOL",
              "type": "string",
              "description": "UN/LOCODE identifier (5 characters)."
            }
          }
        },
        "arrivalLocation": {
          "description": "Port at which a means of transport is scheduled to arrive.",
          "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": "AUSYD",
              "type": "string",
              "description": "UN/LOCODE identifier (5 characters)."
            }
          }
        },
        "paymentLocation": {
          "description": "Place where the payment has been or should be made.",
          "type": "object",
          "properties": {
            "addressLocality": {
              "example": "Gold Coast",
              "type": "string",
              "description": "City"
            },
            "addressRegion": {
              "example": "QLD",
              "type": "string",
              "description": "State"
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country"
            }
          }
        },
        "placeOfIssue": {
          "description": "Location where a document was issued.",
          "type": "object",
          "properties": {
            "addressLocality": {
              "example": "Sydney",
              "type": "string",
              "description": "City"
            },
            "addressRegion": {
              "example": "NSW",
              "type": "string",
              "description": "State"
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country"
            }
          }
        },
        "conveyanceReferenceNumber": {
          "example": "VOYAGE-2025-AU-001",
          "type": "string",
          "description": "Identifier of a journey of a means of transport, for example voyage number."
        },
        "transportMeansIdentifier": {
          "example": "PACIFIC VOYAGER",
          "type": "string",
          "description": "Name of a specific means of transport such as the vessel name."
        },
        "transportMeansRegistration": {
          "example": "IMO9876543",
          "type": "string",
          "description": "Identifier of a specific means of transport."
        },
        "containerSizeAndType": {
          "example": "22G1",
          "type": "string",
          "description": "Code specifying the characteristics, i.e. size and type of a piece of transport equipment."
        },
        "fullOrEmptyContainer": {
          "example": "5",
          "type": "string",
          "description": "Code specifying how full a piece of transport equipment is (5=Full)."
        },
        "transportEquipmentIdentifier": {
          "example": "POSU1234567",
          "type": "string",
          "description": "Identifier of a piece of transport equipment e.g. container."
        },
        "sealIdentifier": {
          "example": "SEAL123456",
          "type": "string",
          "description": "The identification number of a seal affixed to a piece of transport equipment."
        },
        "grossWeight": {
          "description": "Total gross weight 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 measurement.",
          "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."
        },
        "descriptionOfGoods": {
          "example": "Surfboards, fins and wetsuits for water sports retail",
          "type": "string",
          "description": "Plain language description of the nature of a goods item."
        },
        "consignmentSummaryDescription": {
          "example": "Sports equipment - surfing products",
          "type": "string",
          "description": "Plain language description of a consignment in summary terms."
        },
        "shippingMarks": {
          "example": "SURFPRO/WRS/001-018",
          "type": "string",
          "description": "Free form description of the marks and numbers on a transport unit or package."
        },
        "transportContractConditions": {
          "example": "Subject to carrier's standard terms and conditions",
          "type": "string",
          "description": "Reference to carrier's conditions of carriage."
        },
        "prepaidAmount": {
          "description": "Monetary amount of charges which have been paid in advance.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "MonetaryAmount",
              "enum": [
                "MonetaryAmount"
              ]
            },
            "amount": {
              "example": 2500,
              "type": "number",
              "format": "float",
              "description": "Monetary amount"
            },
            "currency": {
              "example": "USD",
              "type": "string",
              "description": "Currency code"
            }
          }
        },
        "collectCharges": {
          "description": "Monetary amount of charges to be collected from the consignee.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "MonetaryAmount",
              "enum": [
                "MonetaryAmount"
              ]
            },
            "amount": {
              "example": 0,
              "type": "number",
              "format": "float",
              "description": "Monetary amount"
            },
            "currency": {
              "example": "USD",
              "type": "string",
              "description": "Currency code"
            }
          }
        },
        "contractNumber": {
          "example": "CTR-2025-SURF-001",
          "type": "string",
          "description": "Identifier of a contract concluded between parties."
        },
        "ucr": {
          "example": "AU2025SURF001234",
          "type": "string",
          "description": "Unique Consignment Reference identifying a particular consignment."
        },
        "goods": {
          "name": "Goods",
          "description": "Goods covered by the bill of lading",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "description": {
                "example": "Professional Longboard - Ocean Series",
                "type": "string",
                "description": "Description of the goods."
              },
              "hsCode": {
                "example": "950630",
                "type": "string",
                "description": "Code specifying a type of goods for Customs purposes."
              },
              "quantity": {
                "description": "Number of units",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 25,
                    "type": "number",
                    "description": "Quantity amount"
                  },
                  "unit": {
                    "example": "Units",
                    "type": "string",
                    "description": "Unit of measure"
                  }
                }
              },
              "grossWeight": {
                "description": "Gross weight including packaging.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 200,
                    "type": "number",
                    "format": "float",
                    "description": "Weight amount"
                  },
                  "unit": {
                    "example": "KGS",
                    "type": "string",
                    "description": "Weight unit"
                  }
                }
              },
              "packages": {
                "example": 5,
                "type": "number",
                "description": "Number of packages."
              },
              "packagingType": {
                "example": "CT",
                "type": "string",
                "description": "Code specifying the type of packaging."
              }
            },
            "description": "A specific goods item."
          }
        }
      },
      "required": [
        "type",
        "billOfLadingNumber",
        "issueDate",
        "consignor",
        "consignee",
        "carrier",
        "originalLoadingLocation",
        "baseportUnloadingLocation",
        "documentIdentifier",
        "consignmentLoadingDate",
        "freightPayer",
        "transportMeansIdentifier",
        "grossWeight",
        "volume",
        "numberOfPackages",
        "descriptionOfGoods",
        "transportContractConditions",
        "contractNumber"
      ],
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
