{
  "$schema": "http://json-schema.org/schema#",
  "definitions": {
    "costAndCharge": {
      "description": "To be provided if there are no price agreements.",
      "properties": {
        "code": {
          "type": "string",
          "maxLength": 4,
          "description": "\"100\" should be used unless otherwise discussed."
        },
        "currencyCode": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3,
          "description": "ISO currency code."
        },
        "amount": {
          "type": "number",
          "description": "Amount in the 'currencyCode' currency."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "This field is currently not imported but can be sent to provide more details on the cost."
        }
      },
      "required": [
        "code",
        "currencyCode",
        "amount"
      ]
    },
    "measurement": {
      "properties": {
        "grossWeight": {
          "type": [
            "number",
            "null"
          ],
          "description": "Kilograms.",
          "multipleOf": 0.001
        },
        "chargeableWeight": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Kilograms."
        },
        "quantity": {
          "type": "integer"
        },
        "volume": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Cubic metres."
        },
        "volumeWeight": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Kilograms. Usually only used for air freight."
        },
        "loadIndex": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001
        }
      },
      "required": [
        "quantity"
      ]
    },
    "dimensions": {
      "properties": {
        "length": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Metres."
        },
        "width": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Metres."
        },
        "height": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Metres."
        }
      }
    },
    "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"
          ]
        },
        "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"
              ],
              "pattern": "^(([0-9]{11})|([0-9]{3}[-][0-9]{8}))$",
              "maxLength": 12
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "goodsLine": {
      "allOf": [
        {
          "$ref": "#/definitions/cargoLine"
        },
        {
          "properties": {
            "mark": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 16
            },
            "dimensions": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/dimensions"
            },
            "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"
              }
            },
            "dangerousGoods": {
              "type": "array",
              "maxItems": 1,
              "items": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "maxLength": 4,
                    "pattern": "^[0-9]{1,4}$",
                    "description": "UN code."
                  },
                  "suffix": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 3,
                    "pattern": "^[0-9]{1,3}$"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "address": {
      "properties": {
        "locationCode": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 5,
          "description": "Only to be used if the location is an airport, in whcih case it should be the IATA code."
        },
        "name1": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 35
        },
        "name2": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 35
        },
        "name3": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 35
        },
        "line1": {
          "type": [
            "string"
          ],
          "maxLength": 35,
          "description": "Street name and number."
        },
        "line2": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 35
        },
        "line3": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 35
        },
        "city": {
          "type": "string",
          "maxLength": 35
        },
        "postalCode": {
          "type": "string",
          "maxLength": 10
        },
        "countryCode": {
          "type": [
            "string",
            "null"
          ],
          "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",
        "line1"
      ]
    },
    "party": {
      "description": "Party (location) information can be given in different ways, to be discussed with the customer prior to the implementation of the integration setup.",
      "oneOf": [
        {
          "title": "Customer's code with translation by Jan de Rijk",
          "description": "When the party is in Jan de Rijk master data including the code that the customer uses for the address, the customer can provide their own code. When Jan de Rijk does not recognize new codes, the order ends up in a waiting table since it is rejected. The system will be updated manually with the customer's reference and master data by our customer service, ahead of accepting the order. Both parties need to make sure to have agreed a procedure around newly generated codes.",
          "properties": {
            "searchCode": {
              "type": "string",
              "maxLength": 50,
              "description": "Customer's code of an existing address in Jan de Rijk system."
            }
          },
          "required": [
            "searchCode"
          ],
          "additionalProperties": false
        },
        {
          "title": "Full address",
          "description": "When the party is not necessarily in Jan de Rijk master data, the customer can provide the whole address. The party will be created/updated at Jan de Rijk automatically.",
          "properties": {
            "address": {
              "type": "object",
              "$ref": "#/definitions/address"
            }
          },
          "required": [
            "address"
          ],
          "additionalProperties": false
        }
      ]
    },
    "dateTimeWindow": {
      "oneOf": [
        {
          "properties": {
            "opening": {
              "type": "string",
              "format": "date-time",
              "description": "If time zone information is omitted, UTC is implicit."
            },
            "closing": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "If time zone information is omitted, UTC is implicit."
            }
          },
          "required": [
            "opening"
          ]
        },
        {
          "title": "Unknown window",
          "properties": {
            "date": {
              "type": "string",
              "format": "date"
            }
          },
          "required": [
            "date"
          ]
        }
      ]
    },
    "dateTimeWindowWithEarlyPossible": {
      "oneOf": [
        {
          "properties": {
            "opening": {
              "type": "string",
              "format": "date-time",
              "description": "If time zone information is omitted, UTC is implicit."
            },
            "closing": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "If time zone information is omitted, UTC is implicit."
            },
            "earlyPossible": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "If true, Jan de Rijk can pick-up the cargo outside the time window."
            }
          },
          "required": [
            "opening"
          ]
        },
        {
          "title": "Unknown window",
          "properties": {
            "date": {
              "type": "string",
              "format": "date"
            }
          },
          "required": [
            "date"
          ]
        }
      ]
    },
    "metadata": {
      "properties": {
        "source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Source system or customer code."
        },
        "messageId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique id for the message."
        },
        "messageReference": {
          "type": [
            "string",
            "null"
          ],
          "description": "Customer reference for the message."
        },
        "messageType": {
          "type": [
            "string",
            "null"
          ],
          "description": "Type name of the message."
        },
        "messageRootId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Message id of the first message in a chain of messages."
        },
        "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",
        "null"
      ],
      "allOf": [
        {
          "$ref": "#/definitions/metadata"
        },
        {
          "properties": {
            "providerEmail": {
              "type": [
                "string",
                "null"
              ],
              "format": "email",
              "description": "E-mail address of the person or group providing the data. If specified, a technical acknowledgement message is sent for each involved order after it is imported into the TMS."
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "orders": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "maxLength": 30,
            "description": "Customer's reference for the order. This is the reference that would be used to refer to the order in any communication between the customer and Jan de Rijk."
          },
          "ediReference": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 27,
            "description": "Customer unique id for the order. If a message is received with a previously used ediReference, it will be seen as an update of that order. It can be omitted but then it will not be possible to update the order via EDI."
          },
          "cancelMessage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only applicable if 'cancelled' is 'true'. A message to our Customer Service as to e.g. why the order is cancelled."
          },
          "invoiceReference": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Used as purchase order reference for invoicing and accounting."
          },
          "departmentCode": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{3}$",
            "maxLength": 3,
            "description": "The code of the Jan de Rijk department that should handle the order. Usually a fixed value that can be provided at the start of the integration project. Either this property or 'product' must be present.",
            "enum": [
              "100",
              "102",
              "104",
              "105",
              "130",
              "140",
              "150",
              "151",
              "155",
              "160",
              "166",
              "176",
              "177",
              "178",
              "180",
              "181",
              "185",
              "189",
              "190",
              "192",
              "200",
              "201",
              "210",
              "220",
              "287",
              "289",
              "400",
              "411",
              "412",
              "500",
              "514",
              "515",
              "533",
              "550",
              "600",
              "602",
              "610",
              "615",
              "620",
              "630",
              "640",
              "650",
              "700",
              "705",
              "710",
              "715",
              "720",
              "725",
              "830",
              "850",
              "870",
              "909",
              "910",
              "950",
              "961",
              "983",
              "985",
              "987",
              "990",
              "991",
              "994",
              "996",
              "997",
              "998",
              null
            ]
          },
          "product": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "generalCargo",
              "importContainers",
              "exportContainers",
              null
            ],
            "description": "The relevant Jan de Rijk product. Usually a fixed value that can be provided at the start of the integration project. Either this property or 'departmentCode' must be present."
          },
          "customer": {
            "type": "object",
            "oneOf": [
              {
                "title": "Number",
                "properties": {
                  "number": {
                    "type": "string",
                    "pattern": "^[0-9]{6}$",
                    "maxLength": 6,
                    "description": "Jan de Rijk number for the customer. The customer will be informed of their own number on request or as part of an integration project."
                  }
                },
                "required": [
                  "number"
                ]
              },
              {
                "title": "Code",
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^.*\\D.*$",
                    "maxLength": 20,
                    "description": "Jan de Rijk code for the customer. The customer will be informed of their own code on request or as part of an integration project."
                  }
                },
                "required": [
                  "code"
                ]
              }
            ]
          },
          "tariffType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Used when there are price agreements. Should be omitted (or null) unless a value was specifically agreed upon with the Jan de Rijk sales department.",
            "enum": [
              null,
              "normal",
              "bpRate",
              "combi",
              "kilometer",
              "mega",
              "normal2",
              "normal3",
              "noInvoice",
              "route3",
              "adHoc",
              "loadIndex",
              "fullTruckLoad",
              "trailer",
              "extra",
              "timeFrame2",
              "timeFrame3",
              "fast",
              "timeFrame1",
              "pallets",
              "route1",
              "grossWeight",
              "lineHaul",
              "route2",
              "roundTrip",
              "motorcar"
            ]
          },
          "breakCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "An additional invoice code in case the customer wants to split the invoices by those codes. To be discussed with Jan de Rijk finance department before use."
          },
          "customsDocumentType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "-EU",
              "AAD",
              "ADM",
              "AGD",
              "CIM",
              "CLE",
              "COM",
              "D11",
              "DOS",
              "DVZ",
              "EUA",
              "EX3",
              "EXA",
              "EXD",
              "IM4",
              "IMA",
              "IMP",
              "ITR",
              "LVM",
              "REF",
              "RVM",
              "SAG",
              "SFD",
              "T-1",
              "T-2",
              "T2F",
              "TIR",
              "TPR",
              "VRY"
            ],
            "description": "The relevant customs document type."
          },
          "extraStops": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The relevant number of extra stops. To be discussed with Jan de Rijk finance department before use."
          },
          "costsAndCharges": {
            "type": "array",
            "items": {
              "type": "object",
              "$ref": "#/definitions/costAndCharge"
            }
          },
          "shipments": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "description": "Most orders will only have a single shipment. But it can also be that multiple shipments are combined in one order, two examples:\n\nFirst, multiple shipments on one address that require a separate invoice, or are a consolidation of multiple items at customer end.\n\nSecond, shipments that require load/unload in multiple locations.",
              "minItems": 1,
              "properties": {
                "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 customer and Jan de Rijk. This reference also appears on invoices and status messages, and is searchable in JConnect."
                },
                "ediReference": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 27,
                  "description": "Your unique id for the shipment. If a message is received with a previously used ediReference, it will be seen as an update of that shipment."
                },
                "bondedGoodsNumber": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tariffType": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Used when there are price agreements. Should be omitted (or null) unless a value was specifically agreed upon with the Jan de Rijk sales department.",
                  "enum": [
                    null,
                    "normal",
                    "bpRate",
                    "combi",
                    "kilometer",
                    "mega",
                    "normal2",
                    "normal3",
                    "noInvoice",
                    "route3",
                    "adHoc",
                    "loadIndex",
                    "fullTruckLoad",
                    "trailer",
                    "extra",
                    "timeFrame2",
                    "timeFrame3",
                    "fast",
                    "timeFrame1",
                    "pallets",
                    "route1",
                    "grossWeight",
                    "lineHaul",
                    "route2",
                    "roundTrip",
                    "motorcar"
                  ]
                },
                "breakCode": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "An additional invoice code in case the customer wants to split the invoices by those codes. To be discussed with Jan de Rijk finance department before use."
                },
                "customsDocumentType": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    null,
                    "-EU",
                    "AAD",
                    "ADM",
                    "AGD",
                    "CIM",
                    "CLE",
                    "COM",
                    "D11",
                    "DOS",
                    "DVZ",
                    "EUA",
                    "EX3",
                    "EXA",
                    "EXD",
                    "IM4",
                    "IMA",
                    "IMP",
                    "ITR",
                    "LVM",
                    "REF",
                    "RVM",
                    "SAG",
                    "SFD",
                    "T-1",
                    "T-2",
                    "T2F",
                    "TIR",
                    "TPR",
                    "VRY"
                  ],
                  "description": "The relevant customs document type."
                },
                "invoiceReference": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 30,
                  "description": "Used as purchase order reference for invoicing and accounting."
                },
                "financeRemarks": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "extraStops": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The relevant number of extra stops. To be discussed with Jan de Rijk finance department before use."
                },
                "forecast": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "True if the booking is a forecast, false if it is a final booking. Updates with forecast = true will not replace any shipment data for which a forecast = false message was already received."
                },
                "ecmr": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "required": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "provider": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "requirements": {
                  "type": "object",
                  "description": "Special requirements relating to the shipment. The requested requirements should match the SOP agreements and tariffs, and might have an impact on pricing.\nOmitting a requirement indicates it is not applicable.",
                  "properties": {
                    "freightUnitType": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        null,
                        "flat",
                        "flatBox",
                        "box",
                        "isolation",
                        "tautliner",
                        "unspecified"
                      ],
                      "description": "Can be omitted as long as cargo arrives in good condition."
                    },
                    "mega": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "roadTrain": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "This means LZV (longer truck). It can only be selected when it is agreed in the SOP for a certain line."
                    },
                    "dangerousCargo": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "urgent": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "heater": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "cooler": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "exclusive": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "If true, Jan de Rijk won't have the possibility to co-load the cargo with other customers' cargo. Co-loading regulations are taken into account regardless."
                    },
                    "maximumTemperature": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "minimumTemperature": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "palletSwap": {
                      "type": [
                        "boolean",
                        "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."
                    }
                  }
                },
                "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"
                  ]
                },
                "airFreightExport": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Specifies if the cargo will be transferred to a plane (to be flown to a further destination) on unloading."
                },
                "transportInstructions": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "ediRemarks": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "planningInstructions": {
                  "type": "string"
                },
                "goodsLines": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "$ref": "#/definitions/goodsLine"
                  }
                },
                "customerData": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "Additional customer specific data. Can be any valid JSON object.",
                  "additionalProperties": true
                },
                "clearingIn": {
                  "type": "object",
                  "properties": {
                    "party": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "$ref": "#/definitions/party"
                    }
                  }
                },
                "consignee": {
                  "type": "object",
                  "properties": {
                    "party": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "$ref": "#/definitions/party"
                    }
                  }
                },
                "originalLoading": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "party": {
                      "type": "object",
                      "$ref": "#/definitions/party"
                    },
                    "dateTimes": {
                      "type": "object",
                      "$ref": "#/definitions/dateTimeWindow"
                    },
                    "reference": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "dateTimes",
                    "party"
                  ]
                },
                "finalUnloading": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "party": {
                      "type": "object",
                      "$ref": "#/definitions/party"
                    },
                    "dateTimes": {
                      "type": "object",
                      "$ref": "#/definitions/dateTimeWindowWithEarlyPossible"
                    },
                    "reference": {
                      "type": "string"
                    },
                    "slotBooking": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "contact": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 30
                            },
                            "mail": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 60
                            },
                            "phone": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 30
                            }
                          }
                        }
                      },
                      "required": [
                        "contact"
                      ]
                    }
                  },
                  "required": [
                    "dateTimes",
                    "party"
                  ]
                },
                "containerPickUp": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "party": {
                      "type": "object",
                      "$ref": "#/definitions/party"
                    },
                    "dateTimes": {
                      "type": "object",
                      "$ref": "#/definitions/dateTimeWindow"
                    },
                    "reference": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "dateTimes",
                    "party"
                  ]
                },
                "containerDropOff": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "party": {
                      "type": "object",
                      "$ref": "#/definitions/party"
                    },
                    "dateTimes": {
                      "type": "object",
                      "$ref": "#/definitions/dateTimeWindowWithEarlyPossible"
                    },
                    "reference": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "dateTimes",
                    "party"
                  ]
                }
              },
              "required": [
                "reference",
                "goodsLines"
              ],
              "oneOf": [
                {
                  "description": "Standard shipment",
                  "required": [
                    "originalLoading",
                    "finalUnloading"
                  ]
                },
                {
                  "description": "Container export",
                  "required": [
                    "containerPickUp",
                    "originalLoading",
                    "containerDropOff"
                  ]
                },
                {
                  "description": "Container import",
                  "required": [
                    "containerPickUp",
                    "finalUnloading",
                    "containerDropOff"
                  ]
                }
              ]
            }
          }
        },
        "required": [
          "reference",
          "customer",
          "shipments"
        ],
        "oneOf": [
          {
            "required": [
              "departmentCode"
            ]
          },
          {
            "required": [
              "product"
            ]
          }
        ]
      }
    },
    "$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": [
    "orders"
  ]
}