Skip to main content

Get List Districts

Use this api to get List Districts by code

URL : api-auth/v2/districts

Method : GET

Validate :

'page' => 'nullable|integer|min:1',
'limit' => 'nullable|integer|min:1|max:256',
'name' => 'nullable|string', // name of district
'codes' => 'nullable', // list code of district
'codes.*' => 'nullable|string',
'province_code' => 'nullable|string', // code of parent

Example : https://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?province_code=01&limit=2

Success Response

Code : 200 OK

Content example

{
"result": "success",
"error": "",
"errorCode": "",
"current_page": 1,
"data": [
{
"province_id": 1,
"district_id": 64,
"province_code": "01",
"district_code": "001",
"province_name": "Thành phố Hà Nội",
"district_name": "Quận Ba Đình"
},
{
"province_id": 1,
"district_id": 65,
"province_code": "01",
"district_code": "002",
"province_name": "Thành phố Hà Nội",
"district_name": "Quận Hoàn Kiếm"
}
],
"from": 1,
"last_page": 15,
"links": [
{
"url": null,
"label": "pagination.previous",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=1",
"label": "1",
"active": true
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=2",
"label": "2",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=3",
"label": "3",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=4",
"label": "4",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=5",
"label": "5",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=6",
"label": "6",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=7",
"label": "7",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=8",
"label": "8",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=9",
"label": "9",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=14",
"label": "14",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=15",
"label": "15",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?page=2",
"label": "pagination.next",
"active": false
}
],
"per_page": 2,
"to": 2,
"total": 30
}

cURL

curl --location 'https://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/districts?province_code=01'