{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/freightutils-com/json-schema/freightutils-com-consignment-request-schema.json",
  "title": "ConsignmentRequest",
  "description": "The consignment object alone, instead of this tool's own inputs: same result as the equivalent request. A needed field it lacks is a 400 MISSING_INPUT naming the path in missing_inputs (\"lines[0].dims\"); unread fields are listed in normalized_input.consignment.not_read.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/freightutils-com-composite-api-openapi.yml#/components/schemas/ConsignmentRequest",
  "type": "object",
  "required": [
    "consignment"
  ],
  "additionalProperties": false,
  "properties": {
    "consignment": {
      "$ref": "#/$defs/ConsignmentObject"
    }
  },
  "$defs": {
    "ConsignmentObject": {
      "title": "FreightUtils consignment object v1",
      "description": "The consignment object (consignment-object.v1): lines[] (required), journey, vehicle, options. The consignment argument of consignment_calculator, shipment_summary and adr_exemption_calculator; the body of POST /api/adr/consignment-check; validated by POST /api/validate. No parties.",
      "type": "object",
      "properties": {
        "lines": {
          "minItems": 1,
          "maxItems": 50,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "description": {
                "description": "What the line is, at most 200 characters.",
                "type": "string",
                "maxLength": 200
              },
              "un_number": {
                "description": "UN number of a dangerous-goods line, or an ID-prefixed air-only number (\"ID 8000\").",
                "type": "string",
                "pattern": "^(?:(?:UN\\s?)?\\d{4}|ID\\s?\\d{4})$"
              },
              "packing_group": {
                "description": "Packing group, to pin one ADR Table A row of a multi-row UN.",
                "type": "string",
                "enum": [
                  "I",
                  "II",
                  "III"
                ]
              },
              "variant_index": {
                "description": "ADR Table A variant index (as adr_lookup returns it), to pin one row.",
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "quantity": {
                "description": "The dangerous-goods quantity (ADR 1.1.3.6.3), separate from the gross mass of the packages.",
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000000,
                    "description": "The dangerous-goods quantity for the whole line, all packages together. 0 = the goods are not carried (the line is left out of the 1.1.3.6 count and named in a warning)."
                  },
                  "unit": {
                    "description": "\"L\" or \"kg\" — checked against the dimension ADR 1.1.3.6.3 counts for the row.",
                    "type": "string",
                    "enum": [
                      "L",
                      "kg"
                    ]
                  },
                  "basis": {
                    "description": "\"net\" (the goods) or \"gross\" (with packaging). 1.1.3.6.3 counts net; a gross figure scores no points.",
                    "type": "string",
                    "enum": [
                      "net",
                      "gross"
                    ]
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              "packages": {
                "description": "The pieces: how many, of what type, and their total gross mass.",
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 100000,
                    "description": "Number of identical packages (pieces) on the line."
                  },
                  "type": {
                    "description": "Package type, e.g. \"pallet\", \"drum\", \"carton\".",
                    "type": "string",
                    "maxLength": 40
                  },
                  "gross_kg": {
                    "description": "Gross mass of ALL the line's packages together, in kg.",
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000000
                  },
                  "un_mark": {
                    "description": "UN packaging mark as printed (ADR 6.1.3.1), e.g. \"UN 4G/Y145/S/02/NL/VL823\": (a) the symbol, (b) the 6.1.2.7 code, (c) the packing-group letter X / Y / Z and density or mass, (d) S or test pressure, (e) the year, (f) the State, (g) the maker; the letter is held against the line's packing group.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "count"
                ],
                "additionalProperties": false
              },
              "hs_code": {
                "description": "HS / tariff commodity code, 6–10 digits.",
                "type": "string",
                "pattern": "^\\d{6,10}$"
              },
              "value": {
                "description": "Customs value of the whole line (all packages together).",
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000000000,
                    "description": "The amount, 0 or more."
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$",
                    "description": "ISO 4217 currency code, e.g. \"GBP\"."
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ],
                "additionalProperties": false
              },
              "dims": {
                "description": "Dimensions of ONE package: { l, w, h, unit: mm | cm | m | in }.",
                "type": "object",
                "properties": {
                  "l": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 100000
                  },
                  "w": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 100000
                  },
                  "h": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 100000
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "mm",
                      "cm",
                      "m",
                      "in"
                    ]
                  }
                },
                "required": [
                  "l",
                  "w",
                  "h",
                  "unit"
                ],
                "additionalProperties": false
              },
              "stackable": {
                "description": "Whether the packages may be stacked.",
                "type": "boolean"
              },
              "icao_limited_quantity": {
                "description": "On an ID-prefixed line only: the packages are limited quantities to the ICAO Technical Instructions (3.4.8 mark / 3.4.10). Without it such a line has no 1.1.3.6 verdict.",
                "type": "boolean"
              },
              "inner_packaging": {
                "description": "The inner packaging of a line, for the limited / excepted quantity check (Table A columns (7a) / (7b)).",
                "type": "object",
                "properties": {
                  "quantity": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000000,
                    "description": "The quantity in ONE inner packaging."
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "ml",
                      "L",
                      "g",
                      "kg"
                    ],
                    "description": "ml | L | g | kg."
                  },
                  "per_outer": {
                    "description": "Inner packagings in one outer packaging (default 1) — the excepted-quantity outer limit.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100000
                  },
                  "regime": {
                    "description": "The exemption the line is meant to use: limited (lq) or excepted (eq) quantity. A stated regime that is missed fails. Omitted: both are checked, and a line that fits neither is not_applicable (the full requirements apply).",
                    "type": "string",
                    "enum": [
                      "lq",
                      "eq"
                    ]
                  }
                },
                "required": [
                  "quantity",
                  "unit"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "description": "The lines of the load. Required."
        },
        "journey": {
          "type": "object",
          "properties": {
            "origin": {
              "description": "UN/LOCODE or ISO country code of the origin.",
              "type": "string",
              "pattern": "^[A-Za-z]{2}(?:\\s?[A-Za-z2-9]{3})?$"
            },
            "destination": {
              "description": "UN/LOCODE or ISO country code of the destination.",
              "type": "string",
              "pattern": "^[A-Za-z]{2}(?:\\s?[A-Za-z2-9]{3})?$"
            },
            "date": {
              "description": "Date of carriage, YYYY-MM-DD.",
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "tunnels_on_route": {
              "description": "ADR tunnel categories on the route (A–E).",
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "A",
                  "B",
                  "C",
                  "D",
                  "E"
                ]
              }
            },
            "mode": {
              "description": "road | air | sea | multimodal.",
              "type": "string",
              "enum": [
                "road",
                "air",
                "sea",
                "multimodal"
              ]
            }
          },
          "additionalProperties": false
        },
        "vehicle": {
          "type": "object",
          "properties": {
            "type": {
              "description": "Vehicle type, e.g. \"artic\", \"rigid 7.5 t\".",
              "type": "string",
              "maxLength": 60
            },
            "max_mass_t": {
              "description": "Maximum permissible mass, tonnes — read by adr_consignment_check as the transport unit's maximum permissible mass (ADR 8.1.4.1 column (1): the extinguisher band; 3.4.13: the limited-quantity mark on units over 12 t).",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 100
            },
            "axles": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12
            },
            "foodstuffs_carried": {
              "description": "Whether packages known to contain foodstuffs, other articles of consumption or animal feeds are carried in the same vehicle or container as the lines (ADR 7.5.4, read by adr_consignment_check for goods with CV28). Omitted: the foodstuffs precaution is answered as a condition.",
              "type": "boolean"
            },
            "fire_extinguishers_kg": {
              "description": "The capacity in kg (dry powder, or the equivalent for another agent) of each portable fire extinguisher on board (ADR 8.1.4.1: number, total and largest by the transport unit's maximum permissible mass; 8.1.4.2: one of 2 kg under 1.1.3.6).",
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "number",
                "exclusiveMinimum": 0,
                "maximum": 100
              }
            },
            "orange_plates_displayed": {
              "description": "Whether the transport unit displays the two rectangular orange-coloured plates, one at the front and one at the rear (ADR 5.3.2.1.1).",
              "type": "boolean"
            },
            "placards_displayed": {
              "description": "Whether the vehicle displays the placards ADR 5.3.1.5 requires of a vehicle carrying packages (Class 1 other than 1.4S; Class 7 other than excepted packages), on both sides and at the rear.",
              "type": "boolean"
            },
            "equipment_8_1_5": {
              "description": "The ADR 8.1.5.2 / 8.1.5.3 items on board, by name (vest, lighting, gloves, eye protection and escape mask for each crew member; escape mask for labels 2.3 / 6.1; shovel, drain seal, collecting container for labels 3, 4.1, 4.3, 8, 9). An item not listed is read as not on board.",
              "maxItems": 11,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "wheel_chock",
                  "warning_signs",
                  "eye_rinsing_liquid",
                  "warning_vest",
                  "portable_lighting",
                  "protective_gloves",
                  "eye_protection",
                  "emergency_escape_mask",
                  "shovel",
                  "drain_seal",
                  "collecting_container"
                ]
              }
            },
            "instructions_in_writing": {
              "description": "Whether the instructions in writing of ADR 5.4.3 are carried in the driver's cab (8.1.2.1 (b)).",
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "crew": {
          "description": "The vehicle crew, for adr_consignment_check's driver-training and document checks (ADR 8.2, 8.1.2). Facts only — no name.",
          "type": "object",
          "properties": {
            "adr_training_certificate": {
              "description": "Whether the driver holds the ADR driver training certificate (8.2.1.1, the model of 8.2.2.8), valid on the date of carriage.",
              "type": "boolean"
            },
            "specialisations": {
              "description": "The specialisations the driver's certificate carries (8.2.1.3 tanks; 8.2.1.4 Class 1, Class 7).",
              "maxItems": 3,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "class_1",
                  "class_7",
                  "tanks"
                ]
              }
            },
            "photo_identification": {
              "description": "Whether each member of the vehicle crew carries a means of identification which includes a photograph (8.1.2.1 (d), 1.10.1.4).",
              "type": "boolean"
            },
            "awareness_training_1_3": {
              "description": "Whether the driver has received training according to ADR Chapter 1.3 (8.2.3) — what a load carried under 1.1.3.6 keeps for a driver without the 8.2.1 certificate.",
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "options": {
          "type": "object",
          "properties": {
            "air_volumetric_divisor": {
              "description": "IATA volumetric divisor, cm³/kg (default 6000).",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 10000
            },
            "container_number": {
              "description": "ISO 6346 container number (check digit validated, advisory).",
              "type": "string",
              "maxLength": 20
            },
            "awb_number": {
              "description": "IATA air waybill number (check digit validated, advisory).",
              "type": "string",
              "maxLength": 20
            },
            "incoterm": {
              "description": "Incoterms 2020 rule.",
              "type": "string",
              "enum": [
                "EXW",
                "FCA",
                "FAS",
                "FOB",
                "CFR",
                "CIF",
                "CPT",
                "CIP",
                "DAP",
                "DPU",
                "DDP"
              ]
            },
            "freight_cost": {
              "description": "Freight cost for the customs value.",
              "type": "object",
              "properties": {
                "amount": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1000000000000,
                  "description": "The amount, 0 or more."
                },
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$",
                  "description": "ISO 4217 currency code, e.g. \"GBP\"."
                }
              },
              "required": [
                "amount",
                "currency"
              ],
              "additionalProperties": false
            },
            "insurance_cost": {
              "description": "Insurance cost for the customs value.",
              "type": "object",
              "properties": {
                "amount": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1000000000000,
                  "description": "The amount, 0 or more."
                },
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$",
                  "description": "ISO 4217 currency code, e.g. \"GBP\"."
                }
              },
              "required": [
                "amount",
                "currency"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "lines"
      ],
      "additionalProperties": false
    }
  }
}