# Change accounting deals id

Corrects a funded deal's agreed economics. Body, all optional: `facilityId`, `lenderId`, `merchantId`, `reference`, `dealDate` (`YYYY-MM-DD`), `fundedAmountMinor`, `commissionMinor`, `psfMinor`, `clawbackWindowDays`, `slaDays`, `status`, `notes`. A participant's share is NOT here — it is a stake, changed with `patch_accounting_deal-splits_id` or replaced by retiring the old one and adding its successor. Hold is its own pair of verbs (`post_accounting_deals_id_hold`, `post_accounting_deals_id_release-hold`) so that the reason is required.

Access class: `workspace`.

## Endpoint

`PATCH /v1/accounting/deals/{id}`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| id | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "clawbackWindowDays": 1,
    "commissionMinor": 1,
    "dealDate": "string",
    "facilityId": 1,
    "fundedAmountMinor": 1,
    "lenderId": 1,
    "merchantId": 1,
    "notes": "string",
    "psfMinor": 1,
    "reference": "string",
    "slaDays": 1,
    "status": "string"
  },
  "params": {
    ":id": "string"
  },
  "query": {}
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "clawbackAmountMinor": 1,
    "clawbackWindowDays": 1,
    "commissionMinor": 1,
    "createdAt": "string",
    "currency": "string",
    "dealDate": "string",
    "dealRowId": "",
    "defaultAmountMinor": 1,
    "defaultedInWindow": true,
    "defaultedOn": "string",
    "detail": {},
    "facilityId": 1,
    "fundedAmountMinor": 1,
    "grossRevenueMinor": 1,
    "holdReason": "string",
    "holdReleasedAt": "string",
    "holdStartedAt": "string",
    "holdState": "string",
    "id": 1,
    "lenderId": 1,
    "merchantId": 1,
    "notes": "string",
    "psfMinor": 1,
    "reference": "string",
    "rollup": {
      "agingDays": 1,
      "clawbackOpenMinor": 1,
      "clawbackRecoveredMinor": 1,
      "collectedMinor": 1,
      "commissionCollectedMinor": 1,
      "costsMinor": 1,
      "outstandingMinor": 1,
      "pastSla": true,
      "psfCollectedMinor": 1
    },
    "slaDays": 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"
}
```
