Skip to main content

Province

Shop owners can specify which country or countries they will ship to and these countries are made available through the API using the province resource.

States and provinces are represented by the province resource. We use the term "province" to cover both.

Authenticated access scopes: com.read_shop

What you can do with Province

The Haravan API lets you do the following with the Province resource.

Province properties

code: string

"code": "1001"

The standard abbreviation for the state or province.

country_id: int

"country_id": 704

The unique numeric identifier for the country.

id: number

"id": 1

The unique numeric identifier for the state or province.

name: string

"name": "Thành phố Hà Nội"

The full name of the state or province.

tax: decimal

"tax": 0.08

The national sales tax rate to be applied to orders made by customers from that province or state.

tax_name: string

"tax_name": null

The name of the tax for that province or state.

tax_type: string

"tax_type": null

Compounded sales tax.

tax_percentage : string

"tax_percentage ": null

The province or state's tax in percent format.

Endpoints



Retrieves all province for a country

GET
https://apis.haravan.com/com/countries/{country_id}/provinces.json

Parameters


country_id

The id of the country the province belongs to.


since_id

Restrict results to after the specified ID


fields

comma-separated list of fields to include in the response.


Retrieve all provinces for a country.

  • GET https://apis.haravan.com/com/countries/704/provinces.json

Response:

Details
{
"provinces": [
{
"code": "1079",
"country_id": 704,
"id": 5103,
"name": "Thành phố Hồ Chí Minh",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1001",
"country_id": 704,
"id": 5076,
"name": "Thành phố Hà Nội",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1048",
"country_id": 704,
"id": 5096,
"name": "Thành phố Đà Nẵng",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1004",
"country_id": 704,
"id": 5077,
"name": "Cao Bằng",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1008",
"country_id": 704,
"id": 5078,
"name": "Tuyên Quang",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1011",
"country_id": 704,
"id": 5079,
"name": "Điện Biên",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1012",
"country_id": 704,
"id": 5080,
"name": "Lai Châu",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1014",
"country_id": 704,
"id": 5081,
"name": "Sơn La",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1015",
"country_id": 704,
"id": 5082,
"name": "Lào Cai",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1019",
"country_id": 704,
"id": 5083,
"name": "Thái Nguyên",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1020",
"country_id": 704,
"id": 5084,
"name": "Lạng Sơn",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1022",
"country_id": 704,
"id": 5085,
"name": "Quảng Ninh",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1024",
"country_id": 704,
"id": 5086,
"name": "Bắc Ninh",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1025",
"country_id": 704,
"id": 5087,
"name": "Phú Thọ",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1031",
"country_id": 704,
"id": 5088,
"name": "Hải Phòng",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1033",
"country_id": 704,
"id": 5089,
"name": "Hưng Yên",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1037",
"country_id": 704,
"id": 5090,
"name": "Ninh Bình",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1038",
"country_id": 704,
"id": 5091,
"name": "Thanh Hóa",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1040",
"country_id": 704,
"id": 5092,
"name": "Nghệ An",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1042",
"country_id": 704,
"id": 5093,
"name": "Hà Tĩnh",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1044",
"country_id": 704,
"id": 5094,
"name": "Quảng Trị",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1046",
"country_id": 704,
"id": 5095,
"name": "Thành phố Huế",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1051",
"country_id": 704,
"id": 5097,
"name": "Quảng Ngãi",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1052",
"country_id": 704,
"id": 5098,
"name": "Gia Lai",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1056",
"country_id": 704,
"id": 5099,
"name": "Khánh Hòa",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1066",
"country_id": 704,
"id": 5100,
"name": "Đắk Lắk",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1068",
"country_id": 704,
"id": 5101,
"name": "Lâm Đồng",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1075",
"country_id": 704,
"id": 5102,
"name": "Đồng Nai",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1080",
"country_id": 704,
"id": 5104,
"name": "Tây Ninh",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1082",
"country_id": 704,
"id": 5105,
"name": "Đồng Tháp",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1086",
"country_id": 704,
"id": 5106,
"name": "Vĩnh Long",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1091",
"country_id": 704,
"id": 5107,
"name": "An Giang",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1092",
"country_id": 704,
"id": 5108,
"name": "Thành phố Cần Thơ",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
},
{
"code": "1096",
"country_id": 704,
"id": 5109,
"name": "Cà Mau",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
}
]
}


Retrieve a count of all provinces for a country

GET
https://apis.haravan.com/com/countries/{country_id}/provinces/count.json

Retrieve a count all provinces for a country.

  • GET https://apis.haravan.com/com/countries/704/provinces/count.json

Response:

Details
HTTP/1.1 200 OK
{
"count": 34
}


Retrieves single province

GET
https://apis.haravan.com/com/countries/{country_id}/provinces/{province_id}.json

Retrieves a single province for a country.

  • GET https://apis.haravan.com/com/countries/704/provinces/5103.json

Response:

Details
{
"province": {
"code": "1079",
"country_id": 704,
"id": 5103,
"name": "Thành phố Hồ Chí Minh",
"tax": null,
"tax_name": null,
"tax_type": null,
"tax_percentage": null
}
}