For AI agents: markdown of this page — /docs-content-en/entities/catalog-document-elements/fields.md documentation index — /llms.txt
Inventory document item fields
GET /v1/catalog-document-elements/fields
Returns the schema of all inventory document item fields. Helps build the request body for creating and updating an item.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
refresh (query) |
string | false |
Pass true to get the schema bypassing the cache. Example: ?refresh=true |
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/catalog-document-elements/fields" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/catalog-document-elements/fields" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-document-elements/fields', {
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { success, data } = await res.json()
const createOnly = Object.entries(data.fields)
.filter(([, field]) => field.createOnly)
.map(([name]) => name)
console.log('Set only on creation:', createOnly)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-document-elements/fields', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success, data } = await res.json()
const createOnly = Object.entries(data.fields)
.filter(([, field]) => field.createOnly)
.map(([name]) => name)
console.log('Set only on creation:', createOnly)
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true on success |
data.fields |
object | Map of item fields: the key is the field name, the value is its description |
data.fields.<field>.type |
string | Value type |
data.fields.<field>.readonly |
boolean | true — the field is filled by the system and is not accepted on creation or update |
data.fields.<field>.createOnly |
boolean | Present with the value true on fields that are set only on creation. On update such a field is rejected with 400 READONLY_FIELD |
data.fields.<field>.required |
boolean | Present with the value true on fields required on creation |
data.fields.<field>.label |
string | Field caption |
data.fields.<field>.description |
string | Field description |
data.batch |
string[] | Operations available in bulk mode through Batch: create, update, delete |
meta.warnings |
array | Present only if the field schema could not be fully retrieved from Bitrix24. Contains an object with the code fields_partial and a message text: the response holds only the fields from the Vibecode schema, and some captions may be missing. Retry the request |
The label and description values contain the field name itself.
Item fields:
| Field | Type | RO | Description |
|---|---|---|---|
id |
number | yes | Item ID |
docId |
number | Inventory document the item belongs to. Required on creation, set only on creation. List: GET /v1/catalog-documents |
|
elementId |
number | Product. Required on creation, set only on creation. List: GET /v1/catalog-products |
|
amount |
number | Product quantity | |
purchasingPrice |
number | Purchase price per unit | |
storeFrom |
number | Source warehouse. null if not set. List: GET /v1/warehouses |
|
storeTo |
number | Destination warehouse. null if not set. List: GET /v1/warehouses |
Which warehouses an item needs depends on the document type — see inventory document items.
Response example
{
"success": true,
"data": {
"fields": {
"id": {
"type": "number",
"readonly": true,
"label": "id",
"description": "id"
},
"docId": {
"type": "number",
"readonly": false,
"createOnly": true,
"required": true,
"label": "docId",
"description": "docId"
},
"elementId": {
"type": "number",
"readonly": false,
"createOnly": true,
"required": true,
"label": "elementId",
"description": "elementId"
},
"amount": {
"type": "number",
"readonly": false,
"label": "amount",
"description": "amount"
},
"purchasingPrice": {
"type": "number",
"readonly": false,
"label": "purchasingPrice",
"description": "purchasingPrice"
},
"storeFrom": {
"type": "number",
"readonly": false,
"label": "storeFrom",
"description": "storeFrom"
},
"storeTo": {
"type": "number",
"readonly": false,
"label": "storeTo",
"description": "storeTo"
}
},
"batch": [
"create",
"update",
"delete"
]
}
}
Error response example
401 — the API key was not passed:
{
"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 was not passed |
| 401 | INVALID_API_KEY |
The passed API key was not found |
| 401 | TOKEN_MISSING |
The API key has no configured tokens |
| 403 | SCOPE_DENIED |
The API key does not have the catalog scope |
| 429 | RATE_LIMITED |
Rate limit exceeded: 300 requests per minute per portal, all API keys of the portal share one limit. The effective value is in the x-ratelimit-limit header. Retry after the delay in the Retry-After header |
Full list of common API errors — Errors.