{
  "$ref": "#/definitions/IdentificationForm",
  "definitions": {
    "Address": {
      "description": "Definition of an Address as part of a digital Identification form for waste transport",
      "properties": {
        "country": {
          "type": "string"
        },
        "houseNumber": {
          "description": "House number",
          "type": "string"
        },
        "mailboxNumber": {
          "description": "Mailbox number of the address can be separate field or can be part of houseNumber",
          "type": "string"
        },
        "municipality": {
          "description": "Name of the municipality",
          "type": "string"
        },
        "postalCode": {
          "description": "Postal code of the municipality",
          "type": "string"
        },
        "street": {
          "description": "Name of the street",
          "type": "string"
        }
      },
      "required": [
        "country",
        "houseNumber",
        "municipality",
        "postalCode",
        "street"
      ],
      "title": "Address Waste Actor",
      "type": "object"
    },
    "Carrier": {
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "executiveCarrier": {
          "description": "Whether this is the carrier that executes the transport.\nPossible values: 'true', 'false'.",
          "type": "boolean"
        },
        "identificationNumber": {
          "$ref": "#/definitions/EnterpriseIdentificationNumber"
        },
        "name": {
          "description": "Name of the carrier",
          "type": "string"
        }
      },
      "required": [
        "address",
        "identificationNumber",
        "name"
      ],
      "type": "object"
    },
    "CollectorTraderBroker": {
      "description": "Only required when a Collector/Trader/Broker is involved",
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "identificationNumber": {
          "$ref": "#/definitions/EnterpriseIdentificationNumber"
        },
        "name": {
          "description": "Name of the Collector/Trader/Broker",
          "type": "string"
        }
      },
      "required": [
        "address",
        "identificationNumber",
        "name"
      ],
      "type": "object"
    },
    "EnterpriseIdentificationNumber": {
      "properties": {
        "enterpriseNumber": {
          "description": "Belgian enterprise number. Next to matching pattern, it is also validated on modulo97.",
          "pattern": "^([0-1][0-9]{9})$",
          "type": "string"
        },
        "vatNumber": {
          "description": "International VAT number. When a Belgian VAT number (i.e. starting with BE), its numeric part should match the enterpriseNumber pattern. VIES VAT number validation: https://ec.europa.eu/taxation_customs/vies/#/vat-validation",
          "pattern": "^([A-Z]{2}.*)$",
          "type": "string"
        }
      },
      "type": "object"
    },
    "EstablishmentUnitIdentificationNumber": {
      "description": "Identification number of establishment unit. Should be establishmentUnitNumber and enterpriseNumber, OR vatNumber (if international enterprise)",
      "properties": {
        "enterpriseNumber": {
          "description": "Belgian enterprise number. Next to matching pattern, it is also validated on modulo97.",
          "pattern": "^([0-1][0-9]{9})$",
          "type": "string"
        },
        "establishmentUnitNumber": {
          "description": "Belgian establishment unit number. Next to matching pattern, it is also validated on modulo97.",
          "pattern": "^([2-8][0-9]{9})$",
          "type": "string"
        },
        "vatNumber": {
          "description": "International VAT number. When a Belgian VAT number (i.e. starting with BE), its numeric part should match the enterpriseNumber pattern. VIES VAT number validation: https://ec.europa.eu/taxation_customs/vies/#/vat-validation",
          "pattern": "^([A-Z]{2}.*)$",
          "type": "string"
        }
      },
      "type": "object"
    },
    "IdentificationForm": {
      "description": "Digital Identification form for waste transport",
      "properties": {
        "carriers": {
          "description": "Waste actor assigned to transport the waste",
          "items": {
            "$ref": "#/definitions/Carrier"
          },
          "minItems": 1,
          "type": "array"
        },
        "collectionLocation": {
          "$ref": "#/definitions/Point",
          "description": "Starting location of the waste transport where the waste is collected"
        },
        "collectorTraderBroker": {
          "$ref": "#/definitions/CollectorTraderBroker",
          "description": "Only required when a Collector/Trader/Broker is involved"
        },
        "deliveryLocation": {
          "$ref": "#/definitions/Point",
          "description": "Geolocation where waste is delivered"
        },
        "id": {
          "description": "One of the two identifiers of the Identification Form starts with a 3-letter code related to the system where the form is created/signed for the first time, it is only mandatory the first time it is sent to the IOP.",
          "type": "string"
        },
        "metadata": {
          "$ref": "#/definitions/IdentificationFormMetadata",
          "description": "Metadata of the Identification form"
        },
        "proprietaryProperties": {
          "additionalProperties": true,
          "description": "Root object to specify proprietary properties",
          "properties": {},
          "type": "object"
        },
        "reasonDiscontinuation": {
          "description": "Reason why transport has been discontinued after departure of the waste transport. Required when status is DISCONTINUED.",
          "type": "string"
        },
        "schemaVersion": {
          "description": "Version of this schema definition, in format \"majorversion.minorversion\"",
          "pattern": "^[0-9]+\\.[0-9]+$",
          "type": "string"
        },
        "signatureReceiver": {
          "$ref": "#/definitions/Signature",
          "description": "Signature of the person whose signs the Digid form upon receipt of the waste. Usually the treatment facility, occasionally the carrier."
        },
        "signatureResponsible": {
          "$ref": "#/definitions/Signature",
          "description": "Signature of the person whose drafts the Digid form."
        },
        "status": {
          "$ref": "#/definitions/IdentificationFormFlowStatus"
        },
        "timestampLastModification": {
          "description": "Timestamp of the last modification made by the user. Needs to include date, time and time zone",
          "format": "date-time",
          "type": "string"
        },
        "transportDate": {
          "description": "The date of the start of the waste transport",
          "format": "date",
          "type": "string"
        },
        "transportInstructions": {
          "description": "Instructions to the carrier for the waste transport. Typically used for ADR-instructions (Accord Dangereux Routier (European regulations concerning the international transport of dangerous goods by road)) and applicable for the complete transport",
          "type": "string"
        },
        "treatmentFacility": {
          "$ref": "#/definitions/TreatmentFacility",
          "description": "The destination of the waste transport"
        },
        "uuid": {
          "description": "Mandatory unique identification of the Identification Form",
          "format": "uuid",
          "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$",
          "type": "string"
        },
        "waste": {
          "description": "Waste description",
          "items": {
            "$ref": "#/definitions/Waste"
          },
          "minItems": 1,
          "type": "array"
        },
        "wasteProducer": {
          "$ref": "#/definitions/WasteProducer",
          "description": "If the producer draws up the form, i.e. makes the arrangements for the transport itself, no IHM must be specified and the producer must sign the form."
        }
      },
      "required": [
        "carriers",
        "metadata",
        "schemaVersion",
        "status",
        "timestampLastModification",
        "transportDate",
        "treatmentFacility",
        "uuid",
        "waste",
        "wasteProducer"
      ],
      "title": "DigId",
      "type": "object"
    },
    "IdentificationFormFlowStatus": {
      "description": "Current state of the flow. Possible values: 'DRAFT', 'SIGNED', 'CANCELLED', 'IN TRANSIT', 'DISCONTINUED', 'ARRIVED', 'COMPLETED', 'INCORRECT'.",
      "enum": [
        "ARRIVED",
        "CANCELLED",
        "COMPLETED",
        "DISCONTINUED",
        "DRAFT",
        "IN TRANSIT",
        "INCORRECT",
        "SIGNED"
      ],
      "type": "string"
    },
    "IdentificationFormMetadata": {
      "description": "Definition of metadata as part of an Identification form for waste transport",
      "properties": {
        "formVersion": {
          "description": "Version of this form",
          "type": "integer"
        },
        "iopTimestamp": {
          "description": "Timestamp when the identification form has been received in the IOP system. Value is added by the IOP, not by the System who sends the form",
          "format": "date-time",
          "type": "string"
        },
        "queueOffset": {
          "description": "The offset of the message in the IOP queue, which is an identifier for the message's position in the IOP queue. Value is added by the IOP, not by the System who sends the form. This offset will get set/get overwritten each time the Digid form arrives in the IOP queue",
          "type": "integer"
        },
        "timestampFormVersionIncrease": {
          "description": "Timestamp when the form version has been increased in the system that sent the form. Needs to include date, time and time zone",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "formVersion",
        "timestampFormVersionIncrease"
      ],
      "type": "object"
    },
    "IdentificationNumber": {
      "description": "Party Identification number",
      "minProperties": 1,
      "properties": {
        "citizen": {
          "description": "This field should only be added if waste producer is a citizen, not an enterprise. If used, mandatory value: 'CITIZEN'",
          "enum": [
            "CITIZEN"
          ],
          "type": "string"
        },
        "enterpriseNumber": {
          "description": "Belgian enterprise number. Next to matching pattern, it is also validated on modulo97.",
          "pattern": "^([0-1][0-9]{9})$",
          "type": "string"
        },
        "establishmentUnitNumber": {
          "description": "Belgian establishment unit number. Next to matching pattern, it is also validated on modulo97.",
          "pattern": "^([2-8][0-9]{9})$",
          "type": "string"
        },
        "seaShipIMONumber": {
          "description": "Sea ship IMO number should match pattern, but also pass the check-digit validation.",
          "pattern": "^(IMO[0-9]{7})$",
          "type": "string"
        },
        "seaShipMMSINumber": {
          "description": "Sea ship MMSI number",
          "pattern": "^([0-9]{9})$",
          "type": "string"
        },
        "vatNumber": {
          "description": "International VAT number. When a Belgian VAT number (i.e. starting with BE), its numeric part should match the enterpriseNumber pattern. VIES VAT number validation: https://ec.europa.eu/taxation_customs/vies/#/vat-validation",
          "pattern": "^([A-Z]{2}.*)$",
          "type": "string"
        }
      },
      "type": "object"
    },
    "PickupLocation": {
      "description": "Pickup location: Either address (required when known) or description in addressExtension should be present.",
      "minProperties": 1,
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "addressExtension": {
          "description": "This field can be used when there's no address, e.g. for a construction site",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Point": {
      "description": "Definition of a Location in Belgian Lambert 2008 format as part of a digital Identification form for waste transport: https://epsg.io/3812. GeoJSON (https://geojson.org/ + https://www.rfc-editor.org/rfc/rfc7946) Point",
      "properties": {
        "coordinates": {
          "description": "Point coordinates are in x, y order (easting, nothing) and in Lambert2008 coordinates.",
          "items": {
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        },
        "type": {
          "description": "Point type. Mandatory value: 'Point'.",
          "enum": [
            "Point"
          ],
          "type": "string"
        }
      },
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object"
    },
    "Signature": {
      "description": "Definition of a Signature as part of a digital Identification form for waste transport",
      "properties": {
        "date": {
          "description": "Date, time and time zone of signature",
          "format": "date-time",
          "type": "string"
        },
        "linkAuditTrail": {
          "description": "Link to audit trail of signature (Applicable when ADVANCED signature type, but is optional)",
          "type": "string"
        },
        "name": {
          "description": "Name of signer",
          "type": "string"
        },
        "signatureType": {
          "$ref": "#/definitions/SignatureType"
        },
        "signedAtLocation": {
          "$ref": "#/definitions/Point",
          "description": "Geolocation of the place where signed"
        },
        "systemIdentification": {
          "description": "Identifier of system used to sign. Mandatory first time a signature is added in form",
          "pattern": "^(?:[0-9A-Z]{3}|Removed by IOP)$",
          "type": "string"
        }
      },
      "required": [
        "date",
        "name",
        "signatureType",
        "systemIdentification"
      ],
      "type": "object"
    },
    "SignatureType": {
      "description": "Type of signature, more info (in Dutch): https://www.vlaanderen.be/informatiemanagement/informatie-digitaliseren/de-elektronische-handtekening. Possible values: 'SIMPLE', 'ADVANCED', 'QUALIFIED'.",
      "enum": [
        "ADVANCED",
        "QUALIFIED",
        "SIMPLE"
      ],
      "type": "string"
    },
    "TreatmentCode": {
      "description": "Code of treatment (from a predefined list https://ovam.vlaanderen.be/r-d-codes)",
      "enum": [
        "D1",
        "D10",
        "D11",
        "D12",
        "D13",
        "D14",
        "D15",
        "D2",
        "D3",
        "D4",
        "D5",
        "D6",
        "D7",
        "D8",
        "D9",
        "R1",
        "R10",
        "R11",
        "R12",
        "R13",
        "R2",
        "R3",
        "R4",
        "R5",
        "R6",
        "R7",
        "R8",
        "R9"
      ],
      "minItems": 1,
      "type": "string"
    },
    "TreatmentFacility": {
      "description": "The destination of the waste transport",
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "identificationNumber": {
          "$ref": "#/definitions/EstablishmentUnitIdentificationNumber"
        },
        "name": {
          "description": "Name of the treatment facility",
          "type": "string"
        }
      },
      "required": [
        "address",
        "identificationNumber",
        "name"
      ],
      "type": "object"
    },
    "Unit": {
      "description": "Unit of weight. Possible values: 'ton', 'kg', 'm3', 'l', 'number'.",
      "enum": [
        "kg",
        "l",
        "m3",
        "number",
        "ton"
      ],
      "type": "string"
    },
    "Waste": {
      "description": "Definition of a Waste as part of a digital Identification form for waste transport",
      "properties": {
        "chemicalComposition": {
          "description": "Chemical composition (Mandatory when transporting hazardous waste)",
          "type": "string"
        },
        "description": {
          "description": "Description",
          "type": "string"
        },
        "euralCode": {
          "description": "Code from the predefined List of Waste (https://data.ovam.be/doc/euralcode)",
          "pattern": "^[0-9]{2} [0-9]{2} [0-9]{2}$",
          "type": "string"
        },
        "packagingCount": {
          "description": "Count of packaging materials (Mandatory when transporting hazardous waste)",
          "minimum": 0,
          "type": "integer"
        },
        "packagingMaterial": {
          "description": "Kind of package (Mandatory when transporting hazardous waste)",
          "type": "string"
        },
        "physicalProperties": {
          "description": "Physical characteristics (Mandatory when transporting hazardous waste)",
          "type": "string"
        },
        "treatmentCode": {
          "items": {
            "$ref": "#/definitions/TreatmentCode"
          },
          "type": "array"
        },
        "treatmentType": {
          "description": "Kind of treatment (Mandatory when transporting hazardous waste)",
          "type": "string"
        },
        "wasteId": {
          "description": "Unique identification of the Waste",
          "format": "uuid",
          "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$",
          "type": "string"
        },
        "weight": {
          "$ref": "#/definitions/Weight",
          "description": "Quantity and unit of waste. Mandatory on final version of the form"
        }
      },
      "required": [
        "description",
        "euralCode",
        "treatmentCode",
        "wasteId"
      ],
      "type": "object"
    },
    "WasteProducer": {
      "description": "If the producer draws up the form, i.e. makes the arrangements for the transport itself, no IHM must be specified and the producer must sign the form.",
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "identificationNumber": {
          "$ref": "#/definitions/IdentificationNumber",
          "description": "Identification number of waste producer. Should be establishmentUnitNumber and enterpriseNumber, OR vatNumber (if international enterprise) OR seaShipIMONumber OR seaShipMMSINumber (if sea ship)"
        },
        "name": {
          "description": "Name of the waste producer",
          "type": "string"
        },
        "pickupLocation": {
          "$ref": "#/definitions/PickupLocation"
        }
      },
      "required": [
        "address",
        "identificationNumber",
        "name",
        "pickupLocation"
      ],
      "type": "object"
    },
    "Weight": {
      "description": "Weight of the waste, can be initially in tons, kilograms, cubic meters, liters or a number of items, but has to be in tons and kilograms on the final document.",
      "properties": {
        "quantity": {
          "description": "Quantity of waste.",
          "minimum": 0,
          "type": "number"
        },
        "unit": {
          "$ref": "#/definitions/Unit",
          "description": "Unit of the waste quantity. Can be ton, kg, m3, l or number. Has to be in tons and kilograms on the final document."
        }
      },
      "required": [
        "quantity",
        "unit"
      ],
      "type": "object"
    }
  }
}