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.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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/countryto auto-detect the country from the caller's location (falling back to your account's country), orGET /geo/country/{country_code}to force a specific one. An unsupported code falls back to the detected/account country. statesalways reflects the selected country.- Use
localeto 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 toen_US.
Example:
curl --request GET \
--url 'https://www.pelcro.com/api/v1/sdk/geo/country/CA?site_id=1232&locale=fr_CA'{
"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 returnedThe
countriesandstatesobjects are returned in full; the example above is truncated for brevity.

