List administrative areas
const url = 'https://apibase.ecomweb.app/api/v1/public/stores/example/shipping/locations?level=1&parent_code=11';const options = {method: 'GET', headers: {'x-storefront-api-key': '<x-storefront-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Query Parameters
Section titled “Query Parameters”Example
11 = province, 2 = ward
Example
11Return this area’s children
Responses
Section titled “Responses”The areas that matched.
object
ISO 3166-1 alpha-2 code of the country the areas belong to.
The areas that matched.
object
Level of the area: 1 for a province, 2 for a ward.
Code of the area.
Code of the parent area, or null for a province.
Short name of the area.
Name including its type, such as “Thành phố Hà Nội”.
Type of the area, such as thanh-pho.
URL-safe name of the area.
Names of the area and its parents, or null.
Names of the area and its parents, each with its type, or null.
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.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
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.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}