"$schema": https://json-schema.org/draft/2020-12/schema
title: Rail Consignment Note (CIM)
description: A transport document issued under the Uniform Rules Concerning the Contract of International Carriage of Goods by Rail (CIM) evidencing the contract of rail carriage between the consignor and the carrier for cross-border rail freight.
type: object
required:
  - "@context"
  - type
  - credentialSchema
  - issuer
  - credentialSubject
properties:
  "@context":
    type: string
    format: uri
    description: 'Linked Data context for semantic interoperability'
    const: "https://un.opensource.unicc.org/unece/uncefact/spec-unvtd/rail-consignment-note-context.json"
  type:
    type: array
    description: 'Credential types'
    items:
      type: string
      enum:
        - VerifiableCredential
        - RailConsignmentNote
    minItems: 2
    maxItems: 2
    example:
      - VerifiableCredential
      - RailConsignmentNote
  credentialSchema:
    type: object
    description: 'Reference to the credential schema for validation'
    properties:
      id:
        type: string
        format: uri
        const: "https://un.opensource.unicc.org/unece/uncefact/spec-unvtd/rail-consignment-note-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:cim-2025-de-001234"
  validFrom:
    example: 2025-03-12T00:00:00Z
    type: string
    format: date-time
    description: 'Credential validity start date'
  validTo:
    example: 2026-03-12T00:00:00Z
    type: string
    format: date-time
    description: 'Credential validity end date'
  issuer:
    description: 'Identifier of the rail carrier issuing the consignment note (e.g., DID)'
    type: string
    format: uri
    example: did:web:dbcargo.example.com
  credentialSubject:
    name: RailConsignmentNote
    description: 'Rail consignment note (CIM) details'
    type: object
    required:
      - consignor
      - consignee
      - destinationStation
      - descriptionOfGoods
      - numberOfPackages
      - dangerousGoodsClassNumber
      - transportMeansIdentifier
      - vehicleRegistrationNumber
      - transportEquipmentIdentifier
    properties:
      consignor:
        description: Party consigning goods for rail carriage.
        type: object
        properties:
          type:
            type: string
            default: Consignor
            enum:
            - Consignor
          id:
            example: did:web:waveridersports-de.example.com
            type: string
            format: uri
            description: A unique party identifier.
          name:
            example: Wave Rider Sports GmbH
            type: string
            description: Trade party name.
          street:
            example: 88 Hafenstrasse
            type: string
            description: The street component of the address.
          city:
            example: Hamburg
            type: string
            description: The city component of the address.
          zip:
            example: 20457
            type: number
            description: Postal code.
          country:
            example: DE
            type: string
            description: Country.
      consignee:
        description: Party to which the goods are consigned for rail delivery.
        type: object
        properties:
          type:
            type: string
            default: Consignee
            enum:
            - Consignee
          id:
            example: did:web:balticsurfclub.example.com
            type: string
            format: uri
            description: A unique party identifier.
          name:
            example: Baltic Surf Club Sp. z o.o.
            type: string
            description: Trade party name.
          street:
            example: ul. Sportowa 12
            type: string
            description: The street component of the address.
          city:
            example: Warsaw
            type: string
            description: The city component of the address.
          zip:
            example: 00-001
            type: string
            description: Postal code.
          country:
            example: PL
            type: string
            description: Country.
      destinationStation:
        description: Name of the destination railway station where the goods are to be delivered.
        type: object
        properties:
          name:
            example: Warszawa Towarowa
            type: string
            description: Name of the destination railway station.
          city:
            example: Warsaw
            type: string
            description: City.
          country:
            example: PL
            type: string
            description: Country.
      descriptionOfGoods:
        example: "Surfboards, fins and wetsuits for water sports retail"
        type: string
        description: Plain language description of the nature of the goods carried by rail.
      numberOfPackages:
        example: 18
        type: number
        description: Number of packages in the consignment.
      dangerousGoodsClassNumber:
        example: "N/A"
        type: string
        description: RID dangerous goods class number applicable to the consignment (or N/A if not applicable).
      transportMeansIdentifier:
        example: DB 193 362
        type: string
        description: Identifier of the rail locomotive or traction unit.
      vehicleRegistrationNumber:
        example: "91 80 6193 362-8 D-DB"
        type: string
        description: European Vehicle Number (EVN) or other registration number of the rail vehicle.
      transportEquipmentIdentifier:
        example: "33 80 4780 001-4"
        type: string
        description: Identifier of the rail wagon or other transport equipment.
