> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get states by country

> Retrieve a list of state names for a specific country.

## Request

```http theme={null}
GET /country/states?shortName=NG
x-shop-id: {{shopId}}
```

## Headers

| Header      | Type   | Description                |
| ----------- | ------ | -------------------------- |
| `x-shop-id` | string | Identify the shop context. |

## Query parameters

| Parameter   | Type   | Description                                                    |
| ----------- | ------ | -------------------------------------------------------------- |
| `shortName` | string | Country short name (e.g., `NG`, `US`, `GB`). Defaults to `NG`. |

## Request examples

### Get Nigerian states (default)

```http theme={null}
GET /country/states
```

### Get US states

```http theme={null}
GET /country/states?shortName=US
```

### Get UK states

```http theme={null}
GET /country/states?shortName=GB
```

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "States retrieved",
    "data": [
        "Abia",
        "Abuja (Federal Capital Territory)",
        "Adamawa",
        "Akwa Ibom",
        "Anambra",
        "Bauchi",
        "Bayelsa",
        "Benue",
        "Borno",
        "Cross River",
        "Delta",
        "Ebonyi",
        "Edo",
        "Ekiti",
        "Enugu",
        "Gombe",
        "Imo",
        "Jigawa",
        "Kaduna",
        "Kano",
        "Katsina",
        "Kebbi",
        "Kogi",
        "Kwara",
        "Lagos",
        "Nasarawa",
        "Niger",
        "Ogun",
        "Ondo",
        "Osun",
        "Oyo",
        "Plateau",
        "Rivers",
        "Sokoto",
        "Taraba",
        "Yobe",
        "Zamfara"
    ]
}
```

## Error response

```json theme={null}
{
    "status": 404,
    "success": false,
    "message": "Country not found",
    "data": {}
}
```


## OpenAPI

````yaml GET /country/states
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /country/states:
    get:
      summary: Get states by country
      description: Retrieve states for a specific country by its short name.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
        - name: shortName
          in: query
          required: false
          description: >-
            Country short name (e.g., NG, US, GB). Defaults to NG if not
            provided.
          schema:
            type: string
            default: NG
      responses:
        '200':
          description: States retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: States retrieved
                  data:
                    type: array
                    items:
                      type: string
                    example:
                      - Lagos
                      - Abuja
                      - Kano
        '404':
          description: Country not found.
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````