> ## 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 cities by state

> Retrieve cities for a specific state within a country

## Request

```http theme={null}
GET /country/cities?shortName=NG&state=lagos
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
```

## Headers

| Header          | Type   | Description                                                    |
| --------------- | ------ | -------------------------------------------------------------- |
| `Authorization` | string | Provide the customer token in the format `Bearer <jwt>`.       |
| `x-shop-id`     | string | Identify the shop for which the country metadata is requested. |

## Query parameters

| Parameter   | Type   | Description                                                               |
| ----------- | ------ | ------------------------------------------------------------------------- |
| `shortName` | string | Country short code (e.g., `NG`, `US`, `GB`). Defaults to `NG` if omitted. |
| `state`     | string | State/region name to pull cities for. Required.                           |

## Request examples

### Nigerian cities

```http theme={null}
GET /country/cities?shortName=NG&state=lagos
```

### United States cities

```http theme={null}
GET /country/cities?shortName=US&state=california
```

### United Kingdom cities

```http theme={null}
GET /country/cities?shortName=GB&state=london
```

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Cities retrieved",
    "data": ["Alimosho", "Ikeja", "Surulere"]
}
```

## Error responses

### 400 Bad Request

```json theme={null}
{
    "status": 400,
    "success": false,
    "message": "State is required",
    "data": {}
}
```

### 404 Not Found

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


## OpenAPI

````yaml GET /country/cities
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/cities:
    get:
      summary: Get cities by state
      description: Retrieve cities for a specific state within a country.
      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
        - name: state
          in: query
          required: true
          description: State/region name to retrieve cities for.
          schema:
            type: string
      responses:
        '200':
          description: Cities retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Cities retrieved
                  data:
                    type: array
                    items:
                      type: string
                    example:
                      - Alimosho
                      - Ikeja
                      - Surulere
        '400':
          description: State is required.
        '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.

````