Bodegas
Listar bodegas
GET /api/v1/inventory/warehouses
Respuesta 200:
{
"data": [
{
"id": "uuid",
"name": "Almacén Central",
"code": "WH-MAIN",
"location_type": "warehouse",
"address": {
"line1": "Av. Industrial 456",
"city": "Lima",
"state": "Lima",
"postal_code": "15001",
"country": "PE"
},
"phone": "+51987654321",
"latitude": -12.0464,
"longitude": -77.0428,
"operating_hours": {
"mon": "09:00-18:00",
"tue": "09:00-18:00"
},
"fulfills_online_orders": true,
"allows_pickup": false,
"is_active": true,
"is_default": true
}
]
}
Crear bodega
POST /api/v1/inventory/warehouses
{
"name": "Tienda Miraflores",
"code": "WH-MIRA",
"location_type": "store",
"address": {
"line1": "Av. Larco 789",
"city": "Lima",
"state": "Lima",
"postal_code": "15074",
"country": "PE"
},
"phone": "+51987654321",
"allows_pickup": true,
"is_default": false
}
| Campo | Requerido | Tipo | Descripción |
|---|---|---|---|
name | sí | string | Nombre de la bodega |
code | sí | string | Código único (mayúsculas) |
location_type | no | string | warehouse, store, popup, pickup_point, dropship |
address | no | object | Dirección estructurada |
phone | no | string | Teléfono |
email | no | string | Email de contacto |
latitude | no | float | Coordenada GPS |
longitude | no | float | Coordenada GPS |
operating_hours | no | object | Horarios por día |
fulfills_online_orders | no | bool | Despacha pedidos online |
allows_pickup | no | bool | Permite retiro en tienda |
is_default | no | bool | Bodega por defecto |
Obtener bodega
GET /api/v1/inventory/warehouses/:id
Incluye el stock actual por variante.
Actualizar bodega
PUT /api/v1/inventory/warehouses/:id
Mismos campos que crear.
Eliminar bodega
DELETE /api/v1/inventory/warehouses/:id
Respuesta 204 No Content
Ajustar stock en bodega
POST /api/v1/inventory/warehouses/:id/stock/adjust
Atajo para ajustar stock directamente desde la bodega.
{
"variant_id": "uuid",
"delta": -5,
"reason": "correction",
"note": "Ajuste por inventario físico"
}