API Get Ward
Get GHN ward/province data. This API provides Ward Code to create shipping order.
Caution : The API Get Ward need to infusion token in header
post/gethttps://online-gateway.ghn.vn/shiip/public-api/master-data/ward?district_id
https://dev-online-gateway.ghn.vn/shiip/public-api/master-data/ward?district_id
curl --location --request POST 'https://dev-online-gateway.ghn.vn/shiip/public-api/master-data/ward?district_id' \
--header 'token: 637170d5-942b-11ea-9821-0281a26fb5d4' \
--header 'Content-Type: application/json' \
--data-raw'{"district_id":1566}'
Parameter
Field | Type | Description |
---|---|---|
token | String |
Must be sent with all client requests. This Token helps server to validate request source. Provided by GHN. |
district_id | Int |
DistrictID provied by GHN. API Get DistrictID : https://api.ghn.vn/home/docs/detail?id=78 |
{
"code": 200,
"message": "Success",
"data": {
"WardCode":510101
"DistrictID":1566
"WardName":"Phường Mỹ Bình"
}
{
"WardCode":510102
"DistrictID":1566
"WardName":"Phường Mỹ Long"
}
{
"WardCode":510103
"DistrictID":1566
"WardName":"Phường Đông Xuyên"
}
{
"WardCode":510104
"DistrictID":1566
"WardName":"Phường Mỹ Xuyên"
}
....
}
Structure Response
Field | Description |
---|---|
WardCode |
Ward Code ID |
DistrictID |
District ID |
WardName |
Ward Name |
NameExtension |
Name Extension |
CanUpdateCOD |
Can Update COD
|
SupportType |
Type
|
Status |
Status
|
CreatedDate |
Created Date |
UpdatedDate |
Updated Date |
{
"code": 404,
"message": "code=404, message=Not Found",
"data": null
}