{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eudr-dev/json-schema/eudr-dev-ddsgenerate-body-schema.json",
  "title": "DDSGenerateBody",
  "description": "Either this shape, or a sample scenario as published at /samples/scenarios/*.json (with `production` for `geolocation` and `product.quantity_kg` for `net_mass_kg`), bare or wrapped as {\"scenario\": ...}. A missing field is named in the 400.",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eudr-dev-openapi.json#/components/schemas/DDSGenerateBody",
  "type": "object",
  "required": [
    "operator",
    "supplier",
    "product",
    "geolocation"
  ],
  "properties": {
    "operator": {
      "type": "object",
      "required": [
        "name",
        "country_of_establishment"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "country_of_establishment": {
          "type": "string",
          "description": "ISO-3166-1 alpha-2"
        },
        "address": {
          "type": "string"
        },
        "eori": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "enum": [
            "operator",
            "trader"
          ]
        }
      }
    },
    "supplier": {
      "type": "object",
      "required": [
        "name",
        "id"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "email": {
          "type": "string"
        }
      }
    },
    "product": {
      "type": "object",
      "required": [
        "hs_code",
        "description",
        "net_mass_kg"
      ],
      "properties": {
        "hs_code": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "net_mass_kg": {
          "type": "number"
        },
        "trade_name": {
          "type": "string"
        },
        "scientific_name": {
          "type": "string"
        }
      }
    },
    "geolocation": {
      "type": "object",
      "required": [
        "country",
        "harvest_window",
        "plot_geojson"
      ],
      "properties": {
        "country": {
          "type": "string",
          "description": "ISO-3166-1 alpha-2 country of production"
        },
        "harvest_window": {
          "type": "string"
        },
        "plot_geojson": {
          "$ref": "#/$defs/GeoJSONGeometry"
        },
        "plot_id": {
          "type": "string",
          "description": "The plot's own id (a field, cadastral or cooperative code); it is filed under it. Never a person's name: it is carried into a signed, public, append-only fact at the evidence provider."
        },
        "plot_area_ha": {
          "type": "number",
          "description": "For a Point plot: its area in hectares. Art. 2(28) allows a Point only for a plot of 4 ha or less; over 4 ha is refused."
        },
        "additional_plots": {
          "type": "array",
          "description": "Every further plot of the consignment.",
          "items": {
            "type": "object",
            "required": [
              "plot_id",
              "plot_geojson"
            ],
            "properties": {
              "plot_id": {
                "type": "string"
              },
              "plot_geojson": {
                "$ref": "#/$defs/GeoJSONGeometry"
              },
              "country": {
                "type": "string",
                "description": "When the plot is in another country than the consignment's."
              },
              "harvest_window": {
                "type": "string"
              },
              "quantity_kg": {
                "type": "number",
                "description": "This plot's share; undeclared shares split the rest evenly."
              },
              "area_ha": {
                "type": "number",
                "description": "For a Point plot: its area in hectares (4 ha or less)."
              }
            }
          }
        },
        "country_subregion": {
          "type": "string"
        }
      }
    },
    "producer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      }
    }
  },
  "$defs": {
    "GeoJSONGeometry": {
      "type": "object",
      "description": "GeoJSON Geometry — Polygon, MultiPolygon, or Point. WGS84 (EPSG:4326). Coordinates ordered [lng, lat].",
      "required": [
        "type",
        "coordinates"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Polygon",
            "MultiPolygon",
            "Point"
          ]
        },
        "coordinates": {}
      }
    }
  }
}