$schema: https://json-schema.org/draft/2020-12/schema
title: Delivery Confirmation
description: A verifiable confirmation of delivery issued and cryptographically signed by the consignee (or its receiving
  agent), referencing a despatch advice / delivery note. Replaces the wet-ink proof-of-delivery signature in fully electronic
  processes.
type: object
required:
  - '@context'
  - type
  - credentialSchema
  - validTo
  - issuer
  - credentialSubject
properties:
  '@context':
    type: string
    format: uri
    description: Linked Data context for semantic interoperability
    const: https://unvtd.unece.org/delivery-confirmation-context.json
  type:
    type: array
    description: Document types
    items:
      type: string
      enum:
        - VerifiableCredential
        - DeliveryConfirmation
    minItems: 2
    maxItems: 2
    example:
      - VerifiableCredential
      - DeliveryConfirmation
  credentialSchema:
    type: object
    description: Reference to the credential schema for validation
    properties:
      id:
        type: string
        format: uri
        const: https://unvtd.unece.org/delivery-confirmation-schema.yaml
        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:dc-2025-wrs-001
  validFrom:
    example: 2025-03-18:14:30
    type: string
    format: date-time
    description: Credential validity start date
  validTo:
    example: 2026-03-18:14:30
    type: string
    format: date-time
    description: Credential validity end date
  issuer:
    name: Issuer
    description: Identifier of the party issuing the delivery confirmation (e.g., DID). Must match the receiving party (consignee
      or its agent). The cryptographic proof of this credential constitutes the signature of receipt.
    type: string
    format: uri
    example: did:web:waveridersupplies.example.com
  credentialSubject:
    name: DeliveryConfirmation
    description: Delivery confirmation details
    type: object
    properties:
      deliveryConfirmationNumber:
        example: DC-2025-WRS-001
        type: string
        description: Identifier assigned by the receiving party to the delivery confirmation.
      despatchAdviceReference:
        description: Cryptographic link to the despatch advice / delivery note being confirmed. The digest binds the confirmation
          to the exact signed content received.
        type: object
        properties:
          id:
            example: urn:uuid:da-2025-surfpro-001
            type: string
            format: uri
            description: Credential identifier of the referenced despatch advice.
          despatchAdviceNumber:
            example: DA-2025-031-001
            type: string
            description: Business identifier of the referenced despatch advice.
          deliveryNoteNumber:
            example: DN-2025-031-001
            type: string
            description: Business identifier of the referenced delivery note.
          digestSRI:
            example: sha384-MzNNbQTWCSUSi0bbz7dbua+RcENv7C6FvlmYJ1Y+I727HsPOHdzwELMYO9Mz68M26
            type: string
            description: Subresource Integrity digest of the referenced despatch advice credential, binding this confirmation
              to its exact content.
        required:
          - id
          - digestSRI
      receivedDate:
        example: '2025-03-18T14:30:00Z'
        type: string
        format: date-time
        description: Date and time at which the consignment was received.
      deliveryLocation:
        type: object
        properties:
          type:
            type: string
            default: Location
            enum:
              - Location
          name:
            example: Wave Rider Supplies Warehouse
            type: string
            description: Location name.
          unLocode:
            type: string
            description: UN/LOCODE location identifier (5 characters).
          postalAddress:
            description: The postal address of the location.
            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 code.
        description: Location at which the consignment was actually received.
      receivingParty:
        description: Party confirming receipt of the goods. Must match the credential issuer.
        type: object
        required:
          - type
          - id
          - name
        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 code.
      receivedBy:
        description: Natural person who took receipt of the goods on behalf of the receiving party.
        type: object
        properties:
          name:
            example: J. Smith
            type: string
            description: Name of the person acknowledging receipt.
          role:
            example: Goods-In Supervisor
            type: string
            description: Role or function of the person within the receiving party.
          id:
            example: did:web:waveridersupplies.example.com:staff:jsmith
            type: string
            format: uri
            description: Electronic identifier of the person (e.g., DID or corporate e-ID), where individual attribution is
              required.
      acceptanceStatus:
        example: AcceptedWithReservations
        type: string
        enum:
          - Accepted
          - AcceptedWithReservations
          - Refused
        description: Overall acceptance decision for the consignment.
      packagesReceived:
        example: 18
        type: number
        description: Total number of packages received.
      reservations:
        example: Carton 9 received with crushed corner; contents inspected, 2 units damaged.
        type: string
        description: Reservations or remarks recorded by the receiver at the time of delivery.
      lineConfirmations:
        name: Line Confirmations
        description: Per-line receipt reconciliation against the despatch advice. May be omitted when the consignment is accepted
          in full without reservations.
        type: array
        items:
          type: object
          properties:
            lineNumber:
              example: 2
              type: number
              description: Line number on the referenced despatch advice.
            sku:
              example: SURF-FN-014
              type: string
              description: Stock keeping unit identifier of the item.
            quantityDelivered:
              description: Quantity actually delivered.
              type: object
              properties:
                amount:
                  example: 200
                  type: number
                  description: Quantity value
                unit:
                  example: EA
                  type: string
                  description: Quantity unit
            quantityAccepted:
              description: Quantity accepted by the receiver.
              type: object
              properties:
                amount:
                  example: 198
                  type: number
                  description: Quantity value
                unit:
                  example: EA
                  type: string
                  description: Quantity unit
            quantityRejected:
              description: Quantity rejected by the receiver.
              type: object
              properties:
                amount:
                  example: 2
                  type: number
                  description: Quantity value
                unit:
                  example: EA
                  type: string
                  description: Quantity unit
            discrepancyCode:
              example: Damaged
              type: string
              enum:
                - Shortage
                - Overage
                - Damaged
                - WrongItem
                - Other
              description: Code classifying the discrepancy, where one exists.
            remarks:
              example: 2 fin sets with cracked carbon layup.
              type: string
              description: Free-text remarks on the discrepancy.
          description: Receipt confirmation for a specific line item.
      evidence:
        name: Evidence
        description: Electronic evidence recorded at delivery (e.g., photographs, sensor logs), each bound by content digest.
        type: array
        items:
          type: object
          properties:
            description:
              example: Photo of damaged carton 9
              type: string
              description: Description of the evidence item.
            link:
              example: https://edms.waveridersupplies.example.com/evidence/dc-2025-wrs-001/photo-1.jpg
              type: string
              format: uri
              description: Resolvable location of the evidence item.
            digestSRI:
              example: sha384-H8BRh8j48O9oYatfu5AZzq6A9RINhZO5H16dQZngK7T62em8MUt1FLm52t+eX6xO
              type: string
              description: Subresource Integrity digest binding the evidence content.
          description: An item of electronic evidence.
    required:
      - deliveryConfirmationNumber
      - despatchAdviceReference
      - receivedDate
      - receivingParty
      - acceptanceStatus
