{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/DefinedRegion/v1/schema.json",
  "title": "DefinedRegion",
  "description": "Objects Grid DefinedRegion. Where a shipping rate applies: a country, and optionally regions or postal codes in it. Stored inside an Offer's shippingDetails.shippingDestination. Modeled in compliance with https://schema.org/DefinedRegion.",
  "type": "object",
  "properties": {
    "at_type": {
      "description": "The object type",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "DefinedRegion"
      ]
    },
    "addressCountry": {
      "description": "The country, ISO 3166-1 alpha-2",
      "$ref": "https://objectsgrid.com/.well-known/objects-catalog/CountryCodeEnumeration/v1/schema.json"
    },
    "addressRegion": {
      "description": "Regions of the country, ISO 3166-2 subdivision codes without the country, e.g. 'CA' for California",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 3
      }
    },
    "postalCode": {
      "description": "Postal codes",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "postalCodePrefix": {
      "description": "Postal code prefixes, e.g. '94' for every code starting with 94",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "postalCodeRange": {
      "description": "Ranges of postal codes",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "at_type": {
            "description": "The object type",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "PostalCodeRangeSpecification"
            ]
          },
          "postalCodeBegin": {
            "description": "The first postal code of the range",
            "type": "string",
            "minLength": 1
          },
          "postalCodeEnd": {
            "description": "The last postal code of the range",
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "postalCodeBegin",
          "postalCodeEnd"
        ],
        "unevaluatedProperties": false
      }
    }
  },
  "required": [
    "addressCountry"
  ],
  "unevaluatedProperties": false
}
