# Create a deal split

Lays down a stake: who participates in a funded deal's money, on what basis, for how much. Body: `dealId` (required) and who it is for — `accountId`, `crmUserId` or `externalParty` — plus `partyKind`, `basis`, and exactly ONE measure, either `sharePpm` (parts per million, so 300000 is 30%) or `flatAmountMinor`; `notes` is optional. A share is measured against the commission, the PSF, gross, the funded amount, or net (gross less every commission-basis entitlement, less costs, less any open clawback). A syndicator is a stake with `partyKind: syndicator` and `basis: funded`. To REPLACE a stake, retire the old one first with `post_accounting_deal-splits_id_deactivate` — the unique index refuses two live stakes for one party.

Access class: `workspace`.

## Endpoint

`POST /v1/accounting/deal-splits`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "accountId": "",
    "basis": "string",
    "crmUserId": 1,
    "dealId": 1,
    "externalParty": "string",
    "flatAmountMinor": 1,
    "notes": "string",
    "partyKind": "string",
    "sharePpm": 1
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "accountId": "",
    "availability": {
      "availableMinor": 1,
      "clawbackShareMinor": 1,
      "collectedMinor": 1,
      "drawnMinor": 1,
      "entitledMinor": 1,
      "isHeld": true,
      "pendingMinor": 1,
      "unpaidMinor": 1
    },
    "basis": "string",
    "createdAt": "string",
    "crmUserId": 1,
    "deactivatedAt": "string",
    "dealId": 1,
    "detail": {},
    "externalParty": "string",
    "flatAmountMinor": 1,
    "held": true,
    "heldReason": "string",
    "id": 1,
    "notes": "string",
    "partyKind": "string",
    "sharePpm": 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"
}
```
