# Request reference

> Every field of the core model sent to the Towers API.

A **Program** holds **Contracts**, each with **Layers** and **Lines**, and **Risks** listing the Contracts that protect them through `contractRefs`.

All percentages are 0–100. Amounts are plain numbers in the Layer's effective currency. The API validates the core model and returns every error with its request path. Caller extensions are preserved, but removed v1 fields are rejected. See [Migrating from v1](#migrating-from-v1).

## Top level

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `program` | object | yes | The [Program](#program). |
| `requestId` | string | | Your reference for the call. |
| `requestedAt` | string | | When you made the call. |
| `source` | object | | `system` (required string), `version` (optional string). |
| `viewpoint` | object | | Defaults to `{ "kind": "whole" }`. Use `{ "kind": "reinsurer", "reinsurer": "Name" }` to draw, report, estimate or compare one reinsurer’s participation. See [Viewpoints](https://towers.vinsa.dev/docs/api/viewpoints.md). |

## Per-operation options

| Field | Type | Operation | Meaning |
| --- | --- | --- | --- |
| `decimals` | integer | [`POST /placements`](https://towers.vinsa.dev/docs/api/placements.md) | Signed-share rounding, 0–7, default 4. No rounding on short or exactly subscribed Layers. |
| `losses` | Loss[] | [`POST /recoveries`](https://towers.vinsa.dev/docs/api/recoveries.md) | Required list of at least one [Loss](https://towers.vinsa.dev/docs/api/recoveries.md#loss) from one contract year. |
| `openingPositions` | OpeningPosition[] | [`POST /recoveries`](https://towers.vinsa.dev/docs/api/recoveries.md) | Optional [booked annual positions](https://towers.vinsa.dev/docs/api/recoveries.md#opening-positions) to resume Recovery Estimates, one per Contract and Layer pair. |
| `splitByLine` | boolean | [`POST /recoveries`](https://towers.vinsa.dev/docs/api/recoveries.md) | Set to `true` to include recovery Estimates per drawn Line in `LayerYear.byLine`. |

### Loss

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `lossId` | string | yes | Non-empty and unique in the request. |
| `riskId` | string | yes | Risk reference from the Program. |
| `date` | string | yes | Valid ISO calendar date (`YYYY-MM-DD`). |
| `amount` | number | yes | Finite, non-negative gross amount at 100%. |
| `currency` | string | yes | Non-empty currency. |
| `eventId` | string | | Non-empty caller reference grouping Losses. |

### OpeningPosition

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `contractRef` | string | yes | Non-empty Contract reference. |
| `layerRef` | string | yes | Non-empty Layer reference within the Contract. |
| `aadUsed` | number | yes | Finite, non-negative AAD already used. |
| `reinstatementsUsed` | integer | yes | Finite, non-negative count of reinstatement entries already started. |
| `limitRemaining` | number | yes | Finite, non-negative annual capacity left. |

See [Opening positions](https://towers.vinsa.dev/docs/api/recoveries.md#opening-positions) for how the Engine resumes recovery calculations.

## Program

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `contracts` | Contract[] | yes | At least one [Contract](#contract). |
| `risks` | Risk[] | yes | At least one [Risk](#risk). |
| `programRef`, `programName` | string | | Your identity and title. |
| `cedant`, `broker` | string | | |
| `inceptionDate`, `expiryDate` | string | | Each supplied date must be a valid `YYYY-MM-DD` date. With both dates, expiry must be on or after inception. The pair supplies the fallback period for amount-and-time reinstatements. |
| `baseCurrency` | string | | Program metadata; each Contract still needs its currency. |

## Contract

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `contractRef` | string | yes | Non-empty, unique in the Program; Risks link by it. Layers of one Contract share a colour. |
| `currency` | string | yes | Non-empty; a Layer may override it. |
| `layers` | Layer[] | yes | At least one [Layer](#layer). |
| `contractName`, `umr` | string | | |
| `lineOfBusiness` | string | | Used with effective Layer currency to group towers. |
| `inceptionDate`, `expiryDate` | string | | Each supplied date must be a valid `YYYY-MM-DD` date. With both dates, expiry must be on or after inception. Use the Contract pair for amount-and-time reinstatements when complete, then the Program pair. |
| `stage` | string | | `quotation`, `order` or `endorsement`; informational. |
| `signingRule` | string | | `pro rata` (default) or `as supplied`. The Engine computes pro rata signing or checks supplied Signed shares through [`/placements`](https://towers.vinsa.dev/docs/api/placements.md). Both rules supply the shares drawn by `/towers`. |
| `inuringOrder` | number | | Finite rank that applies to every Layer on the Contract. Lower ranks see a Loss first and equal ranks share a step. Defaults by Layer are 1 proportional, 2 per-claim and per-risk XL, 3 per-event XL and 4 aggregate XL. |

## Risk

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `riskId` | string | yes | Non-empty and unique within the Program. Identifies the Risk in the response. |
| `contractRefs` | string[] | yes | Non-empty, without duplicates; every entry must name a Contract in the Program. |
| `policyRef`, `insuredName` | string | | The insured name titles a Risk's charts. |
| `sumInsured` | number | | Non-negative. Caps facultative cover stacked above surplus and sets the exposure base for surplus-band recovery cessions. |
| `inceptionDate`, `expiryDate` | string | | ISO dates. |

A Contract protecting several Risks is drawn at full size on each Risk. Every Contract block returns `sharedRiskCount`, the number of Risks listing that Contract. Retention filler blocks return `0`. Drawing does not allocate or divide a shared limit.

## Layer

### Identity and geometry

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `layerName` | string | yes | Non-empty; shown on the Layer. |
| `layerRef` | string | | Your reference; supply one when names could repeat. |
| `layerType` | string | yes | `QSR` quota share, `SPL` surplus, `FAC` facultative, `XOL` excess of loss. |
| `currency` | string | | Overrides the Contract's currency. |
| `lowerLimit` | number | yes | Non-negative attachment. |
| `upperLimit` | number or null | when limited | Greater than `lowerLimit` when limited; omitted or `null` when unlimited. |
| `isUnlimited` | boolean | yes | Whether the Layer has no upper limit. |
| `layerAmount` | number or null | | Non-negative limit when held separately. |
| `accumulateBasis` | string | | `CLM` per claim, `RSK` per risk, `EVT` per event, `AGR` aggregate. |
| `protection` | string | | `ALL` whole risk after inuring treaties, `FGR` gross risk alongside quota share, `RET` retention only. |

See [How layers become towers](https://towers.vinsa.dev/docs/api/layering.md).

### Placement and proportional cession

| Field | Type | Meaning |
| --- | --- | --- |
| `order` | number | Share of the whole Layer being placed. Defaults to 100 on proportional Layers; on XOL, `participationShare` if set, otherwise 100. The reinsurer viewpoint requires an explicit Order. |
| `lineBasis` | string | `of order` (default) or `of whole`. |
| `lines` | Line[] | Optional panel; see [Line](#line) and the [drawing rules](https://towers.vinsa.dev/docs/api/layering.md#width-is-share-height-is-amount). |
| `participationShare` | number | Percentage of the Risk to which a proportional Layer applies. Descriptive for surplus, quota share within the surplus retention, and facultative stacked above surplus. |
| `retainedShare` | number | Percentage the cedant keeps under the treaty, applied to participation or to the surplus retention for quota share with surplus. Descriptive for surplus and facultative stacked above surplus. |

For a quota share without surplus or facultative outside the surplus stack, the proportional cession is `participationShare × (100 − retainedShare) / 100` percent of the Risk. This cession is the Layer's whole; Order and Lines are percentages of it. For example, 80% participation with 30% retained cedes 56% of the Risk at Order 100. Proportional Layers recover their cession fraction of the Loss seen at their inuring step. See the [proportional recovery formulas](https://towers.vinsa.dev/docs/api/recoveries.md#proportional-cession).

The Engine converts a Line to share of whole: `writtenShare × order / 100` on `of order`, and `writtenShare` on `of whole`. Tower widths follow the [drawing rules](https://towers.vinsa.dev/docs/api/layering.md#width-is-share-height-is-amount).

### Terms

| Field | Type | Meaning |
| --- | --- | --- |
| `premium`, `commission` | number | Non-negative amounts. |
| `aad` | number | Non-negative annual aggregate deductible. Recovery Estimates apply it to in-layer amounts after the Event cap and before using annual capacity. |
| `aggregateLimit` | number | Non-negative annual cap on recovery after AAD. The default is `(K + 1) × limit`, where K is the reinstatement count. Unlimited Layers without an explicit annual limit have no cap. |
| `eventLimit` | number | Non-negative cap across all covered Risks in one Event for a per-risk (`RSK`) Layer. Other bases return a validation error (HTTP 400). |
| `reinstatements` | Reinstatement[] | One entry per reinstatement; see below. |

See [Annual terms](https://towers.vinsa.dev/docs/api/recoveries.md#annual-terms) for how Recovery Estimates apply these fields.

### Reinstatement

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `number` | number | yes | Positive ordinal integer. The Engine uses entries in ascending order, starting with 1 for the first reinstatement. |
| `rate` | number | yes | Percentage of the Layer premium. Any finite number ≥ 0, which may exceed 100. Zero means free. |
| `basis` | string | | `amount` (default) or `amount and time`. The time basis also applies the fraction of the Contract or Program period left on each Loss date. |

### Display

| Field | Type | Meaning |
| --- | --- | --- |
| `overlapGroup` | string | Layers sharing it take one horizontal slot. |
| `display` | object | Drawing hints, read only by `/towers`. |
| `display.colorOverride` | string | CSS colour. |
| `display.labelOverride` | string | Label replacing the Layer's name. |
| `display.sortOrder` | number | Finite position within a band; lower first. |

## Line

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `reinsurer` | string | yes | Non-empty reinsurer name. |
| `marketRef` | string | | Your market reference. |
| `status` | string | yes | `indication`, `quoted`, `firm order`, `signed` or `declined`. |
| `writtenShare` | number | yes | Percentage on the Layer's Line basis, 0–100. |
| `signedShare` | number | firm Lines under whole-viewpoint `as supplied` signing | Percentage on the same basis, 0–100. In the reinsurer viewpoint, the supplied share takes precedence under either signing rule. In the whole viewpoint with `pro rata`, the Engine computes every Signed share and warns when a supplied value differs after rounding or no Signed share can be computed. In the whole viewpoint with `as supplied`, a missing value on a firm or signed Line is a 400 validation error at its `signedShare` path. A supplied value on a non-firm Line gives a warning and is ignored. See the [drawing rules](https://towers.vinsa.dev/docs/api/layering.md#width-is-share-height-is-amount). |
| `toStand` | boolean | | The Line may not be signed down. |
| `isLead` | boolean | | Lead Line, which absorbs signing rounding remainders. |

## Migrating from v1

This is a breaking change to v1 in place, with no compatibility layer. The [response reference](https://towers.vinsa.dev/docs/api/response.md) describes the output.

**Request**

| v1 field | New | Notes |
|---|---|---|
| `risks[]` (top level) | `program.risks[]` | Program now holds Contracts and Risks |
| `risks[].layers[]` | `program.contracts[].layers[]` | Layers belong to Contracts; Risks list `contractRefs` |
| `program.*` metadata | `program.*` | unchanged |
| `risks[].umr` | `contracts[].umr` | moved |
| `risks[].lineOfBusiness`, `layers[].lineOfBusiness` | `contracts[].lineOfBusiness` | moved; Risk fallback removed |
| `risks[].currency`, `layers[].currency` | `contracts[].currency`, optional `layers[].currency` override | Risk fallback removed |
| `layers[].contractRef` | `contracts[].contractRef` | Layer is inside its Contract |
| `layers[].layerRefNo` | `layers[].layerRef` | |
| `layers[].placedAt` | `layers[].order` | Order % of whole; see note A |
| `layers[].placementStatus` | removed | Layer status is derived |
| `layers[].reinsurers[]` | `layers[].lines[]` | |
| `reinsurers[].name` | `lines[].reinsurer` | |
| `reinsurers[].share` | `lines[].writtenShare` (+ optional `signedShare`) | on the Layer's `lineBasis`; see note B |
| `reinsurers[].status` | `lines[].status` | now required; `unplaced` removed, `declined` added |
| — | `lines[].toStand`, `lines[].isLead` | new |
| — | `layers[].lineBasis` | new, default `of order` |
| `layers[].premiumAmount` | `layers[].premium` | |
| `layers[].commissionAmount` | `layers[].commission` | |
| `layers[].aadLimit` | `layers[].aad` | still the deductible, an input; the aggregate limit is the calculated figure |
| — | `layers[].aggregateLimit`, `layers[].eventLimit` | new |
| `reinstatements[].premium` | `reinstatements[].rate` | + `basis` |
| `layers[].contStartDate`, `layers[].expiryDate` | `contracts[].inceptionDate`, `contracts[].expiryDate` | falls back to the Program's dates; Layer dates removed |
| — | `contracts[].stage`, `signingRule`, `inuringOrder` | new |
| — | `viewpoint` | new, default whole |
| `participationShare`, `retainedShare` | unchanged | now defined precisely (see proportional cession above) |
| `overlapGroup`, `display`, `protection`, `accumulateBasis`, limits | unchanged | |

Note A: v1 `placedAt` was a drawn width; `order` is the share being placed, with the type-specific defaults above. See the [drawing rules](https://towers.vinsa.dev/docs/api/layering.md#width-is-share-height-is-amount) for how Lines and Order determine the picture.

Note B: in v1 a reinsurer's `share` is a % of the whole Layer (Northshore's Cat XL 3 lines sum to its `placedAt` of 85). A migrating caller either sets `lineBasis: 'of whole'` or divides each share by the Order.

**Response (`/towers`)**

| v1 block field | New | Notes |
|---|---|---|
| `layerRefNo` | `layerRef` | follows the request |
| `placedAt` | `order` | |
| `reinsurerName` | `reinsurer` | |
| `reinsurerStatus` | `lineStatus` | |
| `share` | `share` | now the drawn share of whole: signed, else written |
| `aadLimit` | `aad` | |
| `currency` | `currency` | the Layer's effective currency |
| — | `blockKind` | Reinsurer viewpoint only. |
| — | `sharedRiskCount` | number of Risks listing the Contract (see Contract sharing above) |

All other response fields (`xSpan`, `ySpan`, `colorKey`, `isRetention`, `overlapId`, bands, `unlimitedBands`, `unlimitedDisplayHeight`) keep their meaning. Every Layer now belongs to a Contract, so its Contract supplies its `colorKey`; retention keeps the key `retention`.
