{
  "$schema": "http://json-schema.org/schema#",
  "definitions": {
    "contact": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the contact person."
        },
        "emailDetails": {
          "type": [
            "array",
            "null"
          ],
          "description": "List of e-mail addresses.",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "normal"
                ]
              },
              "value": {
                "type": "string",
                "description": "E-mail address."
              }
            },
            "required": [
              "type",
              "value"
            ]
          }
        },
        "telephoneDetails": {
          "type": [
            "array",
            "null"
          ],
          "description": "List of phone numbers.",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "normal"
                ]
              },
              "value": {
                "type": "string",
                "description": "Phone number."
              }
            },
            "required": [
              "type",
              "value"
            ]
          }
        },
        "faxNumber": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "address": {
      "properties": {
        "locationCode": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 35,
          "description": "Only to be used if the location is an airport, in whcih case it should be the IATA code."
        },
        "name1": {
          "type": "string"
        },
        "line1": {
          "type": "string",
          "description": "Street name and number."
        },
        "city": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "countryName": {
          "type": [
            "string",
            "null"
          ]
        },
        "countryCode": {
          "type": "string",
          "maxLength": 2,
          "pattern": "^[A-Z]{2}$",
          "description": "ISO Alpha-2 (https://www.nationsonline.org/oneworld/country_code_list.htm) country code."
        },
        "longitude": {
          "type": [
            "number",
            "null"
          ]
        },
        "latitude": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "required": [
        "postalCode",
        "name1",
        "line1",
        "city",
        "countryCode"
      ]
    },
    "party": {
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "number": {
          "type": [
            "string",
            "null"
          ],
          "description": "Jan de Rijk relation number."
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Jan de Rijk address code."
        },
        "address": {
          "type": "object",
          "$ref": "#/definitions/address"
        },
        "contact": {
          "type": [
            "object",
            "null"
          ],
          "$ref": "#/definitions/contact"
        },
        "remarks": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "address"
      ]
    },
    "cargoLine": {
      "properties": {
        "packageType": {
          "type": [
            "string"
          ],
          "enum": [
            "uld16Feet",
            "uld20Feet",
            "container20Feet",
            "container20FeetReefer",
            "container40Feet",
            "container45Feet",
            "container45FeetHighCube",
            "aap",
            "ake",
            "bag",
            "pallet",
            "box",
            "containerCcTag5",
            "containerCc",
            "chepEuroPallet",
            "colli",
            "chepPallet",
            "crate",
            "carton",
            "containerDc",
            "deciMeterLoadIndex",
            "airplaneEngine",
            "euroPallet",
            "oneWayPallet",
            "extention",
            "flowPallet",
            "container40FeetHighCube",
            "helicopter",
            "halfPlanePlate",
            "container40FeetReefer",
            "horizontalStack",
            "ibc",
            "industrialPallet",
            "kilograms",
            "load",
            "meterLoadIndex",
            "cubicMeter",
            "shipment",
            "batch",
            "hour",
            "week",
            "shelveLocation",
            "otherPalletType",
            "piece",
            "planePlateLoose",
            "planePlate",
            "rollContainer217LoadIndex",
            "rollContainer240LoadIndex",
            "rollContainer278LoadIndex",
            "rollContainer233LoadIndex",
            "reefer",
            "roadTrain",
            "shelves",
            "skid",
            "stack",
            "truck",
            "trailer",
            "uld",
            "wingPlate",
            "multiple"
          ]
        },
        "packageDescription": {
          "type": [
            "string",
            "null"
          ]
        },
        "measurement": {
          "type": [
            "object"
          ],
          "$ref": "#/definitions/measurement"
        },
        "goodsType": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            null,
            "airCargo",
            "airCargoPalletized",
            "alcohol",
            "aluminium",
            "beer",
            "carParts",
            "ceramics",
            "cheese",
            "chemicals",
            "chocolate",
            "cigarettes",
            "computerParts",
            "consumerElectronics",
            "cosmetics",
            "empty",
            "flowers",
            "food",
            "fruit",
            "furniture",
            "general",
            "glass",
            "householdArticles",
            "lighting",
            "liquor",
            "machines",
            "mail",
            "meat",
            "medicalEquipment",
            "motorGp",
            "nickel",
            "paint",
            "paper",
            "perishables",
            "pharmaceuticals",
            "plants",
            "plastics",
            "shoes",
            "solarPanels",
            "textile",
            "tobacco",
            "toys",
            "vegetables",
            "packingMaterials",
            "wine",
            "wood"
          ]
        },
        "goodsDescription": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 20
        }
      },
      "additionalProperties": true,
      "required": [
        "measurement",
        "packageType"
      ]
    },
    "detailLine": {
      "allOf": [
        {
          "$ref": "#/definitions/cargoLine"
        },
        {
          "properties": {
            "mark": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 35
            },
            "awb": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 35
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "goodsLine": {
      "allOf": [
        {
          "$ref": "#/definitions/cargoLine"
        },
        {
          "properties": {
            "mark": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 16
            },
            "detailLines": {
              "type": [
                "array",
                "null"
              ],
              "description": "Optional further breakdown of the goods. If used, the measurements on goods line can be omitted as in that case the sum of the detailLines will be used.",
              "items": {
                "type": "object",
                "$ref": "#/definitions/detailLine"
              }
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "measurement": {
      "properties": {
        "grossWeight": {
          "type": [
            "number",
            "null"
          ],
          "description": "Kilograms.",
          "multipleOf": 0.001
        },
        "quantity": {
          "type": "number"
        },
        "volume": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Cubic metres."
        },
        "palletPlaces": {
          "type": [
            "number",
            "null"
          ]
        },
        "volumeWeight": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Kilograms. Usually only used for air freight."
        },
        "loadIndex": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001
        }
      },
      "required": [
        "quantity"
      ]
    },
    "shipmentDateTimeWindow": {
      "properties": {
        "opening": {
          "type": "string",
          "format": "date-time",
          "description": "If time zone information is omitted, UTC is implicit."
        },
        "closing": {
          "type": "string",
          "format": "date-time",
          "description": "If time zone information is omitted, UTC is implicit."
        }
      },
      "required": [
        "opening",
        "closing"
      ]
    },
    "shipmentDateTimeWindowWithEarlyPossible": {
      "properties": {
        "opening": {
          "type": "string",
          "format": "date-time",
          "description": "If time zone information is omitted, UTC is implicit."
        },
        "closing": {
          "type": "string",
          "format": "date-time",
          "description": "If time zone information is omitted, UTC is implicit."
        },
        "earlyPossible": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "If true, the activity can be done outside the time window."
        }
      },
      "required": [
        "opening",
        "closing"
      ]
    },
    "metadata": {
      "properties": {
        "source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Our internal source system."
        },
        "messageId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique id for the message."
        },
        "messageType": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "consignment-main"
          ]
        },
        "messageRootId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique id for the message."
        },
        "timeStamp": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time the message was generated. If time zone information is omitted, is UTC."
        }
      }
    }
  },
  "type": "object",
  "properties": {
    "metadata": {
      "type": "object",
      "$ref": "#/definitions/metadata"
    },
    "consignments": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "header": {
              "type": "object",
              "properties": {
                "events": {
                  "type": [
                    "array"
                  ],
                  "description": "Event(s) that triggered this message. If multiple events happened at (alomst) the same time, they are all listed here.\nbookingCreated: Booking is created. This event will always accompany the first file you receive for a specific consignment.\nbookingUpdated: We made a change to the booking. This can occur throughout the process.\nbookingFinalized: The booking is done and will not be changed anymore.\nbookingCancelled: We cancelled the booking. it will not be executed.\ndocumentRejected: You sent a document which we haver rejected. See the 'documentResult' property for details.\ndocumentApproved: You sent a document which we have approved.\nmoreDocumentsRequired: This event accompanies 'documentApproved' if there are still more documents pending.\nbookingConfirmedChargeable: You have performed all required tasks and can now invoice the booking. Note this is the first file in which the PO number (costsAndCharges.invoiceReference) is made available.",
                  "items": {
                    "type": "string",
                    "enum": [
                      "bookingCreated",
                      "bookingUpdated",
                      "bookingFinalized",
                      "bookingCancelled",
                      "documentRejected",
                      "documentApproved",
                      "moreDocumentsRequired",
                      "bookingConfirmedChargeable"
                    ]
                  }
                },
                "id": {
                  "type": "string",
                  "description": "Unique id for the consignment. This value is required in all messages you send back to us regarding this consingment."
                },
                "businessUnitCode": {
                  "type": "string",
                  "description": "Code of the Jan de Rijk subcompany that sent the message."
                },
                "cancelled": {
                  "type": [
                    "boolean"
                  ],
                  "description": "true if the consignment is cancelled (event 'bookingCancelled' will have been sent); otherwise false."
                },
                "allTasksDone": {
                  "type": "boolean",
                  "description": "true if all tasks are done; otherwise false."
                },
                "portalUrl": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "URL to the Jan de Rijk portal where you can manage the consignment manually."
                }
              },
              "required": [
                "events",
                "id",
                "businessUnitCode",
                "cancelled",
                "allTasksDone"
              ]
            },
            "planDepartment": {
              "type": [
                "object",
                "null"
              ],
              "description": "Jan de Rijk Plan Department of the consignment.",
              "properties": {
                "name": {
                  "type": [
                    "string"
                  ]
                }
              },
              "required": [
                "name"
              ]
            },
            "charter": {
              "type": "object",
              "description": "Information regarding the charter that will handle the consignment. This means you.",
              "properties": {
                "number": {
                  "type": "string",
                  "description": "Jan de Rijk relation number."
                },
                "name": {
                  "type": "string",
                  "description": "Name of the charter as known within Jan de Rijk."
                },
                "contact": {
                  "description": "Contact details as known at Jan de Rijk.",
                  "type": [
                    "object",
                    "null"
                  ],
                  "$ref": "#/definitions/contact"
                },
                "code": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Jan de Rijk charter code."
                }
              },
              "required": [
                "number",
                "name"
              ]
            },
            "costsAndCharges": {
              "type": "array",
              "description": "Agreed costs and charges for the consignment.",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Amount in the 'currencyCode' currency."
                    },
                    "currencyCode": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "minLength": 3,
                      "maxLength": 3,
                      "description": "ISO currency code."
                    },
                    "invoiceReference": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "PO number. This reference is mandatory on any invoices regarding the consignment. Is be omitted from all files untill all task regarding the consignment are done."
                    }
                  }
                }
              ]
            },
            "activities": {
              "type": "array",
              "description": "The transportation activities required for the consignment.",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique id for the activity. This value is required in all messages you send back to us regarding specifically this activity."
                    },
                    "sequenceNumber": {
                      "type": "integer",
                      "description": "Sequence id of the activity within the consignment."
                    },
                    "type": {
                      "type": "string",
                      "description": "Short description of the activity. Info TBD. Also to check if it makes sense for all of these they are on consignments.",
                      "enum": [
                        "loading",
                        "unloading",
                        "startConnection",
                        "endConnection",
                        "mounting",
                        "dismounting",
                        "waypoint",
                        "clearing",
                        "cancelled",
                        "containerPickUp",
                        "containerDropOff",
                        "customsScan",
                        "clearingIn",
                        "clearingOut",
                        "gasMeasurement"
                      ]
                    },
                    "connection": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Details of the connection.",
                      "properties": {
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "voucherNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "party": {
                      "type": "object",
                      "$ref": "#/definitions/party"
                    },
                    "dateTimes": {
                      "type": "object",
                      "properties": {
                        "start": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The (expected) start date/time of the activity. If time zone information is omitted, UTC is implicit."
                        },
                        "end": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The (expected) end date/time of the activity. If time zone information is omitted, UTC is implicit."
                        },
                        "opening": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The opening date/time of the location of the activity. If time zone information is omitted, UTC is implicit."
                        },
                        "closing": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The closing date/time of the location of the activity. If time zone information is omitted, UTC is implicit."
                        }
                      },
                      "required": [
                        "start",
                        "end",
                        "opening",
                        "closing"
                      ]
                    },
                    "pulledUnit": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The relevant trailer.",
                      "properties": {
                        "number": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Jan de Rijk number of the pulled unit. This is only filled in if the pulled unit is a Jan de Rijk unit."
                        },
                        "preDefined": {
                          "type": "boolean",
                          "description": "true if the pulled unit is a Jan de Rijk unit, false if it is not."
                        },
                        "licensePlate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "mounted": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Only present for activity type 'mounting'. Indicates this pulled unit is what is mounted."
                        },
                        "dismounted": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Only present for activity type 'dismounting'. Indicates this pulled unit is what is dismounted."
                        }
                      },
                      "required": [
                        "preDefined"
                      ]
                    },
                    "freightUnits": {
                      "type": "array",
                      "items": [
                        {
                          "type": [
                            "object"
                          ],
                          "description": "Trailer, container, or another unit of freight.",
                          "properties": {
                            "number": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Jan de Rijk number of the freight unit. This is only filled in if the freight unit is a Jan de Rijk unit."
                            },
                            "reference": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Meaning depends on the type of freight unit. For instance the container number."
                            },
                            "mounted": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "description": "Only present for activity type 'mounting'. Indicates this freight unit is what is mounted."
                            },
                            "dismounted": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "description": "Only present for activity type 'dismounting'. Indicates this freight unit is what is dismounted."
                            }
                          }
                        }
                      ]
                    },
                    "shipmentNumbers": {
                      "type": "array",
                      "items": [
                        {
                          "type": "string",
                          "description": "Shipment numbers connected to the activity. These refer to the relevent items in the 'shipments' array later in this file."
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "sequenceNumber",
                    "type",
                    "party",
                    "dateTimes",
                    "shipmentNumbers"
                  ]
                }
              ]
            },
            "shipments": {
              "type": [
                "array",
                "null"
              ],
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "number": {
                      "type": "string",
                      "description": "Jan de Rijk number of the shipment."
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "departmentCode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Jan de Rijk department code of the shipment."
                        },
                        "product": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Jan de Rijk product of the shipment."
                        }
                      },
                      "oneOf": [
                        {
                          "required": [
                            "departmentCode"
                          ]
                        },
                        {
                          "required": [
                            "product"
                          ]
                        }
                      ]
                    },
                    "creationDateTime": {
                      "type": "string",
                      "format": "date-time",
                      "description": "If time zone information is omitted, UTC is implicit."
                    },
                    "reference": {
                      "type": "string",
                      "maxLength": 30,
                      "description": "Customer's reference for the shipment. This is the reference that would be used to refer to the order in any communication between the original customer and Jan de Rijk."
                    },
                    "unmountingActivityId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requirements": {
                      "type": "object",
                      "description": "Special requirements relating to the shipment.",
                      "properties": {
                        "freightUnitType": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            null,
                            "flatBox",
                            "box",
                            "isolation",
                            "tautliner",
                            "semiLowloader",
                            "lowloader",
                            "container",
                            "chassis",
                            "walkingFloor",
                            "unspecified"
                          ]
                        },
                        "roadTrain": {
                          "type": "boolean"
                        },
                        "walkingFloor": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "mega": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "taillift": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "crane": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "kooiaap": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "palletTruck": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "reefer": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "doubleFloor": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "dangerousCargo": {
                          "type": "boolean",
                          "description": "This means LZV (longer truck)."
                        },
                        "urgent": {
                          "type": "boolean"
                        },
                        "heater": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "cooler": {
                          "type": "boolean"
                        },
                        "palletSwap": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "gdp": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "exclusive": {
                          "type": "boolean",
                          "description": "If true, Jan de Rijk won't co-load the cargo with other customers' cargo. Co-loading regulations are taken into account regardless."
                        },
                        "timeCriticalLoading": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "timeCriticalUnloading": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "customsDocument": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "chassisTypes": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "customsDocumentTypes": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "maximumTemperature": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "minimumTemperature": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "temperatureSetPoint": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "pharmaceuticals": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "It concerns pharmaceutical cargo, and all requirements for that apply."
                        },
                        "secondDriver": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "The truck should be double manned."
                        },
                        "standBy": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Reserve capacity for last minute order updates."
                        }
                      },
                      "required": [
                        "roadTrain",
                        "dangerousCargo",
                        "urgent",
                        "cooler",
                        "exclusive"
                      ]
                    },
                    "security": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Can be used to specify security above the standard security level of TSR 01. The actual security level is explained in the SOP and arranged by the Jan de Rijk planning team.",
                      "properties": {
                        "secured": {
                          "type": "boolean"
                        },
                        "level": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            null,
                            "TAPA1",
                            "TAPA2"
                          ]
                        }
                      },
                      "required": [
                        "secured"
                      ]
                    },
                    "transportInstructions": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "generalInstructions": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "measurement": {
                      "type": "object",
                      "$ref": "#/definitions/measurement"
                    },
                    "goodsLines": {
                      "type": "array",
                      "items": [
                        {
                          "type": "object",
                          "$ref": "#/definitions/goodsLine"
                        }
                      ]
                    },
                    "remarks": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "originalLoading": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Details of the first loading activity for this shipment.",
                      "properties": {
                        "party": {
                          "type": "object",
                          "$ref": "#/definitions/party"
                        },
                        "dateTimes": {
                          "type": "object",
                          "$ref": "#/definitions/shipmentDateTimeWindow"
                        },
                        "reference": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "dateTimes",
                        "party"
                      ]
                    },
                    "finalUnloading": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Details of the last unloading activity for this shipment.",
                      "properties": {
                        "party": {
                          "type": "object",
                          "$ref": "#/definitions/party"
                        },
                        "dateTimes": {
                          "type": "object",
                          "$ref": "#/definitions/shipmentDateTimeWindowWithEarlyPossible"
                        },
                        "reference": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "dateTimes",
                        "party"
                      ]
                    },
                    "containerPickUp": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Details of the container pickup activity for this shipment.",
                      "properties": {
                        "party": {
                          "type": "object",
                          "$ref": "#/definitions/party"
                        },
                        "dateTimes": {
                          "type": "object",
                          "$ref": "#/definitions/shipmentDateTimeWindow"
                        },
                        "reference": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "dateTimes",
                        "party"
                      ]
                    },
                    "containerDropOff": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Details of the container drop off activity for this shipment.",
                      "properties": {
                        "party": {
                          "type": "object",
                          "$ref": "#/definitions/party"
                        },
                        "dateTimes": {
                          "type": "object",
                          "$ref": "#/definitions/shipmentDateTimeWindowWithEarlyPossible"
                        },
                        "reference": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "dateTimes",
                        "party"
                      ]
                    },
                    "clearingIn": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Details of the clearing in activity for this shipment.",
                      "properties": {
                        "party": {
                          "type": "object",
                          "$ref": "#/definitions/party"
                        }
                      },
                      "required": [
                        "party"
                      ]
                    },
                    "clearingOut": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Details of the clearing out activity for this shipment.",
                      "properties": {
                        "party": {
                          "type": "object",
                          "$ref": "#/definitions/party"
                        }
                      },
                      "required": [
                        "party"
                      ]
                    },
                    "container": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Details of the container for this shipment.",
                      "properties": {
                        "number": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ISO 6346 container number."
                        },
                        "type": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ISO 6346 container type."
                        }
                      }
                    }
                  },
                  "required": [
                    "number",
                    "order",
                    "reference",
                    "requirements",
                    "measurement",
                    "goodsLines",
                    "creationDateTime"
                  ],
                  "oneOf": [
                    {
                      "description": "Standard shipment",
                      "required": [
                        "originalLoading",
                        "finalUnloading"
                      ]
                    },
                    {
                      "description": "Container export",
                      "required": [
                        "containerPickUp",
                        "originalLoading",
                        "containerDropOff"
                      ]
                    },
                    {
                      "description": "Container import",
                      "required": [
                        "containerPickUp",
                        "finalUnloading",
                        "containerDropOff"
                      ]
                    }
                  ]
                }
              ]
            },
            "vehicle": {
              "type": "object",
              "properties": {
                "licensePlate": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            },
            "pulledUnit": {
              "type": "object",
              "description": "The first trailer used in the consignment.",
              "properties": {
                "number": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Jan de Rijk number of the pulled unit. This is only filled in if the pulled unit is a Jan de Rijk unit."
                },
                "preDefined": {
                  "type": "boolean",
                  "description": "true if the pulled unit is a Jan de Rijk unit, false if it is not."
                },
                "licensePlate": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "preDefined"
              ]
            },
            "tasks": {
              "type": "array",
              "description": "Administrative tasks that need to be performed by the charter. Note all required tasks need to be done before the consignment can be invoiced.",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "acceptConsignment: Accept the execution of the consignment via the 'accepted' property of the event message.\n\nrejectConsignment: Indicates the consignment was rejected. Usually not used.\n\nvehicleLicensePlate: Send the license plate of the truck that will be used for the consignment, via the 'vehicle' property of the event message.\n\ndriverName: Send the driver name of the driver that will execute the consignment, via the 'drivers' property of the event message.\n\npulledUnitLicensePlate: Send the license plate of the trailer that will be used for the consignment, via the 'pulledUnit' property of the event message. This is only required for consignments without a predefined Jan de Rijk trailer.\n\narrivalMilestone: Provide the date you arrived at an activity location, via the 'arrived' property of the event message. This is usually not required.\n\nstartMilestone: Provide the date an activity started, via the 'start' property of the event message. This is required for each activity in the consignment.\n\nendMilestone: Provide the date an activity ended, via the 'end' property of the event message. This is required for each activity in the consignment.\n\napprovedDocument: Provide a specific document. Usually some form of proof of delivery is required for each unloading activity in the consignment, and each shipment unloaded there must be mentioned.\n\nfinalPriceConfirmation: This task is completed by Jan de Rijk once the price is agreed.",
                      "enum": [
                        "acceptConsignment",
                        "rejectConsignment",
                        "vehicleLicensePlate",
                        "driverName",
                        "pulledUnitLicensePlate",
                        "arrivalMilestone",
                        "startMilestone",
                        "endMilestone",
                        "approvedDocument",
                        "finalPriceConfirmation"
                      ]
                    },
                    "sequenceNumber": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Sequence number if the task can be done multiple times. For instance, this can be '2' when referring to the second driver for a 'driverName' task."
                    },
                    "value": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Relevant value for the task. For instance, the delivered license plate of the truck for a 'vehicleLicensePlate' task."
                    },
                    "completedDateTime": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "Date and time the task was completed. If time zone information is omitted, UTC is implicit. null if the task is open."
                    },
                    "required": {
                      "type": "boolean",
                      "description": "true if the task is required, false if it is optional."
                    }
                  },
                  "required": [
                    "type",
                    "required"
                  ]
                }
              ]
            },
            "documentResult": {
              "type": [
                "object",
                "null"
              ],
              "description": "Result of our internal document validation process. This is only and always present if for events 'documentRejected' and 'documentApproved'.",
              "properties": {
                "activityId": {
                  "type": [
                    "string"
                  ],
                  "description": "Id of the activity for which the document was sent."
                },
                "sentForShipmentNumbers": {
                  "type": "array",
                  "description": "Shipment numbers for which the document was sent.",
                  "items": [
                    {
                      "type": "string"
                    }
                  ]
                },
                "sufficientForShipmentNumbers": {
                  "type": "array",
                  "description": "Shipment numbers for which the document meets the requirements. If for instance a shipment requires a CMR but a manifest is sent instead, that shipment number will not show up in this array. This array will be empty for documents not deemed 'ok'.",
                  "items": [
                    {
                      "type": "string"
                    }
                  ]
                },
                "id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Your identifier for the document. This is the value you provided as document id in your original event message to us."
                },
                "hash": {
                  "type": "string",
                  "description": "SHA-256 hash of the original document, in base 64 format."
                },
                "isOk": {
                  "type": "boolean",
                  "description": "true if the document was found to be ok, false if it is not."
                },
                "documentType": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Type of the document. Note this is determined by us after review of the document, it does not have to match the type you used when sending the document. This will be null for any document we deemed not to be OK.",
                  "enum": [
                    "cmr",
                    "manifest",
                    null
                  ]
                },
                "result": {
                  "type": "string",
                  "description": "Result code of the document validation process. Note autoOk, aiOk, ok and imageIsRotated are considered 'correct' results. Others are considered incorrect and will require a better version of the document to be delivered.",
                  "enum": [
                    "autoOk",
                    "aiOk",
                    "ok",
                    "aiRejected",
                    "emptyFile",
                    "duplicateFile",
                    "invalidFileFormat",
                    "incorrectDocumentType",
                    "imageIsRotated",
                    "unreadable",
                    "incorrectData",
                    "missingData",
                    "invalidShipments",
                    "unspecifiedShipments"
                  ]
                },
                "resultText": {
                  "type": "string",
                  "description": "Text indicating the result of the document."
                }
              },
              "required": [
                "activityId",
                "sentForShipmentNumbers",
                "sufficientForShipmentNumbers",
                "hash",
                "result",
                "resultText",
                "isOk"
              ]
            }
          },
          "required": [
            "header",
            "charter",
            "costsAndCharges",
            "activities",
            "vehicle",
            "pulledUnit",
            "tasks"
          ]
        }
      ]
    },
    "$schema": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Url to the schema used for validation. This can be filled in to let certain editors validate the contents based on the schema. The integration setup will ignore it. Possible values are the schema links a the top of the documentation page."
    }
  },
  "required": [
    "metadata",
    "consignments"
  ]
}