
## Create a warehouse

`POST /v1/warehouses`

Creates a new warehouse. Fields are passed flat at the root of the JSON — without a `fields` wrapper.

## Request fields (body)

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

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/warehouses" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Main warehouse",
    "address": "1 Harbour Street, Amsterdam",
    "active": "Y"
  }'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/warehouses" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Main warehouse",
    "address": "1 Harbour Street, Amsterdam",
    "active": "Y"
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/warehouses', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Main warehouse',
    address: '1 Harbour Street, Amsterdam',
    active: 'Y',
  }),
})

const { success, data } = await res.json()
console.log('Warehouse ID:', data.id)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/warehouses', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Main warehouse',
    address: '1 Harbour Street, Amsterdam',
    active: 'Y',
  }),
})

const { success, data } = await res.json()
```

## Response fields

The created warehouse object is returned in the `data` field.

| Field | Type | Description |
|------|-----|---------|
| `id` | number | Warehouse identifier |
| `title` | string | Warehouse name |
| `address` | string | Warehouse address |
| `active` | string | Active flag: `"Y"` / `"N"` |
| `issuingCenter` | string | Order pickup point flag: `"Y"` / `"N"` |
| `description` | string \| null | Warehouse description. `null` if not set |
| `phone` | string \| null | Contact phone. `null` if not set |
| `email` | string \| null | Contact email. `null` if not set |
| `schedule` | string \| null | Working hours. `null` if not set |
| `sort` | number | Sort order |
| `code` | string \| null | Symbolic code. `null` if not set |
| `xmlId` | string \| null | External identifier. `null` if not set |
| `gpsN` | number \| null | Geographic latitude. `null` if not set |
| `gpsS` | number \| null | Geographic longitude. `null` if not set |
| `imageId` | object \| null | Warehouse image: `{ "id", "url" }` or `null` |
| `userId` | number | Responsible employee |
| `modifiedBy` | number | Identifier of the user who last modified the warehouse |
| `dateCreate` | datetime | Creation date |
| `dateModify` | datetime | Last modification date |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 25,
    "title": "Main warehouse",
    "address": "1 Harbour Street, Amsterdam",
    "active": "Y",
    "issuingCenter": "N",
    "description": null,
    "phone": null,
    "email": null,
    "schedule": null,
    "sort": 100,
    "code": null,
    "xmlId": null,
    "gpsN": null,
    "gpsS": null,
    "imageId": null,
    "userId": 1,
    "modifiedBy": 1,
    "dateCreate": "2026-06-02T12:04:24+00:00",
    "dateModify": "2026-06-02T12:04:24+00:00"
  }
}
```

## Error response example

400 — a required field was not provided:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_PARAMS",
    "message": "Required: title (string), address (string)"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `MISSING_PARAMS` | `title` or `address` was not provided |
| 400 | `INVALID_PARAMS` | `title` or `address` is not a string |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the creation (for example, an invalid field value) |

The full list of common API errors — [Errors](/docs/errors).

## Known specifics

**Default values.** If `active`, `sort`, and `issuingCenter` are not provided, the warehouse is created with the values `active: "Y"`, `sort: 100`, `issuingCenter: "N"`. The `userId` and `modifiedBy` fields in the response are set to the user the API key was issued for.

## See also

- [List warehouses](/docs/entities/warehouses/list)
- [Update a warehouse](/docs/entities/warehouses/update)
- [Delete a warehouse](/docs/entities/warehouses/delete)
- [Entities reference](/docs/entities-index)
