
## Warehouse fields

`GET /v1/warehouses/fields`

Returns the warehouse field schema: for each of the 19 fields — its type, a read-only flag, a human-readable label, and a description. Useful for code generation and AI-agent hints.

Warehouses use a custom route without an entity schema, so the field reference is served from a static table and **does not call Bitrix24** — the `catalog` scope is checked, but no Bitrix24 account tokens are required.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/warehouses/fields" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/warehouses/fields" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/warehouses/fields', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Warehouse fields:', Object.keys(data.fields))
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/warehouses/fields', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()
console.log('Warehouse fields:', Object.keys(data.fields))
```

## Response fields

`data.fields` is an object keyed by field name; each value is `{ type, readonly, label, description }`.

The `label` and `description` values are returned in English. Request headers do not switch the language.

| Field | Type | RO | Description |
|------|-----|----|---------|
| `id` | number | yes | Warehouse ID from the [warehouse list](./list.md) |
| `title` | string | | Warehouse name |
| `address` | string | | Warehouse address |
| `active` | string | | Active flag: `"Y"` / `"N"` |
| `issuingCenter` | string | | Order pickup point flag: `"Y"` / `"N"` |
| `description` | string | | Warehouse description. `null` when unset |
| `phone` | string | | Contact phone. `null` when unset |
| `email` | string | | Contact email. `null` when unset |
| `schedule` | string | | Working hours. `null` when unset |
| `sort` | number | | Sort order |
| `code` | string | | Symbolic code. `null` when unset |
| `xmlId` | string | | External identifier. `null` when unset |
| `gpsN` | number | | Geographic latitude. `null` when unset |
| `gpsS` | number | | Geographic longitude. `null` when unset |
| `imageId` | object | yes | Warehouse image: `{ id, url }` or `null` |
| `userId` | number | | Responsible employee ID from the [user list](/docs/entities/users/list). `null` on system warehouses |
| `modifiedBy` | number | yes | ID of the user who last modified the warehouse, from the [user list](/docs/entities/users/list). `null` on system warehouses |
| `dateCreate` | datetime | yes | Creation date. `null` on some system warehouses |
| `dateModify` | datetime | yes | Last modification date |

RO means `readonly: true`: the field is set by the platform and is not accepted on create or update.

## Response example

```json
{
  "success": true,
  "data": {
    "fields": {
      "id": {"type": "number", "readonly": true, "label": "ID", "description": "Warehouse (store) identifier."},
      "title": {"type": "string", "readonly": false, "label": "Title", "description": "Warehouse name."},
      "address": {"type": "string", "readonly": false, "label": "Address", "description": "Warehouse address."},
      "active": {"type": "string", "readonly": false, "label": "Active", "description": "Whether the warehouse is active: \"Y\" / \"N\"."},
      "issuingCenter": {"type": "string", "readonly": false, "label": "Issuing center", "description": "Order pickup point flag: \"Y\" / \"N\"."},
      "description": {"type": "string", "readonly": false, "label": "Description", "description": "Warehouse description. null when unset."},
      "phone": {"type": "string", "readonly": false, "label": "Phone", "description": "Contact phone. null when unset."},
      "email": {"type": "string", "readonly": false, "label": "Email", "description": "Contact email. null when unset."},
      "schedule": {"type": "string", "readonly": false, "label": "Schedule", "description": "Working hours, free-form text. null when unset."},
      "sort": {"type": "number", "readonly": false, "label": "Sort", "description": "Sort order."},
      "code": {"type": "string", "readonly": false, "label": "Code", "description": "Symbolic code. null when unset."},
      "xmlId": {"type": "string", "readonly": false, "label": "External ID", "description": "External identifier for synchronization. null when unset."},
      "gpsN": {"type": "number", "readonly": false, "label": "Latitude", "description": "Geographic latitude. null when unset."},
      "gpsS": {"type": "number", "readonly": false, "label": "Longitude", "description": "Geographic longitude. null when unset."},
      "imageId": {"type": "object", "readonly": true, "label": "Image", "description": "Warehouse image: { id, url } or null."},
      "userId": {"type": "number", "readonly": false, "label": "Responsible user", "description": "Responsible employee — an id from GET /v1/users. null on system warehouses."},
      "modifiedBy": {"type": "number", "readonly": true, "label": "Modified by", "description": "Id of the user who last modified the warehouse. null on system warehouses."},
      "dateCreate": {"type": "datetime", "readonly": true, "label": "Created at", "description": "Creation date. null on some system warehouses."},
      "dateModify": {"type": "datetime", "readonly": true, "label": "Modified at", "description": "Last modification date."}
    }
  }
}
```

## Error response example

401 — no API key provided:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_API_KEY",
    "message": "API key required. Pass via X-Api-Key header."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 403 | `SCOPE_DENIED` | API key lacks the `catalog` scope |

See the full list of common API errors in [Errors](/docs/errors).

## See also

- [List warehouses](/docs/entities/warehouses/list)
- [Create a warehouse](/docs/entities/warehouses/create)
- [API reference](/docs/api-reference)
