Skip to content

Get Countries

Retrieve a list of all available countries and their states/provinces.

Endpoint

GET /api/shop/countries

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key

Query Parameters

ParameterTypeRequiredDescription
includeStatesbooleanNoInclude state/province information (default: true)

Response Fields (200 OK)

FieldTypeDescription
idintegerCountry ID
codestringISO 2-letter country code
namestringCountry name
statesarrayStates/provinces within country

State Fields

FieldTypeDescription
codestringState/province code
namestringState/province name

Use Cases

  • Build country selector dropdowns
  • Populate country list in shipping/billing forms
  • Load state/province options based on country selection
  • Validate shipping addresses
  • Display available shipping destinations

Released under the MIT License.