{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/storecove/json-schema/storecove-country-specifications-schema.json",
  "title": "CountrySpecifications",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/storecove-discovery-api-openapi.yml#/components/schemas/CountrySpecifications",
  "properties": {
    "countries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CountrySpecification"
      }
    }
  },
  "$defs": {
    "Country": {
      "title": "Country",
      "description": "An ISO 3166-1 alpha-2 country code.",
      "type": "string",
      "enum": [
        "AD",
        "AE",
        "AF",
        "AG",
        "AI",
        "AL",
        "AM",
        "AO",
        "AQ",
        "AR",
        "AS",
        "AT",
        "AU",
        "AW",
        "AX",
        "AZ",
        "BA",
        "BB",
        "BD",
        "BE",
        "BF",
        "BG",
        "BH",
        "BI",
        "BJ",
        "BL",
        "BM",
        "BN",
        "BO",
        "BQ",
        "BR",
        "BS",
        "BT",
        "BV",
        "BW",
        "BY",
        "BZ",
        "CA",
        "CC",
        "CD",
        "CF",
        "CG",
        "CH",
        "CI",
        "CK",
        "CL",
        "CM",
        "CN",
        "CO",
        "CR",
        "CU",
        "CV",
        "CW",
        "CX",
        "CY",
        "CZ",
        "DE",
        "DJ",
        "DK",
        "DM",
        "DO",
        "DZ",
        "EC",
        "EE",
        "EG",
        "EH",
        "ER",
        "ES",
        "ET",
        "FI",
        "FJ",
        "FK",
        "FM",
        "FO",
        "FR",
        "GA",
        "GB",
        "GD",
        "GE",
        "GF",
        "GG",
        "GH",
        "GI",
        "GL",
        "GM",
        "GN",
        "GP",
        "GQ",
        "GR",
        "GS",
        "GT",
        "GU",
        "GW",
        "GY",
        "HK",
        "HM",
        "HN",
        "HR",
        "HT",
        "HU",
        "ID",
        "IE",
        "IL",
        "IM",
        "IN",
        "IO",
        "IQ",
        "IR",
        "IS",
        "IT",
        "JE",
        "JM",
        "JO",
        "JP",
        "KE",
        "KG",
        "KH",
        "KI",
        "KM",
        "KN",
        "KP",
        "KR",
        "KW",
        "KY",
        "KZ",
        "LA",
        "LB",
        "LC",
        "LI",
        "LK",
        "LR",
        "LS",
        "LT",
        "LU",
        "LV",
        "LY",
        "MA",
        "MC",
        "MD",
        "ME",
        "MF",
        "MG",
        "MH",
        "MK",
        "ML",
        "MM",
        "MN",
        "MO",
        "MP",
        "MQ",
        "MR",
        "MS",
        "MT",
        "MU",
        "MV",
        "MW",
        "MX",
        "MY",
        "MZ",
        "NA",
        "NC",
        "NE",
        "NF",
        "NG",
        "NI",
        "NL",
        "NO",
        "NP",
        "NR",
        "NU",
        "NZ",
        "OM",
        "PA",
        "PE",
        "PF",
        "PG",
        "PH",
        "PK",
        "PL",
        "PM",
        "PN",
        "PR",
        "PS",
        "PT",
        "PW",
        "PY",
        "QA",
        "RE",
        "RO",
        "RS",
        "RU",
        "RW",
        "SA",
        "SB",
        "SC",
        "SD",
        "SE",
        "SG",
        "SH",
        "SI",
        "SJ",
        "SK",
        "SL",
        "SM",
        "SN",
        "SO",
        "SR",
        "SS",
        "ST",
        "SV",
        "SX",
        "SY",
        "SZ",
        "TC",
        "TD",
        "TF",
        "TG",
        "TH",
        "TJ",
        "TK",
        "TL",
        "TM",
        "TN",
        "TO",
        "TR",
        "TT",
        "TV",
        "TW",
        "TZ",
        "UA",
        "UG",
        "UM",
        "US",
        "UY",
        "UZ",
        "VA",
        "VC",
        "VE",
        "VG",
        "VI",
        "VN",
        "VU",
        "WF",
        "WS",
        "YE",
        "YT",
        "ZA",
        "ZM",
        "ZW",
        "XK",
        "XI"
      ]
    },
    "CountrySpecification": {
      "properties": {
        "country": {
          "allOf": [
            {
              "$ref": "#/$defs/Country"
            },
            {
              "title": "Country",
              "description": "The ISO 3166-2 country this specification is for."
            }
          ]
        },
        "region": {
          "title": "Region",
          "description": "The region this country belongs to. Within this region exchanging invoices is well defined. Between regions some care needs to be taken and Storecove may help in automatically converting some items. Contact us for details of inter-regional document exchange.",
          "type": "string",
          "enum": [
            "eu_eea",
            "sg",
            "aunz",
            "in",
            "world"
          ]
        },
        "sender": {
          "title": "Sender",
          "description": "The sender of the document.",
          "properties": {
            "legal": {
              "allOf": [
                {
                  "$ref": "#/$defs/CountrySpecificationIdentifier"
                },
                {
                  "title": "Sender Legal Identifier",
                  "description": "The legal identifier of the sender."
                }
              ]
            },
            "tax": {
              "allOf": [
                {
                  "$ref": "#/$defs/CountrySpecificationIdentifier"
                },
                {
                  "title": "Sender Tax Identifier",
                  "description": "The tax identifier of the sender."
                }
              ]
            }
          }
        },
        "receiver": {
          "title": "Receiver",
          "description": "The receiver of the document.",
          "properties": {
            "business": {
              "title": "Business Receiver",
              "description": "The business receiver of the document.",
              "properties": {
                "legal": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/CountrySpecificationIdentifier"
                    },
                    {
                      "title": "Business Receiver Legal Identifier",
                      "description": "The legal identifier of the business receiver."
                    }
                  ]
                },
                "tax": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/CountrySpecificationIdentifier"
                    },
                    {
                      "title": "Business Receiver Tax Identifier",
                      "description": "The tax identifier of the business receiver."
                    }
                  ]
                },
                "routing": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/CountrySpecificationIdentifier"
                    },
                    {
                      "title": "Business Receiver Routing Identifier",
                      "description": "The routing identifier of the business receiver."
                    }
                  ]
                }
              }
            },
            "government": {
              "title": "Government Receiver",
              "description": "The government receiver of the document.",
              "properties": {
                "legal": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/CountrySpecificationIdentifier"
                    },
                    {
                      "title": "Government Receiver Legal Identifier",
                      "description": "The legal identifier of the government receiver."
                    }
                  ]
                },
                "tax": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/CountrySpecificationIdentifier"
                    },
                    {
                      "title": "Government Receiver Tax Identifier",
                      "description": "The tax identifier of the government receiver."
                    }
                  ]
                },
                "routing": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/CountrySpecificationIdentifier"
                    },
                    {
                      "title": "Government Receiver Routing Identifier",
                      "description": "The routing identifier of the government receiver."
                    }
                  ]
                }
              }
            },
            "consumer": {
              "title": "Consumer Receiver",
              "description": "The consumer receiver of the document.",
              "properties": {
                "legal": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/CountrySpecificationIdentifier"
                    },
                    {
                      "title": "Consumer Receiver Legal Identifier",
                      "description": "The legal identifier of the consumer receiver."
                    }
                  ]
                },
                "tax": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/CountrySpecificationIdentifier"
                    },
                    {
                      "title": "Consumer Receiver Tax Identifier",
                      "description": "The tax identifier of the consumer receiver."
                    }
                  ]
                },
                "routing": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/CountrySpecificationIdentifier"
                    },
                    {
                      "title": "Government Receiver Routing Identifier",
                      "description": "The routing identifier of the consumer receiver."
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "CountrySpecificationIdentifier": {
      "properties": {
        "scheme_type": {
          "title": "Scheme Type",
          "description": "The scheme type of the identifier. Currently always \"iso6523-actorid-upis\"",
          "type": "string",
          "enum": [
            "iso6523-actorid-upis"
          ]
        },
        "scheme": {
          "title": "Scheme",
          "description": "The scheme of the identifier",
          "type": "string"
        },
        "scheme_numercial": {
          "title": "Scheme Numerical",
          "description": "The numerical version of the scheme of the identifier",
          "type": "string"
        },
        "description": {
          "title": "Description",
          "description": "Identifier description.",
          "type": "string"
        },
        "centralized": {
          "title": "Centralized",
          "description": "Whether or not the identifier represents a centralized routing identifier. This is used in SG, AT and FR where all government invoices are routed to a central accesspoint with a single identifier. This field can only be present for routing identifiers.",
          "type": "boolean"
        },
        "centralized_identifier": {
          "title": "Centralized Identifier",
          "description": "The centralized identifier to use for routing, if the \"centralized\" proprerty is true.",
          "type": "string"
        },
        "centalized_identifier_test": {
          "title": "Centralized Identifier Test",
          "description": "The centralized identifier to use for routing in test cases, if the \"centralized\" proprerty is true. May not always be available depending on the country and network.",
          "type": "string"
        }
      }
    }
  }
}