Skip to content

List administrative areas

GET
/public/stores/{storeRef}/shipping/locations
curl --request GET \
--url 'https://apibase.ecomweb.app/api/v1/public/stores/example/shipping/locations?level=1&parent_code=11' \
--header 'x-storefront-api-key: <x-storefront-api-key>'

Returns administrative areas for address selection. Pass level for one tier (1 = province, 2 = ward) or parent_code for one area’s children; passing neither returns every area. Cached for 24 hours.

storeRef
required
string

The store’s ref, as returned by GET /stores.

level
number
>= 1

Example

1

1 = province, 2 = ward

parent_code
string

Example

11

Return this area’s children

The areas that matched.

Media typeapplication/json
object
country_code
required

ISO 3166-1 alpha-2 code of the country the areas belong to.

string
areas
required

The areas that matched.

Array<object>
object
level
required

Level of the area: 1 for a province, 2 for a ward.

number
code
required

Code of the area.

string
parent_code
required

Code of the parent area, or null for a province.

string
nullable
name
required

Short name of the area.

string
name_with_type
required

Name including its type, such as “Thành phố Hà Nội”.

string
type
required

Type of the area, such as thanh-pho.

string
slug
required

URL-safe name of the area.

string
path
required

Names of the area and its parents, or null.

string
nullable
path_with_type
required

Names of the area and its parents, each with its type, or null.

string
nullable

Example

{
"country_code": "VN",
"areas": [
{
"level": 1,
"code": "11",
"parent_code": null,
"name": "Hà Nội",
"name_with_type": "Thành phố Hà Nội",
"type": "thanh-pho",
"slug": "ha-noi"
}
]
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}