{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/defianceinternational-io/json-schema/defianceinternational-io-list-shipping-destinations-200-schema.json",
  "title": "listShippingDestinations.200",
  "description": "The public destination register: where orders ship.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/defianceinternational-io-platform-api-openapi.yml#/components/schemas/listShippingDestinations.200",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "shipping-destinations/v1"
    },
    "total": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "The size of the ISO country population."
    },
    "counts": {
      "type": "object",
      "properties": {
        "ships": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "shipsWithConditions": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "doesNotShip": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "notReviewed": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "ships",
        "shipsWithConditions",
        "doesNotShip",
        "notReviewed"
      ],
      "additionalProperties": false,
      "description": "Destination counts by status. They sum to total when the register reconciles."
    },
    "reconciled": {
      "type": "boolean",
      "description": "Whether every row is well formed and the counts conserve the population."
    },
    "destinations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "An ISO 3166-1 alpha-2 country code."
          },
          "status": {
            "type": "string",
            "enum": [
              "ships",
              "does_not_ship",
              "not_reviewed"
            ]
          },
          "reasonClass": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "sanctions",
                  "export_policy",
                  "import_rules",
                  "tax",
                  "carrier",
                  "processor"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Why a destination is closed, present exactly when the status is does_not_ship."
          }
        },
        "required": [
          "code",
          "status",
          "reasonClass"
        ],
        "additionalProperties": false
      },
      "description": "Every reviewed destination, ordered by code. Unreviewed destinations are the population minus these rows."
    },
    "researchUseOnly": {
      "type": "string",
      "description": "The boundary statement, stated once at the top level.",
      "pattern": "^Research use only\\. Not for human consumption\\.$"
    }
  },
  "required": [
    "schemaVersion",
    "total",
    "counts",
    "reconciled",
    "destinations",
    "researchUseOnly"
  ],
  "additionalProperties": false
}