{
  "openapi": "3.1.0",
  "info": {
    "title": "Country APIs",
    "description": "Geographic reference data: countries, states and provinces, EU country lists,\nVAT-applicable EU countries, and postal code validation.\n",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://api.sandbox.resellerclub.com/v2",
      "description": "Sandbox"
    },
    {
      "url": "https://api.resellerclub.com/v2",
      "description": "Live"
    }
  ],
  "security": [
    {
      "apiKeyAuth": [],
      "userIdHeader": []
    }
  ],
  "paths": {
    "/countries": {
      "get": {
        "tags": [
          "APIs"
        ],
        "summary": "List supported countries",
        "description": "Returns supported countries with codes and display names.",
        "operationId": "listCountries",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ListCountriesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "ListCountriesResponse"
      }
    },
    "/countries/{countryCode}/states": {
      "get": {
        "tags": [
          "APIs"
        ],
        "summary": "List states for a country",
        "description": "Returns states or provinces for the requested country.",
        "operationId": "listStatesForCountry",
        "parameters": [
          {
            "name": "countryCode",
            "in": "path",
            "description": "Country Code as per ISO 3166-1 alpha-2",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ListStatesForCountryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "ListStatesForCountryResponse"
      }
    },
    "/countries/{countryCode}/postal-codes/validate": {
      "get": {
        "tags": [
          "APIs"
        ],
        "summary": "Validate a postal code for a country",
        "description": "Indicates whether the postal code is valid for the given country.",
        "operationId": "validatePostalCode",
        "parameters": [
          {
            "name": "countryCode",
            "in": "path",
            "description": "Country Code (required).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postalCode",
            "in": "query",
            "description": "Postal Code (required).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ValidatePostalCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "ValidatePostalCodeResponse"
      }
    },
    "/countries/eu": {
      "get": {
        "tags": [
          "APIs"
        ],
        "summary": "List EU member country codes",
        "description": "Returns EU member country codes.",
        "operationId": "listEuCountries",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ListEuCountriesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "ListEuCountriesResponse"
      }
    },
    "/countries/eu/vat-applicable": {
      "get": {
        "tags": [
          "APIs"
        ],
        "summary": "List EU countries where VAT applies",
        "description": "Returns EU country codes where VAT applies.",
        "operationId": "listVatApplicableEuCountries",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ListVatApplicableEuCountriesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "ListVatApplicableEuCountriesResponse"
      }
    }
  },
  "components": {
    "schemas": {
      "GenericResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "customLogMessage": {}
        }
      },
      "CountryEntryDto": {
        "type": "object",
        "description": "Country code and display name.",
        "properties": {
          "code": {
            "type": "string",
            "description": "Country code."
          },
          "name": {
            "type": "string",
            "description": "Country display name."
          }
        }
      },
      "StateEntryDto": {
        "type": "object",
        "description": "State or province code and display name.",
        "properties": {
          "code": {
            "type": "string",
            "description": "State or province code."
          },
          "name": {
            "type": "string",
            "description": "State or province display name."
          }
        }
      },
      "ListCountriesResponse": {
        "type": "object",
        "description": "Returns supported countries with codes and display names.",
        "properties": {
          "countries": {
            "type": "array",
            "description": "Supported countries with code and display name.",
            "items": {
              "$ref": "#/components/schemas/CountryEntryDto"
            }
          },
          "status": {
            "type": "string",
            "description": "Error status when the request fails."
          },
          "message": {
            "type": "string",
            "description": "Error message when the request fails."
          }
        }
      },
      "ListEuCountriesResponse": {
        "type": "object",
        "description": "Returns EU member country codes.",
        "properties": {
          "countryCodes": {
            "type": "array",
            "description": "EU member country codes.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "Error status when the request fails."
          },
          "message": {
            "type": "string",
            "description": "Error message when the request fails."
          }
        }
      },
      "ListStatesForCountryResponse": {
        "type": "object",
        "description": "Returns states or provinces for the requested country.",
        "properties": {
          "states": {
            "type": "array",
            "description": "States or provinces for the requested country.",
            "items": {
              "$ref": "#/components/schemas/StateEntryDto"
            }
          },
          "status": {
            "type": "string",
            "description": "Error status when the request fails."
          },
          "message": {
            "type": "string",
            "description": "Error message when the request fails."
          }
        }
      },
      "ListVatApplicableEuCountriesResponse": {
        "type": "object",
        "description": "Returns EU country codes where VAT applies.",
        "properties": {
          "countryCodes": {
            "type": "array",
            "description": "EU country codes where VAT applies.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "Error status when the request fails."
          },
          "message": {
            "type": "string",
            "description": "Error message when the request fails."
          }
        }
      },
      "ValidatePostalCodeResponse": {
        "type": "object",
        "description": "Indicates whether the postal code is valid for the given country.",
        "properties": {
          "valid": {
            "type": "boolean",
            "description": "Whether the postal code is valid for the given country."
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "description": "Reseller API key. In your own requests, send the full header value: Authorization: ApiKey YOUR_API_KEY",
        "name": "Authorization",
        "in": "header"
      },
      "userIdHeader": {
        "type": "apiKey",
        "description": "Reseller user ID",
        "name": "X-User-Id",
        "in": "header"
      }
    }
  },
  "tags": [
    {
      "name": "APIs"
    }
  ]
}