For AI agents: markdown of this page — /docs-content-en/entities/catalog-documents/cancel.md documentation index — /llms.txt

Cancel conducting of an inventory document

POST /v1/catalog-documents/:id/cancel

Cancels conducting of an inventory document: the product stock in the warehouses returns to the values it had before conducting, and the document is no longer conducted. Call it when you need to edit a conducted document or its items.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionDocument ID, a positive integer without leading zeros. List: GET /v1/catalog-documents

Send an empty object {} with the Content-Type: application/json header, or send the request with no body and without that header.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/catalog-documents/301/cancel" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/catalog-documents/301/cancel" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-documents/301/cancel', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: '{}',
})

const { success, data } = await res.json()
console.log('Document status:', data.status)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-documents/301/cancel', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: '{}',
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata.id Typenumber DescriptionDocument ID
Fielddata.status Typestring DescriptionDocument status, re-read after cancellation. Always N in a successful response

Other document fields — GET /v1/catalog-documents/:id. The statusBy and dateStatus fields show who last changed the status and when.

Response example

JSON
{
  "success": true,
  "data": {
    "id": 301,
    "status": "N"
  }
}

Error response example

422 — the document is not conducted:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Document conduct cancellation error: The document is not conducted yet.",
    "b24Code": "0"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS Descriptionid in the path is not a positive integer, or the request body is not empty. Error text — id must be a positive safe integer and body must be empty
HTTP400 CodeFST_ERR_CTP_EMPTY_JSON_BODY DescriptionThe Content-Type: application/json header is sent, but the body is empty. Send {} or remove the header
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo document with this id. Error text — Catalog document not found
HTTP422 CodeBITRIX_ERROR DescriptionThe document is not conducted. Error text — Document conduct cancellation error: The document is not conducted yet.
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the cancellation for another reason. The reason text is in message
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 did not confirm the cancellation. Error text — Bitrix24 rejected the document action
HTTP422 CodeBITRIX_ERROR DescriptionThe document was re-read, and its status did not become N. Error text — Document action did not change status
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionThe portal is unavailable, or the document status could not be re-read after cancellation. In the second case the error text is Unable to verify document status
HTTP503 CodeBITRIX_TIMEOUT DescriptionBitrix24 did not respond in time. The cancellation may have taken place — before retrying, check status via GET /v1/catalog-documents/:id
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionBitrix24 denied the key's user access to the operation
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key works in read-only mode
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the catalog scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is not passed
HTTP401 CodeINVALID_API_KEY DescriptionThe passed API key was not found
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens

Full list of common API errors — Errors.

See also