{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eudr-dev/json-schema/eudr-dev-spatial-verify-body-schema.json",
  "title": "SpatialVerifyBody",
  "description": "Supply either `polygon` (one plot) or `plots` (up to eight). Supplying neither is a 400 naming the omission.",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eudr-dev-openapi.json#/components/schemas/SpatialVerifyBody",
  "type": "object",
  "required": [
    "commodity",
    "country"
  ],
  "properties": {
    "polygon": {
      "$ref": "#/$defs/GeoJSONGeometry"
    },
    "plots": {
      "type": "array",
      "minItems": 1,
      "maxItems": 25,
      "description": "Several plots in one request, each keeping its own verdict row. Art. 4(1) taints the whole consignment if any single plot fails, so they belong in one call.",
      "items": {
        "type": "object",
        "required": [
          "geojson"
        ],
        "properties": {
          "plot_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Echoed on the matching verdict row. [A-Za-z0-9-_.:] Keep it opaque — a farm or cadastral code, never a person's name. This one field is carried into a signed, public, append-only fact at the evidence provider, which cannot erase it without breaking the receipts that cite it."
          },
          "geojson": {
            "$ref": "#/$defs/GeoJSONGeometry"
          }
        }
      }
    },
    "commodity": {
      "type": "string",
      "enum": [
        "cattle",
        "cocoa",
        "coffee",
        "oil_palm",
        "rubber",
        "soya",
        "wood"
      ]
    },
    "country": {
      "type": "string",
      "description": "ISO-3166-1 alpha-2.",
      "minLength": 2,
      "maxLength": 2
    },
    "quantity_kg": {
      "type": [
        "number",
        "null"
      ]
    },
    "hs_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "evidence_detail": {
      "type": "string",
      "enum": [
        "cids",
        "anchor"
      ],
      "default": "cids",
      "description": "`cids` embeds every per-cell fact CID; `anchor` returns only the address and count, resolvable at /v1/evidence/{evidence_cid}. The verdict is identical either way. On a real plot the array is the large majority of the body."
    }
  },
  "$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": {}
      }
    }
  }
}