Skip to main content
GET
/
country
/
states
Get states by country
curl --request GET \
  --url https://store.salesive.com/api/v1/country/states \
  --header 'Authorization: Bearer <token>' \
  --header 'x-shop-id: <api-key>'
{
  "status": 200,
  "success": true,
  "message": "States retrieved",
  "data": [
    "Lagos",
    "Abuja",
    "Kano"
  ]
}

Request

GET /country/states?shortName=NG
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}

Headers

HeaderTypeDescription
AuthorizationstringProvide customer token in format Bearer <jwt>.
x-shop-idstringIdentify the shop context.

Query parameters

ParameterTypeDescription
shortNamestringCountry short name (e.g., NG, US, GB). Defaults to NG if not provided.

Request examples

Get Nigerian states (default)

GET /country/states

Get United States

GET /country/states?shortName=US

Get United Kingdom states

GET /country/states?shortName=GB

Successful response

{
    "status": 200,
    "success": true,
    "message": "States retrieved",
    "data": [
        {
            "name": "Lagos",
            "code": "LA",
            "country": "Nigeria"
        },
        {
            "name": "Abuja",
            "code": "AB",
            "country": "Nigeria"
        }
    ]
}

Error responses

401 Unauthorized

{
    "status": 401,
    "success": false,
    "message": "Authentication required",
    "data": {}
}

404 Not Found

{
    "status": 404,
    "success": false,
    "message": "Country not found",
    "data": {}
}

Authorizations

Authorization
string
header
required

JWT issued by the Salesive Store API for authenticated shoppers.

x-shop-id
string
header
required

Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.

Headers

x-shop-id
string

Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.

Query Parameters

shortName
string
default:NG

Country short name (e.g., NG, US, GB). Defaults to NG if not provided.

Response

States retrieved successfully.

status
integer
Example:

200

success
boolean
Example:

true

message
string
Example:

"States retrieved"

data
string[]
Example:
["Lagos", "Abuja", "Kano"]