---
updatedAt: 2026-06-16T13:18:18.000Z
agentTools:
  projectIndex: https://docs.pelcro.com/llms.txt
---

# Countries and states

Retrieve the list of countries and the states/regions for a selected country — used to populate country and state selectors in address and checkout forms.

The country code is optional: calling `GET /geo/country` (without a code) auto-detects the country from the caller’s location, falling back to your account’s country. Supplying `GET /geo/country/{country_code}` forces a specific country. `states` always reflects the selected country. Use `locale` to localize the country and state names.

## Overview

Retrieve the list of countries and the states/regions for a selected country — typically used to populate country and state selectors in address and checkout forms.

* The country code is **optional**: call `GET /geo/country` to auto-detect the country from the caller's location (falling back to your account's country), or `GET /geo/country/{country_code}` to force a specific one. An unsupported code falls back to the detected/account country.
* `states` always reflects the selected country.
* Use `locale` to localize the country and state names — it accepts a full locale (`en_US`, `fr_CA`) or an ISO 639-1 code (`en`, `fr`), and defaults to `en_US`.

**Example:**

```bash
curl --request GET \
  --url 'https://www.pelcro.com/api/v1/sdk/geo/country/CA?site_id=1232&locale=fr_CA'
```

```json
{
  "error": false,
  "data": {
    "selected_country": "CA",
    "countries": { "CA": "Canada", "US": "États-Unis", "FR": "France" },
    "states":    { "QC": "Québec", "ON": "Ontario", "BC": "Colombie-Britannique" }
  }
}
```

> 📘 Full lists returned
>
> The `countries` and `states` objects are returned in full; the example above is truncated for brevity.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Open API",
    "version": "1.88"
  },
  "servers": [
    {
      "url": "https://www.pelcro.com/api/v1/sdk/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "query",
        "name": "site_id"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/geo/country/{country_code}": {
      "get": {
        "summary": "Countries and states",
        "description": "Retrieve the list of countries and the states/regions for a selected country — used to populate country and state selectors in address and checkout forms.\n\nThe country code is optional: calling `GET /geo/country` (without a code) auto-detects the country from the caller’s location, falling back to your account’s country. Supplying `GET /geo/country/{country_code}` forces a specific country. `states` always reflects the selected country. Use `locale` to localize the country and state names.",
        "operationId": "geo",
        "parameters": [
          {
            "name": "site_id",
            "in": "query",
            "description": "The unique identifier of the site associated with your account.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "country_code",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ISO 3166-1 alpha-2 country code (e.g. `US`, `CA`). Optional — omit it (call `GET /geo/country`) to auto-detect. An unsupported code falls back to the detected/account country."
          },
          {
            "name": "locale",
            "in": "query",
            "description": "Optional. Locale used to localize country and state names. Accepts a full locale (e.g. `en_US`, `fr_CA`) or an ISO 639-1 code (e.g. `en`, `fr`). Defaults to `en_US`; an unsupported value falls back to `en_US`.",
            "schema": {
              "type": "string",
              "default": "en_US"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": false,\n  \"data\": {\n    \"selected_country\": \"US\",\n    \"countries\": {\n      \"US\": \"United States\",\n      \"CA\": \"Canada\",\n      \"GB\": \"United Kingdom\",\n      \"FR\": \"France\",\n      \"DE\": \"Germany\"\n    },\n    \"states\": {\n      \"AL\": \"Alabama\",\n      \"AK\": \"Alaska\",\n      \"AZ\": \"Arizona\",\n      \"CA\": \"California\",\n      \"NY\": \"New York\"\n    }\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "boolean",
                      "example": false
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "selected_country": {
                          "type": "string",
                          "description": "The country the states list reflects."
                        },
                        "countries": {
                          "type": "object",
                          "description": "Map of ISO 3166-1 alpha-2 country code to localized country name (full list returned; truncated here).",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "states": {
                          "type": "object",
                          "description": "Map of state/region code to localized name for the selected country (truncated here).",
                          "additionalProperties": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": {\n    \"status\": 400,\n    \"message\": \"Invalid request, please try again.\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400
                        },
                        "message": {
                          "type": "string",
                          "example": "Invalid request, please try again."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```

# Sibling pages

* [Overview](https://docs.pelcro.com/reference/api-open-intro.md)
* [Identification](https://docs.pelcro.com/reference/api-open-identification.md)
* [Resources](https://docs.pelcro.com/reference/api-open-resources.md)
* [How to integrate](https://docs.pelcro.com/reference/how-to-integrate.md)
* [Supported Languages](https://docs.pelcro.com/reference/api-open-supported-languages.md)
* [Errors](https://docs.pelcro.com/reference/api-open-errors.md)
* [Site](https://docs.pelcro.com/reference/api-open-site.md)
* [Authentication](https://docs.pelcro.com/reference/api-open-authentication.md)
* [Password](https://docs.pelcro.com/reference/api-open-password.md)
* [Customer](https://docs.pelcro.com/reference/api-open-customer.md)
* [Subscription](https://docs.pelcro.com/reference/api-open-subscription.md)
* [Address](https://docs.pelcro.com/reference/api-open-address.md)
* [Payment methods](https://docs.pelcro.com/reference/api-open-payment-methods.md)
* [Payment](https://docs.pelcro.com/reference/api-open-payment.md)
* [Invoice](https://docs.pelcro.com/reference/api-open-invoice.md)
* [E-commerce](https://docs.pelcro.com/reference/api-open-ecommerce.md)
* [Newsletter](https://docs.pelcro.com/reference/api-open-newsletter.md)
* [Plan](https://docs.pelcro.com/reference/api-open-plan.md)
* [Memberships](https://docs.pelcro.com/reference/api-open-memberships.md)
* [Campaign](https://docs.pelcro.com/reference/campaign.md)
* [Bills](https://docs.pelcro.com/reference/api-open-bills.md)
* [Visitor location](https://docs.pelcro.com/reference/api-open-location.md)
* [Source](https://docs.pelcro.com/reference/api-open-source.md)