## Conduct an inventory document

`POST /v1/catalog-documents/:id/conduct`

Conducts an inventory document: warehouse stock changes for the products in its items, and the document is marked as conducted. Call it once the document and its items are filled in.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Document ID, a positive integer without leading zeros. List: [`GET /v1/catalog-documents`](./list.md) |

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

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

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/catalog-documents/301/conduct" \
  -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/conduct', {
  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/conduct', {
  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 |
|------|-----|---------|
| `success` | boolean | `true` on success |
| `data.id` | number | ID of the conducted document |
| `data.status` | string | Document status, re-read after conducting. Always `Y` in a successful response |

Other document fields — [`GET /v1/catalog-documents/:id`](./get.md).

## Response example

```json
{
  "success": true,
  "data": {
    "id": 301,
    "status": "Y"
  }
}
```

## Error response example

422 — the document is already conducted:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Document conduct error: The document is already conducted",
    "b24Code": "0"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `id` 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` |
| 400 | `FST_ERR_CTP_EMPTY_JSON_BODY` | The `Content-Type: application/json` header is sent, but the body is empty. Send `{}` or remove the header |
| 404 | `ENTITY_NOT_FOUND` | No document with this `id`. Error text — `Catalog document not found` |
| 422 | `BITRIX_ERROR` | The document is already conducted. Error text — `Document conduct error: The document is already conducted` |
| 422 | `BITRIX_ERROR` | A receipt `A` has no supplier. Error text — `Document conduct error: Supplier is not specified.` |
| 422 | `BITRIX_ERROR` | An item lacks the warehouse its document type requires. The text names the product and the warehouse: `…write-off warehouse is not specified` for a write-off `D`, `…destination warehouse is not specified` for a transfer `M`, `…return warehouse is not specified` for a return `R` |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected conducting for another reason. The reason text is in `message` |
| 422 | `BITRIX_ERROR` | Bitrix24 did not confirm conducting. Error text — `Bitrix24 rejected the document action` |
| 422 | `BITRIX_ERROR` | The document was re-read, and its status did not become `Y`. Error text — `Document action did not change status` |
| 502 | `BITRIX_UNAVAILABLE` | The portal is unavailable, or the document status could not be re-read after conducting. In the second case the error text is `Unable to verify document status` |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time. Conducting may have taken place — before retrying, check `status` via [`GET /v1/catalog-documents/:id`](./get.md) |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied the key's user access to the operation |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode |
| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is not passed |
| 401 | `INVALID_API_KEY` | The passed API key was not found |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## See also

- [Cancel conducting](./cancel.md)
- [Get an inventory document](./get.md)
- [Inventory document items](/docs/entities/catalog-document-elements)
- [Warehouse stock](/docs/entities/warehouses/stock)
- [Inventory documents](/docs/entities/catalog-documents)
