
## Product fields

`GET /v1/products/fields`

Returns the product field schema: 21 standard fields and custom catalog properties of the form `PROPERTY_<N>` configured on the Bitrix24 account. For each field, the type and the read-only flag are given.

## Examples

### curl — personal key

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

### curl — OAuth app

```bash
curl "https://vibecode.bitrix24.com/v1/products/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/products/fields', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

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

### JavaScript — OAuth app

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

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

## Standard fields

Each field is described by an object `{ type, readonly }` and is returned in camelCase in the `list`, `get`, `search`, `create`, `update` responses.

| Field | Bitrix24 | Type | RO | Description |
|------|----------|-----|:--:|---------|
| `id` | `ID` | number | yes | Product identifier |
| `name` | `NAME` | string | | Product name |
| `active` | `ACTIVE` | boolean | | Whether the product is active |
| `price` | `PRICE` | number | | Product price |
| `currency` | `CURRENCY_ID` | string | | Price currency. List: `GET /v1/currencies` |
| `sectionId` | `SECTION_ID` | number | | Catalog section. List: `GET /v1/product-sections` |
| `catalogId` | `CATALOG_ID` | number | | Catalog identifier. List: `GET /v1/catalogs` |
| `measure` | `MEASURE` | number | | Measurement unit identifier |
| `description` | `DESCRIPTION` | string | | Product description |
| `descriptionType` | `DESCRIPTION_TYPE` | string | | Description format — `text` or `html` |
| `sort` | `SORT` | number | | Sort order. A lower value is higher |
| `code` | `CODE` | string | | Symbolic product code |
| `xmlId` | `XML_ID` | string | | External identifier for synchronization |
| `vatId` | `VAT_ID` | number | | VAT rate identifier |
| `vatIncluded` | `VAT_INCLUDED` | boolean | | Whether VAT is included in the price |
| `previewPicture` | `PREVIEW_PICTURE` | object | yes | Image for the list |
| `detailPicture` | `DETAIL_PICTURE` | object | yes | Image for the card |
| `createdBy` | `CREATED_BY` | number | yes | Creator identifier. List: `GET /v1/users` |
| `modifyBy` | `MODIFIED_BY` | number | yes | Identifier of the last editor. List: `GET /v1/users` |
| `createdAt` | `DATE_CREATE` | datetime | yes | Creation date |
| `updatedAt` | `TIMESTAMP_X` | datetime | yes | Last modification date |

## Custom properties

Catalog properties come back as additional keys of the form `PROPERTY_<N>` with the type `product_property`. Each is described by an object `{ type, readonly, label }`, where `label` is the property name in the Bitrix24 account language. The property set depends on the catalog settings: one Bitrix24 account may return "SKU", "Manufacturer", "Color", another its own list. The values of these properties are returned in the [`GET /v1/products/:id`](/docs/entities/products/get) response.

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.fields` | object | Field map. The key is the field name, the value is `{ type, readonly }`, with an additional `label` for properties |

## Response example

A subset of fields is shown. The actual number of `PROPERTY_<N>` properties depends on the catalog settings on the Bitrix24 account.

```json
{
  "success": true,
  "data": {
    "fields": {
      "id": { "type": "number", "readonly": true },
      "name": { "type": "string", "readonly": false },
      "active": { "type": "boolean", "readonly": false },
      "price": { "type": "number", "readonly": false },
      "currency": { "type": "string", "readonly": false },
      "sectionId": { "type": "number", "readonly": false },
      "catalogId": { "type": "number", "readonly": false },
      "vatIncluded": { "type": "boolean", "readonly": false },
      "createdAt": { "type": "datetime", "readonly": true },

      "PROPERTY_301": { "type": "product_property", "readonly": false, "label": "SKU" },
      "PROPERTY_303": { "type": "product_property", "readonly": false, "label": "Manufacturer" },
      "PROPERTY_307": { "type": "product_property", "readonly": false, "label": "Color" }
    }
  }
}
```

## Error response example

403 — no scope:

```json
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'crm' scope"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | API key lacks the `crm` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |

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

## Known specifics

**The same product in the catalog has more fields.** The product with the same `id` is available via [`GET /v1/catalog-products`](/docs/entities/catalog-products), where it has a wider field set — stock, warehouse, and variations.

## See also

- [Get product](/docs/entities/products/get)
- [List products](/docs/entities/products/list)
- [Aggregate products](/docs/entities/products/aggregate)
- [Entity API](/docs/entity-api)
- [Catalog products](/docs/entities/catalog-products)
