Skip to main content

Get List Provinces

Use this api to get List Provinces by code

URL : api-auth/v2/provinces

Method : GET

Validate :

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

Example : https://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/provinces?codes[]=01&codes[]=02

Success Response

Code : 200 OK

Content example

{
"result": "success",
"error": "",
"errorCode": "",
"current_page": 1,
"data": [
{
"province_id": 1,
"province_name": "Thành phố Hà Nội",
"province_code": "01"
},
{
"province_id": 2,
"province_name": "Tỉnh Hà Giang",
"province_code": "02"
}
],
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "pagination.previous",
"active": false
},
{
"url": "http://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/provinces?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "pagination.next",
"active": false
}
],
"per_page": 256,
"to": 2,
"total": 2
}

cURL

curl --location --globoff 'https://api-gateway.develop.pharmacity.io/pmc-ecm-store-service/api-auth/v2/provinces?codes[]=01&codes[]=02'