
## Create bank detail

`POST /v1/bank-details`

Creates a new bank detail and links it to a CRM requisite. A deleted record cannot be restored — create a new one if needed.

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `entityId` | number | yes | ID of the owner requisite. Lookup: `GET /v1/requisites` |
| `name` | string | yes | Bank detail name |
| `entityTypeId` | number | no | Parent entity type. Pass `8` to link the record to a requisite |
| `rqBik` | string | no | Bank BIC |
| `rqAccNum` | string | no | Current account |
| `rqCorAccNum` | string | no | Correspondent account |
| `rqSwift` | string | no | SWIFT code |
| `rqIban` | string | no | IBAN number |
| `rqBankName` | string | no | Bank name |
| `rqBankAddr` | string | no | Bank address |
| `rqAccName` | string | no | Account holder name |
| `rqAccCurrency` | string | no | Account currency |
| `active` | boolean | no | Whether the detail is active. Defaults to `true` |
| `sort` | number | no | Sort order. Defaults to `500` |
| `code` / `xmlId` / `originatorId` | string | no | External identifiers for synchronization |
| `comments` | string | no | Comment |

The `id`, `createdAt`, `updatedAt`, `createdBy`, `modifyBy` fields are set by the system and ignored on write.

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/bank-details" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "entityTypeId": 8,
    "entityId": 1,
    "name": "Current account",
    "rqBik": "37040044",
    "rqAccNum": "DE89370400440532013000",
    "rqSwift": "DEUTDEFF"
  }'
```

### curl — OAuth app

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/bank-details" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "entityTypeId": 8,
    "entityId": 1,
    "name": "Current account",
    "rqBik": "37040044",
    "rqAccNum": "DE89370400440532013000",
    "rqSwift": "DEUTDEFF"
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bank-details', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    entityTypeId: 8,
    entityId: 1,
    name: 'Current account',
    rqBik: '37040044',
    rqAccNum: 'DE89370400440532013000',
    rqSwift: 'DEUTDEFF',
  }),
})

const { success, data } = await res.json()
console.log('Created bank detail ID:', data.id)
```

### JavaScript — OAuth app

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bank-details', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    entityTypeId: 8,
    entityId: 1,
    name: 'Current account',
    rqBik: '37040044',
    rqAccNum: 'DE89370400440532013000',
    rqSwift: 'DEUTDEFF',
  }),
})

const { success, data } = await res.json()
console.log('Created bank detail ID:', data.id)
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | The created bank detail |
| `data.id` | number | ID of the new record |
| `data.entityId` | number | ID of the owner requisite |
| `data.countryId` | number | Country ID; `0` if the country is not set |
| `data.name` | string \| null | Name |
| `data.active` | boolean | Whether the detail is active |
| `data.sort` | number | Sort order |
| `data.rqBik` | string \| null | Bank BIC |
| `data.rqAccNum` | string \| null | Current account |
| `data.rqCorAccNum` | string \| null | Correspondent account |
| `data.rqSwift` | string \| null | SWIFT code |
| `data.rqIban` | string \| null | IBAN number |
| `data.rqBankName` | string \| null | Bank name |
| `data.rqBankAddr` | string \| null | Bank address |
| `data.rqAccName` | string \| null | Account holder name |
| `data.rqAccCurrency` | string \| null | Account currency |
| `data.comments` | string \| null | Comment |
| `data.createdAt` | datetime | Creation date (ISO 8601) |
| `data.updatedAt` | datetime \| null | Last modification date |
| `data.createdBy` | number | Creator ID |
| `data.modifyBy` | number \| null | `null` right after creation |

Unset fields are returned as `null`. Full list — [`GET /v1/bank-details/fields`](/docs/entities/bank-details/fields).

## Response example

HTTP status: `201 Created`

```json
{
  "success": true,
  "data": {
    "id": 19,
    "entityId": 1,
    "countryId": 0,
    "createdAt": "2026-06-10T10:14:29.000Z",
    "updatedAt": null,
    "createdBy": 1,
    "modifyBy": null,
    "name": "Current account",
    "code": null,
    "xmlId": null,
    "originatorId": null,
    "active": true,
    "sort": 500,
    "rqBankName": null,
    "rqBankAddr": null,
    "rqBik": "37040044",
    "rqAccName": null,
    "rqAccNum": "DE89370400440532013000",
    "rqAccCurrency": null,
    "rqCorAccNum": null,
    "rqIban": null,
    "rqSwift": "DEUTDEFF",
    "comments": null
  }
}
```

## Error response example

422 — `entityId` not provided:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "ENTITY_ID is not defined or invalid."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 422 | `BITRIX_ERROR` | `entityTypeId` or `entityId` not provided, or Bitrix24 rejected the field value |
| 403 | `SCOPE_DENIED` | Key lacks the `crm` scope. Message: `This endpoint requires 'crm' scope` |
| 401 | `TOKEN_MISSING` | `X-Api-Key` not provided |

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

## Known specifics

**`entityTypeId` is not returned on read.** This is an owner field: you pass it on creation with the value `8`, but it is absent from the `GET /v1/bank-details/:id` response and from the list.

## See also

- [List bank details](/docs/entities/bank-details/list)
- [Update bank detail](/docs/entities/bank-details/update)
- [Delete bank detail](/docs/entities/bank-details/delete)
- [Bank detail fields](/docs/entities/bank-details/fields)
- [Requisites](/docs/entities/requisites)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
