Desarrollador
Offices
traky.offices.list() lee sucursales y bodegas. type las distingue.
Llama a GET /org-api/v1/offices. Scope: organization:read, packages:read o packages:write. type es office (sucursal, se usa como locationId) o warehouse (bodega, se usa como warehouseId). Sin filtro vienen los dos. El precio por libra solo viene en warehouse.
const offices = await traky.offices.list();
const branches = await traky.offices.list({ type: "office" });
const warehouses = await traky.offices.list({ type: "warehouse" });Query
| Atributo | Tipo | Descripción |
|---|---|---|
| type | string | Opcional. office o warehouse. Sin filtro devuelve los dos. |
Atributos
Los textos de dirección pueden venir vacíos. pricePerPoundClient y pricePerPoundProvider solo vienen si type es warehouse. No trae el mapa de racks ni las tarifas por servicio del panel.
| Atributo | Tipo | Descripción |
|---|---|---|
| id | string | UUID. office se envía como locationId. warehouse, como warehouseId. |
| type | string | office o warehouse. |
| name | string | null | Nombre visible. |
| isActive | boolean | True si está activa. |
| isMain | boolean | True si es la sucursal principal. |
| countryCode | string | País ISO, por ejemplo EC. |
| stateOrProvince | string | Provincia o estado. |
| stateCode | string | Código de la provincia o del estado. |
| city | string | Ciudad. |
| cityCode | string | Código de la ciudad. |
| address | string | Dirección. |
| suiteOrApt | string | Oficina, local o apartamento. |
| postalCode | string | Código postal. |
| phoneNumber | string | Teléfono. |
| fax | string | Fax. |
| note | string | Nota interna. |
| pricePerPoundClient | number | Precio por libra al cliente. Solo en warehouse. |
| pricePerPoundProvider | number | Precio por libra al proveedor. Solo en warehouse. |
| createdAt | string | null | Fecha de creación, ISO 8601. |
| updatedAt | string | null | Fecha de actualización, ISO 8601. |
JSON de retorno
{
"data": [
{
"id": "6a1d0c44-8b22-4f90-a113-9e2c4d6b88a1",
"name": "Guayaquil",
"type": "office",
"isActive": true,
"isMain": true,
"countryCode": "EC",
"city": "Guayaquil",
"address": "Av. 9 de Octubre 100"
}
]
}