# Allocate a bank transaction

Records that this much of that bank line was this deal's money — the write that moves the deal's collected, outstanding and every participant's available figure, at read time. Body: `dealId` (required), `amountMinor`, `allocationType` (one of `commission`, `psf`, `clawback_recovery`, `bonus`, `management_fee`, `syndication_fee`), and optionally `bankTransactionId`, `allocatedOn` (`YYYY-MM-DD`) and `notes`. Over-allocating a bank line or a deal is refused with 409 by a guard inside the INSERT, and there is no override parameter — that guard is the one rule stopping a deposit being counted twice. Money LEAVING is not an allocation: a draw against a stake is `post_accounting_payouts`.

Access class: `workspace`.

## Endpoint

`POST /v1/accounting/allocations`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "allocatedOn": "string",
    "allocationType": "string",
    "amountMinor": 1,
    "bankTransactionId": 1,
    "dealId": 1,
    "notes": "string"
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "allocatedOn": "string",
    "allocationType": "string",
    "amountMinor": 1,
    "bankTransactionId": 1,
    "createdAt": "string",
    "currency": "string",
    "dealId": 1,
    "detail": {},
    "id": 1,
    "notes": "string",
    "updatedAt": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
