## List CRM deliveries

`GET /v1/crm-deliveries`

Returns all deliveries of a CRM item, such as a deal, in one call.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `entityTypeId` (query) | number | yes | CRM item type, a positive integer. For a deal — `2` |
| `entityId` (query) | number | yes | CRM item ID, a positive integer. For a deal — the ID from [`GET /v1/deals`](/docs/entities/deals/list) |

There is no pagination, filter or sorting: all deliveries of the item are returned, and other query parameters are ignored.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/crm-deliveries?entityTypeId=2&entityId=8847" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/crm-deliveries?entityTypeId=2&entityId=8847" \
  -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/crm-deliveries?entityTypeId=2&entityId=8847', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data, meta } = await res.json()
console.log(`Deliveries: ${meta.total}`)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-deliveries?entityTypeId=2&entityId=8847', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` on success |
| `data` | array | The item's deliveries. An empty array for an existing item with no deliveries |
| `data[].id` | number | Delivery ID. The shipment in [`GET /v1/shipments/:id`](/docs/entities/shipments/get) has the same ID |
| `data[].accountNumber` | string | Delivery number: the order number and a sequence number separated by `/` |
| `data[].deducted` | string | Shipped flag: `Y` — shipped, `N` — not shipped |
| `data[].dateDeducted` | string \| null | Shipping time, or `null` until shipped |
| `data[].deliveryId` | number | Delivery service ID. List: [`GET /v1/delivery-services`](/docs/entities/delivery-services/list) |
| `data[].priceDelivery` | number | Delivery cost |
| `data[].currency` | string | Currency code of the cost |
| `data[].deliveryName` | string | Delivery service name |
| `meta.total` | number | Number of deliveries in `data` |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 1223,
      "accountNumber": "1041/2",
      "deducted": "N",
      "dateDeducted": null,
      "deliveryId": 1,
      "priceDelivery": 500,
      "currency": "USD",
      "deliveryName": "Courier delivery"
    }
  ],
  "meta": {
    "total": 1
  }
}
```

## Error response example

400 — `entityId` not provided:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELDS",
    "message": "entityTypeId and entityId are required positive integers."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `MISSING_REQUIRED_FIELDS` | `entityTypeId` or `entityId` not provided, or the value is not a positive integer |
| 404 | `ENTITY_NOT_FOUND` | No CRM item with these `entityTypeId` and `entityId` |
| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | The key has no Bitrix24 connection |

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

## Known specifics

**`deducted` is a string here.** The same delivery in [`GET /v1/shipments/:id`](/docs/entities/shipments/get) returns `deducted` as `true` or `false`. Compare with `"Y"`, not with `true`.

## See also

- [Get a CRM delivery](./get.md)
- [Shipments](/docs/entities/shipments)
- [CRM payments](/docs/entities/crm-payments)
- [CRM deliveries](../crm-deliveries.md)
