Skip to content

Get Single Country

Retrieve detailed information for a specific country including all its states/provinces.

Endpoint

GET /api/shop/countries/{id}

Request Headers

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

Path Parameters

ParameterTypeRequiredDescription
idintegerYesCountry ID

Response Fields (200 OK)

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

State Fields

FieldTypeDescription
idintegerState ID
codestringState/province code
namestringState/province name

Use Cases

  • Load states/provinces for selected country
  • Display country information
  • Validate shipping addresses
  • Populate address forms with state options

Released under the MIT License.