## Quote product fields

`GET /v1/quotes/:id/products/fields`

Returns descriptions of the fields on quote product rows: names, types, and whether each field is readable and writable.

> **The discount amount is called `discount`** — matching the data and the write contract. The previous name `discountSum` remains a deprecated alias: it is still returned by this endpoint and still accepted on write, so code written against the old field list keeps working. Product rows themselves carry only `discount` — migrate to it.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Quote ID |

## Examples

### curl — personal key

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

### curl — OAuth application

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

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

### JavaScript — OAuth application

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

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` when the request succeeds |
| `data` | object | Product row field dictionary. The key is the field name, the value holds its attributes |
| `data.<field>.type` | string | Value type: `integer`, `double`, `string`, `char` |
| `data.<field>.isReadOnly` | boolean | Read-only: the field cannot be written |
| `data.<field>.isRequired` | boolean | Required flag. `false` on every product row field |
| `data.<field>.isImmutable` | boolean | `true` on `ownerId` and `ownerType`: the row owner is set by the request path. Absent on `priceAccount` and `xmlId` |
| `data.<field>.isMultiple` | boolean | `false` on product row fields. Absent on `priceAccount` and `xmlId` |
| `data.<field>.isDynamic` | boolean | `false` on product row fields. Absent on `priceAccount` and `xmlId` |
| `data.<field>.title` | string | Field label. Absent on `priceAccount` and `xmlId` |
| `data.<field>.description` | string | Field note. Present on `id` and `discountSum` |
| `meta.warnings` | array | Present only when some definitions were built without titles from Bitrix24. Each element is a `{ code, message }` object with `code` set to `fields_partial`. With no warnings, the response has no `meta` field |

Product row fields described by `data`:

| Field | Type | RO | Required | Description |
|------|-----|:--:|:-----:|---------|
| `id` | integer | yes | | Row ID |
| `productId` | integer | | | Product ID. Catalog: `GET /v1/products` |
| `productName` | string | | | Product name |
| `price` | double | | | Price |
| `quantity` | double | | | Quantity |
| `discount` | double | | | Discount amount. Applied when `discountTypeId` is `1` |
| `discountSum` | double | | | Deprecated alias of `discount` — accepted on write, absent from product rows |
| `discountRate` | double | | | Discount percentage. Applied when `discountTypeId` is `2` |
| `discountTypeId` | integer | | | How the discount is set: `1` — as an amount in `discount`, `2` — as a percentage in `discountRate`. Defaults to `2` |
| `taxRate` | double | | | Tax (%) |
| `taxIncluded` | char | | | Tax included in price (`Y`/`N`) |
| `priceExclusive` | double | yes | | Price excluding tax, with discount |
| `priceNetto` | double | yes | | Net price |
| `priceBrutto` | double | yes | | Gross price |
| `measureCode` | integer | | | Unit of measure code |
| `measureName` | string | yes | | Unit of measure |
| `customized` | char | yes | | Modified (`Y`/`N`) |
| `sort` | integer | | | Sort order |
| `type` | integer | yes | | Type |
| `storeId` | integer | yes | | Warehouse ID |
| `taxName` | string | yes | | Tax name |
| `ownerId` | integer | yes | | Owner (quote) ID |
| `ownerType` | string | yes | | Owner type |
| `priceAccount` | double | yes | | Price in the reporting currency |
| `xmlId` | string | yes | | External code of the row |

## Response example

```json
{
  "success": true,
  "data": {
    "id": { "type": "integer", "isRequired": false, "isReadOnly": true, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "ID", "description": "Row identity. Read-only as an attribute, and NOT a handle for editing: PUT /products does not preserve it — a row whose fields change comes back with a new id even if the previous one was sent. To edit a row and keep its id use PATCH /products/{rowId}." },
    "ownerId": { "type": "integer", "isRequired": false, "isReadOnly": true, "isImmutable": true, "isMultiple": false, "isDynamic": false, "title": "Owner ID" },
    "ownerType": { "type": "string", "isRequired": false, "isReadOnly": true, "isImmutable": true, "isMultiple": false, "isDynamic": false, "title": "Owner type" },
    "productId": { "type": "integer", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Product" },
    "productName": { "type": "string", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Product name" },
    "price": { "type": "double", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Price" },
    "priceExclusive": { "type": "double", "isRequired": false, "isReadOnly": true, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Price excluding tax, with discount" },
    "priceNetto": { "type": "double", "isRequired": false, "isReadOnly": true, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "PRICE_NETTO" },
    "priceBrutto": { "type": "double", "isRequired": false, "isReadOnly": true, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "PRICE_BRUTTO" },
    "quantity": { "type": "double", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Quantity" },
    "discountTypeId": { "type": "integer", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Discount type" },
    "discountRate": { "type": "double", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Discount value" },
    "discount": { "type": "double", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Discount amount" },
    "taxRate": { "type": "double", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Tax" },
    "taxIncluded": { "type": "char", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Tax included in price" },
    "customized": { "type": "char", "isRequired": false, "isReadOnly": true, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Modified" },
    "measureCode": { "type": "integer", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Unit of measure code" },
    "measureName": { "type": "string", "isRequired": false, "isReadOnly": true, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Unit of measure" },
    "sort": { "type": "integer", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Sort order" },
    "type": { "type": "integer", "isRequired": false, "isReadOnly": true, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "TYPE" },
    "storeId": { "type": "integer", "isRequired": false, "isReadOnly": true, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "STORE_ID" },
    "taxName": { "type": "string", "isRequired": false, "isReadOnly": true, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "TAX_NAME" },
    "priceAccount": { "type": "double", "isReadOnly": true, "isRequired": false },
    "xmlId": { "type": "string", "isReadOnly": true, "isRequired": false },
    "discountSum": { "type": "double", "isRequired": false, "isReadOnly": false, "isImmutable": false, "isMultiple": false, "isDynamic": false, "title": "Discount amount", "description": "Deprecated alias of `discount`; kept so clients written against the previous field list keep working. Accepted on write, never present in row data — migrate to `discount`." }
  }
}
```

> **About `id`.** An `id` supplied in `PUT /v1/quotes/:id/products` items does not guarantee the row's previous identifier: an unchanged row gets the same `id` even without this field, while a changed row gets a new one. For targeted editing, use `PATCH /v1/quotes/:id/products/:rowId`.

## Error response example

404 — quote not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Item not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | Quote not found |
| 403 | `SCOPE_DENIED` | API key does not have the `crm` scope |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |
| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |

For the full list of common API errors, see [Errors](/docs/errors).

## See also

- [Product rows](/docs/entities/quotes/products-get)
- [Add a product](/docs/entities/quotes/products-add)
- [Set products](/docs/entities/quotes/products-set)
- [Quote fields](/docs/entities/quotes/fields)
