# Request a payout

Asks to draw money against ONE stake — the request, not the payment. Body: `splitId` (required; `get_accounting_me_availability` names the caller's own stakes), `amountMinor` (more than zero) and `notes`. The available balance is read inside the INSERT and snapshotted onto the row, so the guard and the audit figure cannot disagree and two concurrent requests for one balance cannot both pass. Asking for more than is available reads as a not-found on the stake, deliberately: the alternative tells a caller how much somebody else's stake holds.

Access class: `workspace`.

## Endpoint

`POST /v1/accounting/payouts`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "amountMinor": 1,
    "notes": "string",
    "splitId": 1
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "availableAtRequestMinor": 1,
    "bankTransactionId": 1,
    "createdAt": "string",
    "currency": "string",
    "dealId": 1,
    "decidedAt": "string",
    "decidedBy": "string",
    "decisionReason": "string",
    "detail": {},
    "id": 1,
    "notes": "string",
    "paidAt": "string",
    "requestedAmountMinor": 1,
    "requestedAt": "string",
    "requestedBy": "string",
    "splitId": 1,
    "status": "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"
}
```
