## Unit of measure fields

`GET /v1/catalog-measures/fields`

Returns the field schema of a catalog unit of measure: use it to check types and allowed values before creating or updating a record.

## Examples

### curl — personal key

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

### curl — OAuth application

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

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

### JavaScript — OAuth application

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

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.fields` | object | Map of unit of measure fields. The key is the field name, the value is its description |
| `data.batch` | array | Write actions available in batch mode via `POST /v1/catalog-measures/batch`: `create`, `update`, `delete` |

Each field in the `fields` map is described by the keys `type` and `readonly`, a `label` and a `description`. The `required: true` key is set on the fields required to create a record: `code` and `measureTitle`. The `nullable: true` key is set on fields whose value can come back as `null`. The `isDefault` field has an `enum` list of allowed values, each with a `label`. The `label` and `description` of the fields themselves come back in English.

| Field | Type | RO | Description |
|------|-----|:--:|---------|
| `id` | number | yes | Unit of measure identifier. Pass it in the product's `measure` field |
| `code` | number | | Unit code in the Russian National Classifier of Units of Measurement (OKEI), an integer. Unique within the Bitrix24 account. Required on create |
| `measureTitle` | string \| null | | Unit of measure name. Required on create, but some existing units return `null` — their designation is then filled in `symbolIntl` and `symbolLetterIntl` |
| `symbol` | string \| null | | Short designation. `null` if not set |
| `symbolIntl` | string \| null | | International designation. `null` if not set |
| `symbolLetterIntl` | string \| null | | International letter designation. `null` if not set |
| `isDefault` | string | | Default unit on the Bitrix24 account: `Y` or `N`. Other values are rejected |

## Response example

```json
{
  "success": true,
  "data": {
    "fields": {
      "id": {
        "type": "number",
        "readonly": true,
        "label": "ID",
        "description": "Measure identifier."
      },
      "code": {
        "type": "number",
        "readonly": false,
        "required": true,
        "label": "OKEI code",
        "description": "Unique OKEI measure code."
      },
      "measureTitle": {
        "type": "string",
        "readonly": false,
        "required": true,
        "nullable": true,
        "label": "Measure name",
        "description": "Measure name."
      },
      "symbol": {
        "type": "string",
        "readonly": false,
        "nullable": true,
        "label": "Symbol",
        "description": "Short symbol."
      },
      "symbolIntl": {
        "type": "string",
        "readonly": false,
        "nullable": true,
        "label": "International symbol",
        "description": "International symbol."
      },
      "symbolLetterIntl": {
        "type": "string",
        "readonly": false,
        "nullable": true,
        "label": "International letter symbol",
        "description": "International letter symbol."
      },
      "isDefault": {
        "type": "string",
        "readonly": false,
        "label": "Default measure",
        "description": "Y if this is the portal default, N otherwise. Only one measure can be default.",
        "enum": [
          { "value": "Y", "label": "Default" },
          { "value": "N", "label": "Not default" }
        ]
      }
    },
    "batch": ["create", "update", "delete"]
  }
}
```

## Error response example

401 — API key not provided:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is not provided |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 429 | `RATE_LIMITED` | Request limit exceeded: 300 per minute per Bitrix24 account, all API keys of the account share one limit. The exact value is in the `x-ratelimit-limit` header (the ceiling is split across replicas). Retry after the interval given in the `Retry-After` header |

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

## See also

- [Create a unit of measure](/docs/entities/catalog-measures/create)
- [Update a unit of measure](/docs/entities/catalog-measures/update)
- [List units of measure](/docs/entities/catalog-measures/list)
- [Catalog units of measure](/docs/entities/catalog-measures)
- [Catalog products](/docs/entities/catalog-products)
- [Entity API](/docs/entity-api)
