# Address

> Base URL: `https://pos.pages.fm/api/v1`. Authenticate with the `api_key` query parameter.

## List of provinces and cities

`GET /geo/provinces`

Get list of provinces and cities

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `country_code` | query | string | yes | Country code (for example, Vietnam country code is 84) |
| `is_new` | query | boolean |  | New province (for country Viet Nam) |
| `all` | query | boolean |  | All provinces including old and new (for country Viet Nam) |

### Responses

- `200` Success (object)

```json
{
  "data": [
    {
      "id": "101",
      "name": "Hà Nội",
      "name_en": "ha noi",
      "new_id": "84_VN101"
    },
    {
      "id": "701",
      "name": "Hồ Chí Minh",
      "name_en": "ho chi minh",
      "new_id": "84_VN129"
    }
  ]
}
```

## List of districts

`GET /geo/districts`

Get list of districts

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `province_id` | query | string | yes | Province ID of districts you want to retrieve. Get province ID in api GET /geo/provinces |

### Responses

- `200` Success (object)

```json
{
  "data": [
    {
      "id": "10101",
      "name": "Quận Ba Đình",
      "name_en": "ba dinh",
      "province_id": "101"
    }
  ]
}
```

## List of communes

`GET /geo/communes`

Get list of communes

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `district_id` | query | string | yes | District ID of communes you want to retrieve. Get district ID in api GET /geo/districts |
| `province_id` | query | string | yes | Province ID of communes you want to retrieve. Get province ID in api GET /geo/provinces |

### Responses

- `200` Success (object)

```json
{
  "data": [
    {
      "district_id": "10101",
      "id": "1010115",
      "name": "Phường Cống Vị",
      "name_en": "cong vi",
      "new_id": null,
      "postcode": null,
      "province_id": "101"
    }
  ]
}
```
