Localities & Regions
Check if a customer's location is covered before they check out. Use the same region and comuna data you see in your panel to validate addresses.
How it works
Chile has 16 regions, each with multiple comunas. When syncing an order, you identify the destination comuna in the destination_locality field - the same locations shown in your panel dropdowns.
Region (e.g., "Metropolitana de Santiago")
└── Locality (e.g., "Santiago")
└── Locality (e.g., "Providencia")
└── Locality (e.g., "Las Condes")
...
Regions
Regions are the top-level geographic divisions. Each region has:
| Field | Type | Description |
|---|---|---|
id | integer | Unique region identifier |
name | string | Region name |
slug | string | URL-friendly identifier |
localities_count | integer | Number of comunas in this region |
Example Regions
| Name | Slug |
|---|---|
| Arica y Parinacota | arica-y-parinacota |
| Tarapacá | tarapaca |
| Antofagasta | antofagasta |
| Atacama | atacama |
| Coquimbo | coquimbo |
| Valparaíso | valparaiso |
| Metropolitana | metropolitana-de-santiago |
| O'Higgins | ohiggins |
| Maule | maule |
| Ñuble | nuble |
| Biobío | biobio |
| La Araucanía | la-araucania |
| Los Ríos | los-rios |
| Los Lagos | los-lagos |
| Aysén | aysen |
| Magallanes | magallanes |
Comunas
Comunas (localities) are the delivery areas within each region. Each has:
| Field | Type | Description |
|---|---|---|
id | integer | Unique locality identifier |
name | string | Locality name |
slug | string | URL-friendly identifier |
type | string | urban, rural or both |
region_id | integer | The region it belongs to |
aliases | array | Alternative spellings that are also matched when you send a name |
Name or id — both work
destination_locality on POST /orders/create (and on POST /rates/quote) accepts either form:
- The name (or an alias). Matching ignores case and accents, so
"Nunoa"resolves toÑuñoa. If nothing matches you get a404withLocality not found: …. - The numeric id, sent as a string:
"2", not2. Ids come fromGET /localitiesor from a previous quote'slocality_id. Prefer this once you have mapped your addresses — it can't be misread.
By name
{
"destination_address": "Calle Principal 123",
"destination_locality": "Providencia"
}
By id
{
"destination_address": "Calle Principal 123",
"destination_locality": "2"
}
Fetch the full list of comunas once and cache it. This data rarely changes.
Check coverage before you create
Your account delivers to a configured set of comunas. An order to a comuna outside that set is rejected with a 422 (Merchant … has no coverage for locality: …) - after the customer has already checked out, if you don't validate earlier.
Call POST /rates/quote with the destination and weight while the customer is still in your checkout. It runs the same locality resolution and coverage check as order creation and returns the price and transit time, so you can show the shipping cost and block uncovered addresses up front.