Countries

Get All Countries

GET /countries

Request

Get a list of all countries available. A country or territory, identifiable by an ISO 3166 country code.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required
  • Content-Type in header with default of application/json - string
    required
  • page in query - number
    Number of pages.
  • limit in query - number
    Count per page.
  • country in query - string
  • country_iso2 in query - string
  • country_iso3 in query - string

example

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/countries' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

Response

Body

array | application/json
  • id
    integer

    Id of the country.
    Example: 13
  • country
    string

    Country name.
    Example: Australia
  • country_iso2
    string

    2-letter country code.
    Example: AU
  • country_iso3
    string

    3-letter country code.
    Example: AUS
  • states
    object

    Refers to the states object return in GET countries requests.

example

[
{
"id": 1,
"country": "Afghanistan",
"country_iso2": "AF",
"country_iso3": "AFG",
"states": {
"url": "https://api.bigcommerce.com/stores/store_hash/v2/countries/1/states",
"resource": "/countries/1/states"
}
},
{
"id": 2,
"country": "Albania",
"country_iso2": "AL",
"country_iso3": "ALB",
"states": {
"url": "https://api.bigcommerce.com/stores/store_hash/v2/countries/2/states",
"resource": "/countries/2/states"
}
}
]

Get a Country

GET /countries/{id}

Request

Returns a single Country. Gets a country. A country or territory, identifiable by an ISO 3166 country code.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • id in path - integer
    required
    The ID of the country.
  • Accept in header with default of application/json - string
    required
  • Content-Type in header with default of application/json - string
    required

example

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/countries/[id]' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

Response

Body

object | application/json
  • id
    integer

    Id of the country.
    Example: 13
  • country
    string

    Country name.
    Example: Australia
  • country_iso2
    string

    2-letter country code.
    Example: AU
  • country_iso3
    string

    3-letter country code.
    Example: AUS
  • states
    object

    Refers to the states object return in GET countries requests.

response

{
"id": 1,
"country": "Afghanistan",
"country_iso2": "AF",
"country_iso3": "AFG",
"states": {
"url": "https://api.bigcommerce.com/stores/h10wocxy6s/v2/countries/1/states",
"resource": "/countries/1/states"
}
}

Get a Count of All Countries

GET /countries/count

Request

Returns a count of all countries.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string

example

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/countries/count' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

Response

Body

object | application/json
  • count
    integer

    Min: 1

response

{
"count": 241
}
Did you find what you were looking for?