# Warehouses

Bitrix24 account warehouses and product stock in them. A warehouse is a point where catalog products are stored or handed out: a physical warehouse, a store, or a pickup point. Warehouses can be created, updated, and deleted. Stock is read-only — for a single warehouse or aggregated across all warehouses.

Bitrix24 API: `catalog.store.*`, `catalog.storeproduct.*`
Scope: `catalog`

## Operations

- [Create a warehouse](./warehouses/create.md) — `POST /v1/warehouses`
- [List warehouses](./warehouses/list.md) — `GET /v1/warehouses`
- [Get a warehouse](./warehouses/get.md) — `GET /v1/warehouses/:id`
- [Update a warehouse](./warehouses/update.md) — `PATCH /v1/warehouses/:id`
- [Delete a warehouse](./warehouses/delete.md) — `DELETE /v1/warehouses/:id`
- [Warehouse stock](./warehouses/stock.md) — `GET /v1/warehouses/:id/stock`
- [Aggregated product stock](./warehouses/stock-totals.md) — `GET /v1/warehouses/stock/totals`

## Fields

### Editable fields

Accepted on [create](./warehouses/create.md) and [update](./warehouses/update.md). Passed at the root of the JSON.

| Field | Type | Description |
|------|-----|---------|
| `title` | string | Warehouse name. Required on create |
| `address` | string | Warehouse address. Required on create |
| `active` | string | Active flag: `"Y"` or `"N"`. Defaults to `"Y"` |
| `issuingCenter` | string | Order pickup point flag: `"Y"` or `"N"`. Defaults to `"N"` |
| `description` | string | Warehouse description |
| `phone` | string | Contact phone |
| `email` | string | Contact email |
| `schedule` | string | Working hours — free-form text |
| `sort` | number | Sort order. Defaults to `100` |
| `code` | string | Symbolic code |
| `xmlId` | string | External identifier for syncing with external systems |
| `gpsN` | number | Geographic latitude |
| `gpsS` | number | Geographic longitude |
| `userId` | number | Responsible employee — identifier from [`GET /v1/users`](/docs/entities/users) |

### Read-only

Returned in the response but not accepted on create or update.

| Field | Type | Description |
|------|-----|---------|
| `id` | number | Warehouse identifier |
| `imageId` | object \| null | Warehouse image in the format `{ "id": number, "url": string }` or `null` |
| `modifiedBy` | number \| null | ID of the user who last modified the warehouse. `null` for system warehouses; filled in when created via the API |
| `dateCreate` | datetime \| null | Creation date. `null` for some system warehouses (for example, marketplaces) |
| `dateModify` | datetime | Last modification date |

## What to know before you start

1. **The request body is flat.** On create and update, pass fields directly at the root of the JSON: `{"title": "...", "address": "..."}`. No `fields` wrapper is needed.
2. **Two fields are required to create.** Without `title` or `address`, the response is `400 MISSING_PARAMS`. The remaining fields are optional: when omitted, they are filled with default values (`active: "Y"`, `sort: 100`, `issuingCenter: "N"`).
3. **A nonexistent warehouse is a `422` error.** Getting, updating, or deleting a warehouse by an unknown `id` returns `422` with code `BITRIX_ERROR`, not `404`. You can check whether a warehouse exists via the [list of warehouses](./warehouses/list.md).
4. **Stock is read-only.** Product quantities in a warehouse cannot be changed through this section: [warehouse stock](./warehouses/stock.md) and [aggregated stock](./warehouses/stock-totals.md) are read operations. Stock is changed by inventory documents on the Bitrix24 account side.
5. **Aggregated stock is aggregated per product.** [`GET /v1/warehouses/stock/totals`](./warehouses/stock-totals.md) sums one product's quantity across all warehouses and returns the list of warehouses (`storeIds`) where the product is present.

## Typical scenario

1. Get the list of warehouses: [`GET /v1/warehouses`](./warehouses/list.md) — take the `id` of the warehouse you need.
2. View stock in the warehouse: [`GET /v1/warehouses/:id/stock`](./warehouses/stock.md).
3. Aggregate one product's stock across all warehouses: [`GET /v1/warehouses/stock/totals?productId=200`](./warehouses/stock-totals.md).

## Related entities

| Entity | Endpoint | Purpose |
|----------|----------|-----------|
| Catalog products | [`GET /v1/catalog-products`](/docs/entities/catalog-products) | Products whose stock is tracked in warehouses. The `productId` field in [stock](./warehouses/stock.md) and [aggregated stock](./warehouses/stock-totals.md) references a catalog product. |

## Limits

| Limit | Value |
|-------|----------|
| Maximum records per request | 5000 (`limit ≤ 5000`) |
| Auto-pagination | enabled when `limit > 50` |
| `offset` on large selections | `limit ≤ 500` recommended when `offset ≥ 2500` |
| Batch requests | up to 50 operations in [`POST /v1/batch`](/docs/batch) |
| Rate limit | shared across the Vibecode API — see [Limits and optimization](/docs/optimization) |

## See also

- [Catalog products](/docs/entities/catalog-products)
- [Catalogs](/docs/entities/catalogs)
- [Filtering syntax](/docs/filtering)
- [Entities reference](/docs/entities-index)
