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 |
|---|---|---|---|
Parameterrefresh (query) |
Typestring | Defaultfalse |
DescriptionPass 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 |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.fields |
Typeobject | DescriptionMap of item fields: the key is the field name, the value is its description |
Fielddata.fields.<field>.type |
Typestring | DescriptionValue type |
Fielddata.fields.<field>.readonly |
Typeboolean | Descriptiontrue — the field is filled by the system and is not accepted on creation or update |
Fielddata.fields.<field>.createOnly |
Typeboolean | DescriptionPresent with the value true on fields that are set only on creation. On update such a field is rejected with 400 READONLY_FIELD |
Fielddata.fields.<field>.required |
Typeboolean | DescriptionPresent with the value true on fields required on creation |
Fielddata.fields.<field>.label |
Typestring | DescriptionField caption |
Fielddata.fields.<field>.description |
Typestring | DescriptionField description |
Fielddata.batch |
Typestring[] | DescriptionOperations available in bulk mode through Batch: create, update, delete |
Fieldmeta.warnings |
Typearray | DescriptionPresent 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 |
|---|---|---|---|
Fieldid |
Typenumber | ROyes | DescriptionItem ID |
FielddocId |
Typenumber | RO | DescriptionInventory document the item belongs to. Required on creation, set only on creation. List: GET /v1/catalog-documents |
FieldelementId |
Typenumber | RO | DescriptionProduct. Required on creation, set only on creation. List: GET /v1/catalog-products |
Fieldamount |
Typenumber | RO | DescriptionProduct quantity |
FieldpurchasingPrice |
Typenumber | RO | DescriptionPurchase price per unit |
FieldstoreFrom |
Typenumber | RO | DescriptionSource warehouse. null if not set. List: GET /v1/warehouses |
FieldstoreTo |
Typenumber | RO | DescriptionDestination 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 |
|---|---|---|
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header was not passed |
| HTTP401 | CodeINVALID_API_KEY |
DescriptionThe passed API key was not found |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the catalog scope |
| HTTP429 | CodeRATE_LIMITED |
DescriptionRate 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.