{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unvtd.unece.org/shippers-letter-of-instructions-schema.json",
  "title": "Shipper's Letter of Instructions",
  "description": "A document issued by a shipper to a freight forwarder authorising them to arrange shipment and providing all necessary instructions for handling, documentation, and delivery of the consignment.",
  "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/shippers-letter-of-instructions-context.jsonld"
      ]
    },
    "type": {
      "type": "array",
      "description": "Credential types.",
      "const": [
        "VerifiableCredential",
        "ShippersLetterOfInstructionsCredential"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable name of the credential, for display.",
      "example": "Shipper's Letter of Instructions"
    },
    "credentialSchema": {
      "type": "object",
      "description": "Reference to the credential schema for validation",
      "properties": {
        "id": {
          "type": "string",
          "format": "uri",
          "const": "https://unvtd.unece.org/shippers-letter-of-instructions-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:a3c19de2-7f84-4b22-bc91-1047d8e3f201"
    },
    "validFrom": {
      "example": "2025-03-06T10:00:00.000Z",
      "type": "string",
      "format": "date-time",
      "description": "Credential validity start date"
    },
    "validUntil": {
      "example": "2026-03-06T10:00:00.000Z",
      "type": "string",
      "format": "date-time",
      "description": "Date until which this credential is valid."
    },
    "issuer": {
      "description": "Identifier of the shipper issuing the letter of instructions (e.g., DID)",
      "type": "string",
      "format": "uri",
      "example": "did:web:surfpro.example.com"
    },
    "credentialSubject": {
      "description": "Shipper letter of instructions details",
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the business document.",
          "const": "ShippersLetterOfInstructions"
        },
        "issueDate": {
          "example": "2025-03-06T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date that the letter of instructions was issued."
        },
        "despatchDate": {
          "example": "2025-03-10T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date on which goods are, or are expected to be, despatched or consigned."
        },
        "documentaryCreditNumber": {
          "example": "LC-2025-HSBC-00432",
          "type": "string",
          "description": "Reference number to identify a documentary credit (letter of credit)."
        },
        "incoterms": {
          "example": "FOB Gold Coast, Australia",
          "type": "string",
          "description": "Free form description of delivery or transport terms (Incoterms)."
        },
        "handlingInstructions": {
          "example": "Handle with care. Keep dry. Do not stack more than 3 high.",
          "type": "string",
          "description": "Free form description of a set of handling instructions for the goods or packages."
        },
        "insuranceCondition": {
          "example": "Institute Cargo Clauses (A) - All Risks",
          "type": "string",
          "description": "Reference to the general conditions of contract under which insurance coverage applies."
        },
        "authentication": {
          "example": "Signed by the authorised representative of SurfPro Manufacturing Inc.",
          "type": "string",
          "description": "Proof that the document has been authenticated."
        },
        "consignor": {
          "description": "Party consigning goods as stipulated in the transport contract by the party ordering transport.",
          "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 Boulevard",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "Los Angeles",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "CA",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "90001",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "freightForwarder": {
          "description": "Party undertaking the forwarding of goods.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:globalfreight.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"
                  ]
                },
                "streetAddress": {
                  "example": "88 Harbour View Road",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "Brisbane",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "QLD",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "4000",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "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 Boulevard",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "Los Angeles",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "CA",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "90001",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "notifyParty": {
          "description": "Party to be notified of the arrival of goods.",
          "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 Boulevard",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "Los Angeles",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "CA",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "90001",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "insuredParty": {
          "description": "Party which benefits from insurance coverage.",
          "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."
            }
          }
        },
        "placeOfDespatch": {
          "description": "Place from or at which goods are despatched.",
          "type": "object",
          "properties": {
            "name": {
              "example": "Port of Brisbane",
              "type": "string",
              "description": "Location name."
            },
            "addressLocality": {
              "example": "Brisbane",
              "type": "string",
              "description": "City."
            },
            "addressRegion": {
              "example": "QLD",
              "type": "string",
              "description": "State."
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country."
            },
            "unLocode": {
              "example": "https://service.unece.org/trade/locode/au.htm#AUBNE",
              "type": "string",
              "format": "uri",
              "description": "UN/LOCODE identifier."
            }
          }
        },
        "placeOfIssue": {
          "description": "Location where the document was issued.",
          "type": "object",
          "properties": {
            "addressLocality": {
              "example": "Gold Coast",
              "type": "string",
              "description": "City where issued."
            },
            "addressRegion": {
              "example": "QLD",
              "type": "string",
              "description": "State where issued."
            },
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "Country where issued."
            }
          }
        },
        "originCountry": {
          "description": "Name of the country in which the goods have been produced or manufactured.",
          "type": "object",
          "properties": {
            "addressCountry": {
              "example": "AU",
              "type": "string",
              "description": "ISO country code."
            },
            "name": {
              "example": "Australia",
              "type": "string",
              "description": "Country name."
            }
          }
        },
        "transportMeansIdentifier": {
          "example": "MV Pacific Carrier",
          "type": "string",
          "description": "Name of a specific means of transport such as the vessel name."
        },
        "vehicleRegistrationNumber": {
          "example": "IMO9876543",
          "type": "string",
          "description": "Identifier of a specific means of transport such as the IMO number of a vessel."
        },
        "numberOfPackages": {
          "example": 18,
          "type": "number",
          "description": "Total number of packages in the consignment."
        },
        "grossWeight": {
          "description": "Total gross weight of the consignment including packaging.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Quantity",
              "enum": [
                "Quantity"
              ]
            },
            "amount": {
              "example": 395,
              "type": "number",
              "format": "float",
              "description": "Weight amount."
            },
            "unit": {
              "example": "KGS",
              "type": "string",
              "description": "Weight unit."
            }
          }
        },
        "netWeight": {
          "description": "Total net weight of the consignment excluding packaging.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Quantity",
              "enum": [
                "Quantity"
              ]
            },
            "amount": {
              "example": 362.5,
              "type": "number",
              "format": "float",
              "description": "Weight amount."
            },
            "unit": {
              "example": "KGS",
              "type": "string",
              "description": "Weight unit."
            }
          }
        },
        "goods": {
          "description": "Goods items covered by the letter of instructions",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "description": {
                "example": "Professional Longboard - Ocean Series, 9'6\" length",
                "type": "string",
                "description": "Plain language description of the nature of a goods item."
              },
              "hsCode": {
                "example": "950630",
                "type": "string",
                "description": "Code specifying a type of goods for Customs purposes."
              },
              "packagingType": {
                "example": "CT",
                "type": "string",
                "description": "Code specifying the type of packaging of an item (UN/CEFACT rec 21)."
              },
              "shippingMarks": {
                "example": "SURF-AU-001 / FRAGILE / THIS SIDE UP",
                "type": "string",
                "description": "Free form description of the marks and numbers on a transport unit or package."
              },
              "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."
                  }
                }
              },
              "netWeight": {
                "description": "Net weight of this goods item.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 187.5,
                    "type": "number",
                    "format": "float",
                    "description": "Weight amount."
                  },
                  "unit": {
                    "example": "KGS",
                    "type": "string",
                    "description": "Weight unit."
                  }
                }
              },
              "grossWeight": {
                "description": "Gross weight of this goods item 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."
                  }
                }
              },
              "volume": {
                "description": "Volume of this goods item.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 1.8,
                    "type": "number",
                    "format": "float",
                    "description": "Volume amount."
                  },
                  "unit": {
                    "example": "MTQ",
                    "type": "string",
                    "description": "Volume unit."
                  }
                }
              },
              "packageLength": {
                "description": "Length of the package.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 320,
                    "type": "number",
                    "format": "float",
                    "description": "Length amount."
                  },
                  "unit": {
                    "example": "CMT",
                    "type": "string",
                    "description": "Length unit."
                  }
                }
              },
              "packageWidth": {
                "description": "Width of the package.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Quantity",
                    "enum": [
                      "Quantity"
                    ]
                  },
                  "amount": {
                    "example": 60,
                    "type": "number",
                    "format": "float",
                    "description": "Width amount."
                  },
                  "unit": {
                    "example": "CMT",
                    "type": "string",
                    "description": "Width unit."
                  }
                }
              },
              "value": {
                "description": "Value of the goods item.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "MonetaryAmount",
                    "enum": [
                      "MonetaryAmount"
                    ]
                  },
                  "amount": {
                    "example": 18750,
                    "type": "number",
                    "format": "float",
                    "description": "Monetary amount."
                  },
                  "currency": {
                    "example": "USD",
                    "type": "string",
                    "description": "Currency code."
                  }
                }
              }
            },
            "description": "A specific goods item covered by the letter of instructions."
          }
        }
      },
      "required": [
        "type",
        "issueDate",
        "despatchDate",
        "incoterms",
        "consignor",
        "consignee",
        "freightForwarder",
        "placeOfDespatch",
        "placeOfIssue",
        "originCountry",
        "numberOfPackages",
        "grossWeight",
        "netWeight",
        "goods"
      ],
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
