# Finance

Budgets, spending, invoices, expenses and cash flow.

0 operation(s) for tokens, 58 app-only. The full schemas are in [openapi.json](https://docs.youniton.com/openapi.json) (search the operation ID).

## One expense with its decision and links

`GET /expenses/{expenseId}`

- Operation ID: `getExpense`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `expenseId` | path | string (uuid) | yes | An expense's id; hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The expense (ETag is its version). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Approve or reject a recorded expense

`POST /expenses/{expenseId}/decision`

- Operation ID: `decideExpense`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `expenseId` | path | string (uuid) | yes | An expense's id; hidden and missing are one 404. |

Request body (application/json, required): `ExpenseDecisionRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The decided expense. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The receipts of an expense

`GET /expenses/{expenseId}/receipts`

- Operation ID: `listExpenseReceipts`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `expenseId` | path | string (uuid) | yes | An expense's id; hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The receipts, oldest first; download each through Files. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Attach a completed upload (target expense_receipt) as a receipt

`POST /expenses/{expenseId}/receipts`

- Operation ID: `attachExpenseReceipt`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `expenseId` | path | string (uuid) | yes | An expense's id; hidden and missing are one 404. |

Request body (application/json, required): `ExpenseReceiptAttachRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The receipt. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Remove a receipt from a recorded expense

`DELETE /expenses/{expenseId}/receipts/{fileId}`

- Operation ID: `removeExpenseReceipt`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `expenseId` | path | string (uuid) | yes | An expense's id; hidden and missing are one 404. |
| `fileId` | path | string (uuid) | yes | A receipt file's id on this expense. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | Removed; Files deletes the file. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Reverse an approved expense with a reason; a corrected expense then names it

`POST /expenses/{expenseId}/reversal`

- Operation ID: `reverseExpense`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `expenseId` | path | string (uuid) | yes | An expense's id; hidden and missing are one 404. |

Request body (application/json, required): `ExpenseReasonRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The reversed expense. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The recorder withdraws a recorded expense

`POST /expenses/{expenseId}/withdrawal`

- Operation ID: `withdrawExpense`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `expenseId` | path | string (uuid) | yes | An expense's id; hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The withdrawn expense. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## What finance the caller may see and do — flags only, never amounts

`GET /finance/access`

- Operation ID: `getFinanceAccess`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The caller's finance access. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The tenant Finance overview: each readable project's budget, spent so far, used and people cost, and the totals (owner, 22 Nov 2026)

`GET /finance/budgets`

- Operation ID: `listTenantBudgets`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The rows by project key and the totals in EUR. | application/json | `object` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The months of the cashflow with the lines behind them; EUR totals (R10–R12)

`GET /finance/cashflow`

- Operation ID: `listCashflowMonths`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `from` | query | string | no | The first month. Default the starting month (else three months back), at most 60 months before to. |
| `to` | query | string | no | The last month. Default two months after the current month. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The months. Without view_cashflow the page is hidden (404 route.not_found). | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The starting money with its month and the VAT rates of the invoice dialog (§6)

`GET /finance/cashflow/settings`

- Operation ID: `getCashflowSettings`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The cashflow settings. | application/json | `object` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Set the starting money with its month, the VAT rates, or both (manage_cashflow; §6)

`PUT /finance/cashflow/settings`

- Operation ID: `changeCashflowSettings`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

Request body (application/json, required): `CashflowSettingsChange`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The cashflow settings, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The currency registry with the tenant's enabled and base flags

`GET /finance/currencies`

- Operation ID: `listFinanceCurrencies`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `filter[enabled]` | query | boolean | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The currencies, ordered by code. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## The exchange-rate versions, newest effective date first

`GET /finance/exchange-rates`

- Operation ID: `listExchangeRates`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |
| `filter[currency]` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of 50 versions. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## Record an exchange rate into the base currency from an effective date, or a correction

`POST /finance/exchange-rates`

- Operation ID: `recordExchangeRate`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `ExchangeRateRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The recorded version. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The tenant's expense categories (names and kinds, no amounts)

`GET /finance/expense-categories`

- Operation ID: `listExpenseCategories`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-10

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `filter[archived]` | query | boolean | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The categories in their order, with the usage of each; the ETag is the list's version. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## Replace the list of expense categories — add, rename, reorder and archive

`PUT /finance/expense-categories`

- Operation ID: `replaceExpenseCategories`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-10

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | no | OPTIONAL (group E1 live connect, 22 Nov 2026): the version of the list in quotes (meta.version of the read). A different version answers 412 stale-version with currentVersion, and nothing changes; absent compares nothing. |

Request body (application/json, required): `ExpenseCategoriesReplaceRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The active categories, with the usage of each; the ETag is the list's new version. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The simple invoice list with the VAT rates of the dialog (R16–R18)

`GET /finance/invoices`

- Operation ID: `listInvoices`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The invoices, the newest due date first. Without view_cashflow the page is hidden (404 route.not_found). | application/json | `object` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Add an open invoice; the VAT and the total are derived (R16)

`POST /finance/invoices`

- Operation ID: `addInvoice`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `InvoiceAddRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The invoice, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Mark an invoice as open; the paid date is removed (R17)

`POST /finance/invoices/{invoiceId}/open`

- Operation ID: `markInvoiceOpen`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `invoiceId` | path | string (uuid) | yes | An invoice's id of the simple list; a missing one is 404 (invoice.not_found). |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The invoice, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## Mark an invoice as paid on a date, today when no date is given (R17)

`POST /finance/invoices/{invoiceId}/paid`

- Operation ID: `markInvoicePaid`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `invoiceId` | path | string (uuid) | yes | An invoice's id of the simple list; a missing one is 404 (invoice.not_found). |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json): `InvoicePaidRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The invoice, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One row per project where the caller may see finance

`GET /finance/portfolio`

- Operation ID: `listFinancePortfolio`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-07

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |
| `filter[teamId]` | query | string (uuid) | no |  |
| `filter[alert]` | query | string | no |  |
| `filter[archived]` | query | boolean | no |  |
| `include` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of 25 projects by key. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## All spending lines, By person and the EUR totals (the Cashflow page; R08, R09, R12)

`GET /finance/spendings`

- Operation ID: `listSpendings`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `q` | query | string | no | Only the lines whose name holds this text (any case). |
| `category` | query | string | no | Only the lines of this category (any case). |
| `project` | query | string | no | Only the lines of this project key, or global for the lines without a project. |
| `active` | query | string | no | true: only the lines that cost now; false: only the others. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The lines as they are now. Without view_cashflow the page is hidden (404 route.not_found). | application/json | `object` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Add a spending on the Cashflow page; the project is optional (R07)

`POST /finance/spendings`

- Operation ID: `addSpending`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `SpendingAddRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The new line, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Remove a line that has one row (R15); with=history deletes it with all its rows (R15a)

`DELETE /finance/spendings/{itemId}`

- Operation ID: `removeSpending`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `itemId` | path | string (uuid) | yes | A spending item's id; hidden and missing are one 404 (spending.not_found). |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | no | G262: the same durable command receipt key on a DELETE that takes it optionally. With a key, a retry answers the stored status; without a key, the request runs as before. |
| `with` | query | string | no | history: delete the line with every row it has (R15a, owner Q39). Another value answers 400 query.invalid. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The item and its rows are deleted. |  |  |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Move a line to a category — every row, no new row (R22)

`PUT /finance/spendings/{itemId}/category`

- Operation ID: `moveSpendingCategory`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `itemId` | path | string (uuid) | yes | A spending item's id; hidden and missing are one 404 (spending.not_found). |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

Request body (application/json, required): `SpendingCategoryRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The line, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## A new amount from a month on, or a correction of the newest row in its own month (R03, R14)

`POST /finance/spendings/{itemId}/changes`

- Operation ID: `changeSpendingFrom`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `itemId` | path | string (uuid) | yes | A spending item's id; hidden and missing are one 404 (spending.not_found). |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `SpendingChangeRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The line, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The month uses the amount of the line again (R23, OF-15)

`DELETE /finance/spendings/{itemId}/months/{month}`

- Operation ID: `resetSpendingMonth`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `itemId` | path | string (uuid) | yes | A spending item's id; hidden and missing are one 404 (spending.not_found). |
| `month` | path | string | yes | The month of a one-month amount (F-FIN-16.R23), `YYYY-MM`. |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The line, read back; the ETag is its new monthsVersion. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Change the amount of ONE month of a line; the line and the other months do not change (R23, OF-15); a one-time line takes any month (R10a)

`PUT /finance/spendings/{itemId}/months/{month}`

- Operation ID: `setSpendingMonth`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `itemId` | path | string (uuid) | yes | A spending item's id; hidden and missing are one 404 (spending.not_found). |
| `month` | path | string | yes | The month of a one-month amount (F-FIN-16.R23), `YYYY-MM`. |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `SpendingMonthRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The line, read back; the ETag is its new monthsVersion. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Stop a repeating line from a month on (R04)

`POST /finance/spendings/{itemId}/stop`

- Operation ID: `stopSpendingFrom`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `itemId` | path | string (uuid) | yes | A spending item's id; hidden and missing are one 404 (spending.not_found). |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `SpendingStopRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The line, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Discard the draft; it stays readable as history

`DELETE /plan-versions/{planVersionId}`

- Operation ID: `discardPlanVersion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `planVersionId` | path | string (uuid) | yes | A plan version's id; hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | Discarded. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One plan version with its totals and warnings

`GET /plan-versions/{planVersionId}`

- Operation ID: `getPlanVersion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `planVersionId` | path | string (uuid) | yes | A plan version's id; hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The version (ETag is its version). | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Change the note of the draft

`PATCH /plan-versions/{planVersionId}`

- Operation ID: `updatePlanVersion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `planVersionId` | path | string (uuid) | yes | A plan version's id; hidden and missing are one 404. |

Request body (application/json, required): `PlanVersionPatchRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The draft with its new note (ETag is its version). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Approve the draft as the project's baseline; amounts freeze, the earlier baseline is superseded

`POST /plan-versions/{planVersionId}/approve`

- Operation ID: `approvePlanVersion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `planVersionId` | path | string (uuid) | yes | A plan version's id; hidden and missing are one 404. |

Request body (application/json): `PlanApproveRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The approved version. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Add, change or delete up to 500 planned expense lines of a draft, all or nothing

`POST /plan-versions/{planVersionId}/expense-line-changes`

- Operation ID: `changePlanExpenseLines`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-10

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `planVersionId` | path | string (uuid) | yes | A plan version's id; hidden and missing are one 404. |

Request body (application/json, required): `PlanExpenseLineChangesRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The draft with its new totals and warnings. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The planned expense lines of a plan version, by month then category

`GET /plan-versions/{planVersionId}/expense-lines`

- Operation ID: `listPlanExpenseLines`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-10

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `planVersionId` | path | string (uuid) | yes | A plan version's id; hidden and missing are one 404. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |
| `filter[month]` | query | string | no |  |
| `filter[categoryId]` | query | string (uuid) | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of 100 expense lines. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Add, change or delete up to 500 lines of a draft, all or nothing

`POST /plan-versions/{planVersionId}/line-changes`

- Operation ID: `changePlanLines`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `planVersionId` | path | string (uuid) | yes | A plan version's id; hidden and missing are one 404. |

Request body (application/json, required): `PlanLineChangesRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The draft with its new totals and warnings. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The lines of a plan version, by month then subject

`GET /plan-versions/{planVersionId}/lines`

- Operation ID: `listPlanLines`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `planVersionId` | path | string (uuid) | yes | A plan version's id; hidden and missing are one 404. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |
| `filter[month]` | query | string | no |  |
| `filter[teamId]` | query | string (uuid) | no |  |
| `filter[subjectKind]` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of 100 lines. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project's alert rules in force and the states of its baseline

`GET /projects/{projectKey}/budget-alerts`

- Operation ID: `getBudgetAlerts`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-08

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The rules and states (ETag is the finance row's version); no amounts. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Set the project's own alert rules, or return to the tenant default

`PUT /projects/{projectKey}/budget-alerts`

- Operation ID: `setBudgetAlerts`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-08

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

Request body (application/json, required): `BudgetAlertsRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The rules and the re-evaluated states. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Baseline, actual, provisional, estimate, remaining, forecast and variance of one project

`GET /projects/{projectKey}/budget-comparison`

- Operation ID: `getBudgetComparison`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-07

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `from` | query | string | no |  |
| `to` | query | string | no |  |
| `grain` | query | string | no |  |
| `by` | query | string | no |  |
| `include` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The comparison in the project's currency, for a holder of view_finance on the project. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project's cost ledger entries, newest first

`GET /projects/{projectKey}/cost-entries`

- Operation ID: `listProjectCostEntries`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-06

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |
| `filter[memberId]` | query | string (uuid) | no |  |
| `filter[workDate][gte]` | query | string (date) | no |  |
| `filter[workDate][lte]` | query | string (date) | no |  |
| `filter[cause]` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of 100 entries under the reader's time-visibility level, for a holder of view_finance on the project. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Re-synchronise and re-price the project's accepted time from a date (a long-running operation)

`POST /projects/{projectKey}/cost-rebuild`

- Operation ID: `rebuildProjectCosts`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-06

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

Request body (application/json, required): `CostRebuildRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The operation; its result holds the scanned and changed counts. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project's expenses, newest first

`GET /projects/{projectKey}/expenses`

- Operation ID: `listProjectExpenses`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |
| `filter[state]` | query | string | no |  |
| `filter[categoryId]` | query | string (uuid) | no |  |
| `filter[incurredOn][gte]` | query | string (date) | no |  |
| `filter[incurredOn][lte]` | query | string (date) | no |  |
| `filter[memberId]` | query | string (uuid) | no | The member the expenses are for (XM-874, from XM-869). Only for a reader of the member link (R10) — a holder of `manage_finance` on the project or of `view_rates`; any other reader gets `403 access.forbidden`, so the filter never tells who an expense is for. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of 50 expenses. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Record an expense of the project (net of VAT), or a correction of a reversed one

`POST /projects/{projectKey}/expenses`

- Operation ID: `recordExpense`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-11

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

Request body (application/json, required): `ExpenseRecordRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The expense (recorded, or approved when no approval is needed). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project's finance profile — currency, billable flag, baseline and draft summaries, what the caller may do

`GET /projects/{projectKey}/finance`

- Operation ID: `getProjectFinance`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The profile (ETag is the finance row's version). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Change the project's currency (before the first amount) or its billable flag

`PATCH /projects/{projectKey}/finance`

- Operation ID: `updateProjectFinance`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

Request body (application/json, required): `ProjectFinancePatch`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The profile. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The one budget amount of the project, spent so far, left and used (R20, R21)

`GET /projects/{projectKey}/finance/budget`

- Operation ID: `getProjectBudget`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The budget and the derived figures (the ETag is the finance row's version). | application/json | `object` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Set the one budget amount of the project, or remove it with null (R20)

`PUT /projects/{projectKey}/finance/budget`

- Operation ID: `setProjectBudget`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

Request body (application/json, required): `ProjectBudgetRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The budget, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The people of the project with the cost and bill rate that price their work here on a date (R15; audited)

`GET /projects/{projectKey}/finance/member-rates`

- Operation ID: `listProjectMemberRates`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `asOf` | query | string (date) | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | One row per person of the project (R09), by name, at most 500; `meta.truncated` is true when the project has more (KDC-07). | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The active internal members who are not people of the project, by name, for "Add to this project" (R17)

`GET /projects/{projectKey}/finance/people-candidates`

- Operation ID: `listProjectPeopleCandidates`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |
| `q` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of 50 members by name, then id; `links.next` reads the next page. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Change a person's delivery role and project rates on this project from a date, or correct the past (R18, R19; audited)

`POST /projects/{projectKey}/finance/people/{memberId}/changes`

- Operation ID: `changeProjectPerson`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `memberId` | path | string (uuid) | yes | A member's id; a member outside the tenant and a missing one are one 404. |

Request body (application/json, required): `ProjectPersonChangeRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The person's history after the change (R16); the ETag is the new version. Warnings name a member who is not on the project. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## A dry run of a change — the roles and rates before and after, the accepted time repriced by month, the postings, timesheets, baselines and reports (R20); writes nothing

`POST /projects/{projectKey}/finance/people/{memberId}/changes/preview`

- Operation ID: `previewProjectPersonChange`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `memberId` | path | string (uuid) | yes | A member's id; a member outside the tenant and a missing one are one 404. |

Request body (application/json, required): `ProjectPersonChangeRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | What the change would do; no row, event or change audit record is written. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One person of the project — the role and rates today, the rate versions and role entries that price the person here, the version (R16; audited)

`GET /projects/{projectKey}/finance/people/{memberId}/rate-history`

- Operation ID: `getProjectPersonRateHistory`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `memberId` | path | string (uuid) | yes | A member's id; a member outside the tenant and a missing one are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The person's history; the ETag is the person's version (R21), the If-Match of a change. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project's plan versions, newest first

`GET /projects/{projectKey}/plan-versions`

- Operation ID: `listPlanVersions`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of 25 versions with their totals. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Start a draft — empty, from the baseline or from a named version

`POST /projects/{projectKey}/plan-versions`

- Operation ID: `createPlanVersion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

Request body (application/json, required): `PlanVersionCreateRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The draft. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The lines of one project, By person and the EUR totals (the project's Finance page; R08, R19)

`GET /projects/{projectKey}/spendings`

- Operation ID: `listProjectSpendings`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The project's lines as they are now. | application/json | `object` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Add a spending with the project of the page (R07, R19)

`POST /projects/{projectKey}/spendings`

- Operation ID: `addProjectSpending`
- Call with: Session of the Youniton apps (app only)
- Feature: F-FIN-16

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `SpendingAddRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The new line, read back. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
