Sucursales
Las sucursales del workspace, y la dirección con la que se muestran.
Descarga la proyección completa de la API pública: openapi.json.
Configurar tus sucursales explica este recurso en prosa, con ejemplos ejecutables.
| Método | Ruta | Qué hace |
|---|---|---|
GET | /locations | List locations (branches / stores / clinics / offices) |
POST | /locations | Create a location |
DELETE | /locations/{id} | Soft-delete a location |
GET | /locations/{id} | Get a location (uuid or B- display id) |
PATCH | /locations/{id} | Update a location (is_active=false soft-deletes) |
GET /locations
List locations (branches / stores / clinics / offices)
Every location this workspace has, active first. Pass include_inactive=true to also see soft-deleted (is_active: false) locations — useful for a picker that must still resolve a record filed at a closed location. Readable with tenant:read or marketplace:read, so a stock integration can resolve the location_id it sets and filters vehicles by.
| Parámetro | En | Tipo | Obligatorio | Restricciones |
|---|---|---|---|---|
include_inactive | query | string | no |
curl https://api.vitrinadev.com/api/v1/locations \
-H "Authorization: Bearer $VITRINA_KEY"Ejemplo de respuesta (200)
{
"data": [
{
"id": "b1b1b1b1-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Sucursal Providencia",
"address": null,
"address_street": "Av. Nueva Providencia",
"address_number": "2214",
"address_unit": null,
"comuna_code": "13123",
"region_code": "13",
"address_source": "manual",
"phone": "+56229876543",
"email": "[email protected]",
"manager_name": "Carolina Muñoz",
"hours": {
"lun_vie": "09:00-19:00",
"sab": "10:00-14:00"
},
"timezone": "America/Santiago",
"geo": null,
"notes": null,
"arrival_info": null,
"metadata": {},
"is_active": true,
"display_seq": 1,
"display_id": "B-1",
"created_at": "2026-09-15T18:34:09.375Z",
"updated_at": "2026-09-15T18:34:26.470Z"
},
{
"id": "b1b1b1b1-0000-4000-8000-000000000002",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Sucursal Maipú",
"address": null,
"address_street": "Av. Pajaritos",
"address_number": "3050",
"address_unit": null,
"comuna_code": "13119",
"region_code": "13",
"address_source": "manual",
"phone": "+56225551212",
"email": null,
"manager_name": null,
"hours": null,
"timezone": null,
"geo": null,
"notes": null,
"arrival_info": null,
"metadata": {},
"is_active": true,
"display_seq": 2,
"display_id": "B-2",
"created_at": "2026-09-15T18:34:09.375Z",
"updated_at": "2026-09-15T18:34:26.470Z"
},
{
"id": "b1b1b1b1-0000-4000-8000-000000000003",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Sucursal Vitacura",
"address": null,
"address_street": null,
"address_number": null,
"address_unit": null,
"comuna_code": "13132",
"region_code": "13",
"address_source": "manual",
"phone": null,
"email": null,
"manager_name": null,
"hours": null,
"timezone": null,
"geo": null,
"notes": null,
"arrival_info": null,
"metadata": {},
"is_active": true,
"display_seq": 3,
"display_id": "B-3",
"created_at": "2026-09-15T18:34:09.375Z",
"updated_at": "2026-09-15T18:34:26.470Z"
}
]
}Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429
POST /locations
Create a location
The comuna is a code (comuna_code, the official 5-digit SUBDERE/INE CUT), never a name — the región is derived from it server-side. Assigns the next display_id (B-1, B-2, …) for this workspace.
Cuerpo
| Campo | Tipo | Obligatorio | Restricciones |
|---|---|---|---|
name | string | sí | mín. 1, máx. 200 |
address | string | null | — | máx. 500 |
address_street | string | null | — | máx. 200 |
address_number | string | null | — | máx. 40 |
address_unit | string | null | — | máx. 60 |
comuna_code | string | null | — | patrón ^[0-9]{5}$ |
phone | string | null | — | máx. 60 |
email | string | null | — | email, máx. 200 |
manager_name | string | null | — | máx. 200 |
hours | object | null | — | |
timezone | string | null | — | máx. 80 |
geo | object | null | — | |
notes | string | null | — | máx. 5000 |
arrival_info | object | null | — | |
metadata | object | — |
curl -X POST https://api.vitrinadev.com/api/v1/locations \
-H "Authorization: Bearer $VITRINA_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sucursal Las Condes",
"address_street": "Av. Apoquindo",
"address_number": "4500",
"comuna_code": "13114",
"phone": "+56221234567",
"email": "[email protected]",
"manager_name": "Felipe Rojas",
"hours": {
"lun_vie": "09:00-19:00",
"sab": "10:00-14:00"
},
"timezone": "America/Santiago"
}'Ejemplo de respuesta (201)
{
"data": {
"id": "b1b1b1b1-0000-4000-8000-000000000004",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Sucursal Las Condes",
"address": null,
"address_street": "Av. Apoquindo",
"address_number": "4500",
"address_unit": null,
"comuna_code": "13114",
"region_code": "13",
"address_source": "manual",
"phone": "+56221234567",
"email": "[email protected]",
"manager_name": "Felipe Rojas",
"hours": {
"lun_vie": "09:00-19:00",
"sab": "10:00-14:00"
},
"timezone": "America/Santiago",
"geo": null,
"notes": null,
"arrival_info": null,
"metadata": {},
"is_active": true,
"display_seq": 4,
"display_id": "B-4",
"created_at": "2026-09-15T18:34:09.375Z",
"updated_at": "2026-09-15T18:34:26.470Z"
}
}Responde: 201 · 400 · 401 · 403 · 404 · 409 · 429
DELETE /locations/{id}
Soft-delete a location
Equivalent to PATCH /locations/\{id\} with \{ is_active: false \} — nothing is erased and the location remains resolvable by id or display id.
| Parámetro | En | Tipo | Obligatorio | Restricciones |
|---|---|---|---|---|
id | path | string | sí | mín. 1, máx. 80 |
curl -X DELETE https://api.vitrinadev.com/api/v1/locations/<id> \
-H "Authorization: Bearer $VITRINA_KEY"Responde: 204 · 400 · 401 · 403 · 404 · 409 · 429
GET /locations/{id}
Get a location (uuid or B- display id)
Accepts the record’s uuid or its display_id (B-1, B-2, …) — a documented lookup shortcut (ADR 0106 §2.5); the response always carries both.
| Parámetro | En | Tipo | Obligatorio | Restricciones |
|---|---|---|---|---|
id | path | string | sí | mín. 1, máx. 80 |
curl https://api.vitrinadev.com/api/v1/locations/<id> \
-H "Authorization: Bearer $VITRINA_KEY"Ejemplo de respuesta (200)
{
"data": {
"id": "b1b1b1b1-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Sucursal Providencia",
"address": null,
"address_street": "Av. Nueva Providencia",
"address_number": "2214",
"address_unit": null,
"comuna_code": "13123",
"region_code": "13",
"address_source": "manual",
"phone": "+56229876543",
"email": "[email protected]",
"manager_name": "Carolina Muñoz",
"hours": {
"lun_vie": "09:00-19:00",
"sab": "10:00-14:00"
},
"timezone": "America/Santiago",
"geo": null,
"notes": null,
"arrival_info": null,
"metadata": {},
"is_active": true,
"display_seq": 1,
"display_id": "B-1",
"created_at": "2026-09-15T18:34:09.375Z",
"updated_at": "2026-09-15T18:34:26.470Z"
}
}Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429
PATCH /locations/{id}
Update a location (is_active=false soft-deletes)
Partial update — every field is optional. Setting is_active: false is the soft-delete this family uses instead of DELETE for anything already referenced elsewhere (inventory, appointments, records filed against it); the row and its display_id stay resolvable, just excluded from the default list.
| Parámetro | En | Tipo | Obligatorio | Restricciones |
|---|---|---|---|---|
id | path | string | sí | mín. 1, máx. 80 |
Cuerpo
| Campo | Tipo | Obligatorio | Restricciones |
|---|---|---|---|
name | string | — | mín. 1, máx. 200 |
address | string | null | — | máx. 500 |
address_street | string | null | — | máx. 200 |
address_number | string | null | — | máx. 40 |
address_unit | string | null | — | máx. 60 |
comuna_code | string | null | — | patrón ^[0-9]{5}$ |
phone | string | null | — | máx. 60 |
email | string | null | — | email, máx. 200 |
manager_name | string | null | — | máx. 200 |
hours | object | null | — | |
timezone | string | null | — | máx. 80 |
geo | object | null | — | |
notes | string | null | — | máx. 5000 |
arrival_info | object | null | — | |
metadata | object | — | |
is_active | boolean | — |
curl -X PATCH https://api.vitrinadev.com/api/v1/locations/<id> \
-H "Authorization: Bearer $VITRINA_KEY" \
-H "Content-Type: application/json" \
-d '{
"is_active": false
}'Ejemplo de respuesta (200)
{
"data": {
"id": "b1b1b1b1-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Sucursal Providencia",
"address": null,
"address_street": "Av. Nueva Providencia",
"address_number": "2214",
"address_unit": null,
"comuna_code": "13123",
"region_code": "13",
"address_source": "manual",
"phone": "+56229876543",
"email": "[email protected]",
"manager_name": "Carolina Muñoz",
"hours": {
"lun_vie": "09:00-19:00",
"sab": "10:00-14:00"
},
"timezone": "America/Santiago",
"geo": null,
"notes": null,
"arrival_info": null,
"metadata": {},
"is_active": false,
"display_seq": 1,
"display_id": "B-1",
"created_at": "2026-09-15T18:34:09.375Z",
"updated_at": "2026-09-15T18:34:26.470Z"
}
}Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429