# Warehouse Endpoints {#warehouse-endpoints}


Manage warehouses, warehouse products, and product variant inventory.


## Base Path {#base-path}


```
/api/warehouses
```


## Endpoints {#endpoints}



### List Warehouses {#list-warehouses}


```
GET /api/warehouses
Authorization: Bearer {token}
```


### Get Warehouse by ID {#get-warehouse-by-id}


```
GET /api/warehouses/:id
Authorization: Bearer {token}
```


### Create Warehouse {#create-warehouse}


```
POST /api/warehouses
Authorization: Bearer {token}
Content-Type: application/json

{
  "name": "Main Warehouse",
  "code": "WH001",
  "email": "warehouse@example.com",
  "description": "Primary storage facility",
  "active": true,
  "organizationId": "uuid",
  "contact": {
    "name": "Warehouse Manager",
    "phone": "+1-555-0123"
  }
}
```


### Update Warehouse {#update-warehouse}


```
PUT /api/warehouses/:id
Authorization: Bearer {token}
Content-Type: application/json

{
  "name": "Updated Warehouse Name",
  "active": false
}
```


### Delete Warehouse {#delete-warehouse}


```
DELETE /api/warehouses/:id
Authorization: Bearer {token}
```


## Data Model {#data-model}


```typescript
interface IWarehouse {
  id: string;
  name: string;
  code: string;
  email?: string;
  description?: string;
  active: boolean;
  logo?: string;

  // Relations
  contact?: IContact;
  products?: IWarehouseProduct[];
  tags?: ITag[];
  organizationId: string;
  tenantId: string;
}

interface IWarehouseProduct {
  id: string;
  quantity: number;
  warehouseId: string;
  productId: string;
  product?: IProduct;
  variants?: IWarehouseProductVariant[];
}

interface IWarehouseProductVariant {
  id: string;
  quantity: number;
  warehouseProductId: string;
  variantId: string;
  variant?: IProductVariant;
}
```


## Related Pages {#related-pages}


- [Inventory Feature](https://sourcey-gauzy.pages.dev/features/inventory/index.md) — inventory management
- [Products & Inventory](https://sourcey-gauzy.pages.dev/features/products-and-inventory/index.md) — product management
- Warehousing Feature — warehousing guide
