# Customer Bulk

Bulk customer create/update operations

::: info
Every response arrives in the shared envelope — `code`, `message`, `messages`, `status_code`, `time` — with the payload in `data`. The tables below describe what is inside `data`.
:::

## POST /customer/delete-many

Soft-delete multiple customers in a single call (sets is_deleted=true on each). Pass either an explicit list of ObjectIds in ids, or set is_all=true with optional filters to delete all matched customers. Returns the count of deleted documents.

**Required permission:** `customer_delete` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/customer/delete-many' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "ids": [
    "string"
  ]
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/customer/delete-many', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "ids": [
      "string"
    ]
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/customer/delete-many",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "ids": [
            "string",
        ],
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "ids": [
    "string"
  ]
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/customer/delete-many');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Request body**

| Field | Type | Required | Description |
|---|---|---|---|
| `ids` | `string[]` | Yes | Explicit list of customer ObjectIds to soft-delete. Mutually exclusive with is_all=true. |

```json
{
  "ids": [
    "string"
  ]
}
```

**Response**

| Field | Type | Description |
|---|---|---|
| `deleted_count` | `number` | Number of customer documents that were soft-deleted |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "deleted_count": 0
  },
  "time": "2025-05-01T12:00:00Z"
}
```

---

*This page is generated from the OpenAPI spec.*
