Place Lines
POST https://towers-api.vinsa.dev/api/v1/placementsSend the same core Program model as /towers to derive Placement facts: firm totals, Support, gaps, oversubscription, Signed shares, and amounts placed. The operation is stateless and returns no geometry. It counts each Contract once, even when several Risks list it.
amountPlaced is a Placement fact for illustration and decisions. It is not premium or a bookable accounting figure.
Help me add Towers placement facts and pro rata signing to this project. 1. Read the Towers setup skill at https://towers.vinsa.dev/.well-known/agent-skills/towers/SKILL.md and follow its steps in order. 2. Follow the Placement-only path and the operation guide at https://towers.vinsa.dev/docs/api/placements.md. Call POST /placements from my server with my Program and optional decimals, and present its derived facts, warnings and limitations. 3. Ask me for my Towers API key rather than making one up, and keep it in a server-side env file that is not committed. 4. When you are done, tell me what you changed and anything still waiting on me.
Request
Section titled “Request”Use Authorization: Bearer <your key> (or X-API-Key) and Content-Type: application/json. The shared request fields are in the request reference.
| Field | Type | Required | Meaning |
|---|---|---|---|
program |
Program | yes | Contracts holding Layers and Lines, with Risks listing contractRefs. |
requestId, requestedAt |
string | Caller metadata. | |
source |
object | system (required string), version (optional string). |
|
viewpoint |
object | Defaults to whole. Use the reinsurer viewpoint for Our share. |
|
decimals |
integer | Pro rata rounding precision and as supplied total-check tolerance (10^-decimals), 0–7; default 4. Supplied shares are never rounded. |
In the whole viewpoint, Order defaults to 100 on proportional Layers and to participationShare, else 100, on XOL. Line basis defaults to of order. The Engine converts each Written share to share of whole as writtenShare × order / 100 for of order, or writtenShare for of whole. All Layer percentages of Order are on the Order: an of whole share becomes share × 100 / order before those totals are calculated.
Counting and status
Section titled “Counting and status”In the whole viewpoint, only firm order and signed Lines count towards the firm total. indication and quoted Lines are reported separately as Support. declined Lines count for nothing. Non-firm Lines retain their Written share of whole, with all three signing fields returned as null.
| Placement status | Meaning |
|---|---|
open |
No firm Lines, or Order zero. |
short |
Firm total under 100% of Order. |
fully subscribed |
Firm total equals 100% of Order, with a small numeric tolerance. |
oversubscribed |
Firm total over 100% of Order before signing. |
signed |
At least one firm Line, with all firm Lines marked signed. Takes precedence over short, fully subscribed and oversubscribed. |
A signed-short Layer still reports its gap. The optional Contract stage is echoed, with null when absent; it never changes Placement status. Every status count includes all five keys, even when their values are zero.
Pro rata signing
Section titled “Pro rata signing”The whole viewpoint defaults to the London model signing approach described by the Contract Certainty Code, Appendix 3 and the Whitespace signed-line calculation guide.
When the firm total is over 100% of Order, To stand Lines keep their Written shares. Other firm Lines receive one factor:
factor = (100 − S) / WS is the total of firm To stand Lines and W the total of other firm Written Lines, both as percentages of Order. The factor is reported unrounded. Non-To stand Signed shares are rounded on the Layer’s Line basis to decimals places. The remainder needed to fill the Order, positive or negative, goes to the firm Lead line unless it is To stand; otherwise it goes to the first firm Line in request order that is not To stand. To stand Lines never change. A remainder can retain more decimal places when the Order or unchanged To stand Lines require them.
When the firm total is at or below 100%, Signed equals Written, with factor 1 and no rounding. A Layer with no Lines is open with nothing placed. /towers uses these signing results according to the drawing rules.
Whitespace example
Section titled “Whitespace example”The worked case has Order 100 and firm Lines A 53 To stand, B 50, C 13. Firm total is 116 and oversubscription 16. B and C receive factor 47 / 63, approximately 0.746032; A keeps factor 1. At four decimal places, Signed shares are 53 / 37.3016 / 9.6984. With decimals: 1, they are 53 / 37.3 / 9.7.
This request and response are generated by the Engine when the documentation examples are rebuilt.
{ "program": { "programRef": "WHITESPACE", "contracts": [ { "contractRef": "C-1", "currency": "GBP", "layers": [ { "layerRef": "L-1", "layerName": "First excess", "layerType": "XOL", "lowerLimit": 1000000, "upperLimit": 2000000, "layerAmount": 1000000, "isUnlimited": false, "order": 100, "lineBasis": "of order", "lines": [ { "reinsurer": "A", "status": "firm order", "writtenShare": 53, "toStand": true }, { "reinsurer": "B", "status": "firm order", "writtenShare": 50 }, { "reinsurer": "C", "status": "firm order", "writtenShare": 13 } ] } ] } ], "risks": [ { "riskId": "R-1", "contractRefs": [ "C-1" ] } ] }}{ "program": { "amountPlaced": [ { "currency": "GBP", "amount": 1000000 } ], "layerCountByStatus": { "open": 0, "short": 0, "fully subscribed": 0, "oversubscribed": 1, "signed": 0 } }, "contracts": [ { "contractRef": "C-1", "stage": null, "amountPlaced": [ { "currency": "GBP", "amount": 1000000 } ], "layerCountByStatus": { "open": 0, "short": 0, "fully subscribed": 0, "oversubscribed": 1, "signed": 0 }, "layers": [ { "layerRef": "L-1", "layerName": "First excess", "order": 100, "lineBasis": "of order", "firmTotal": 116, "support": { "indication": 0, "quoted": 0 }, "placedOfOrder": 100, "placedOfWhole": 100, "gap": 0, "oversubscription": 16, "status": "oversubscribed", "currency": "GBP", "amountPlaced": 1000000, "lines": [ { "reinsurer": "A", "status": "firm order", "writtenShare": 53, "writtenShareOfWhole": 53, "signedShare": 53, "signedShareOfWhole": 53, "signingFactor": 1 }, { "reinsurer": "B", "status": "firm order", "writtenShare": 50, "writtenShareOfWhole": 50, "signedShare": 37.3016, "signedShareOfWhole": 37.3016, "signingFactor": 0.746031746031746 }, { "reinsurer": "C", "status": "firm order", "writtenShare": 13, "writtenShareOfWhole": 13, "signedShare": 9.6984, "signedShareOfWhole": 9.6984, "signingFactor": 0.746031746031746 } ], "warnings": [] } ] } ], "warnings": [], "limitations": []}Response reference
Section titled “Response reference”Top level
Section titled “Top level”| Field | Type | Meaning |
|---|---|---|
program |
ProgramPlacement | Per-currency totals and Layer counts. |
contracts |
ContractPlacement[] | Results keyed by contractRef. |
warnings |
Issue[] | Layer warnings collected across the Program. |
limitations |
Issue[] | Facts that cannot be derived, with request paths. |
ProgramPlacement
Section titled “ProgramPlacement”| Field | Type | Meaning |
|---|---|---|
amountPlaced |
Money[] or null | Sum of known Layer amounts placed, grouped by currency. Null in the reinsurer viewpoint. |
layerCountByStatus |
StatusCounts or null | Counts across all Contracts, with all five status keys. Null in the reinsurer viewpoint. |
ContractPlacement
Section titled “ContractPlacement”| Field | Type | Meaning |
|---|---|---|
contractRef |
string | The caller’s Contract ref. |
stage |
string or null | quotation, order, endorsement, or null when absent. Informational. |
amountPlaced |
Money[] or null | Sum of known Layer amounts placed, grouped by effective currency. Null in the reinsurer viewpoint. |
layerCountByStatus |
StatusCounts or null | Layer counts for this Contract. Null in the reinsurer viewpoint. |
layers |
LayerPlacement[] | Results keyed by layerRef (null when no ref was supplied). |
LayerPlacement
Section titled “LayerPlacement”| Field | Type | Meaning |
|---|---|---|
layerRef |
string or null | Caller ref, null when absent. |
layerName |
string | Caller name. |
order |
number or null | Order, including the type-specific default in the whole viewpoint. Null when missing in the reinsurer viewpoint. |
ourShareOfWhole |
number or null (optional) | Reinsurer viewpoint only. Sum of Our Lines’ Signed shares of whole, falling back to Written share per Line. Null without Order. |
lineBasis |
string | of order or of whole. |
firmTotal |
number or null | Firm Written total, % of Order. |
support |
Support or null | Written Support by status, % of Order. |
placedOfOrder |
number or null | min(firmTotal, 100), % of Order. |
placedOfWhole |
number or null | placedOfOrder × order / 100, % of whole. At Order zero it is 0. |
gap |
number or null | max(0, 100 − firmTotal), % of Order. |
oversubscription |
number or null | max(0, firmTotal − 100), % of Order. |
status |
PlacementStatus or null | Derived from firm Lines. |
currency |
string | Layer override, else Contract currency. |
amountPlaced |
number or null | Layer amount × placed share of whole / 100. |
lines |
LinePlacement[] | Results identified by Line reinsurer. |
warnings |
Issue[] | This Layer’s warnings, also collected at the response root. |
LinePlacement
Section titled “LinePlacement”| Field | Type | Meaning |
|---|---|---|
reinsurer |
string | Line identity. |
status |
string | indication, quoted, firm order, signed or declined, as supplied. |
writtenShare |
number | Written share on the Layer’s Line basis. |
writtenShareOfWhole |
number or null | Written share converted to % of whole. |
signedShare |
number or null | Computed or supplied Signed share on the same Line basis. The reinsurer viewpoint returns the supplied value or null. |
signedShareOfWhole |
number or null | Computed or supplied Signed share converted to % of whole. |
signingFactor |
number or null | Unrounded pro rata factor (1 for To stand or unscaled firm Lines), or supplied Signed / Written share (null when Written is zero). |
Supporting types
Section titled “Supporting types”| Type | Fields |
|---|---|
| Money | currency: string, amount: number. Available totals are arrays grouped by currency, never a sum across currencies. |
| StatusCounts | open, short, fully subscribed, oversubscribed, signed: all numbers, zeros included. |
| Support | indication: number, quoted: number, both % of Order. |
| Issue | code: string, message: string, optional path: string into the request. See Issue. |
Warnings and current limitations
Section titled “Warnings and current limitations”- Supplied Signed shares under pro rata: ignored. If a sent
signedSharediffers from the computed result after rounding, or no Signed share is computed (including non-firm Lines, to-stand overflow and Order zero), the Layer and root warnings includesigned-share-ignoredwith that Line’s path. The Engine always computes pro rata signing itself. - Rounding above Written share: a remainder can make the recipient’s computed Signed share exceed its Written share at coarse precision. This produces a
signed-share-above-writtenwarning with the Line path. - Pro rata To stand exceeds Order: the Layer gets a warning, and all its Lines return
signedShare,signedShareOfWholeandsigningFactorasnull, with a limitation. Firm total, Support, placed, gap, oversubscription and status are still reported. - Whole-viewpoint
as suppliedsigning: everyfirm orderorsignedLine must sendsignedShare; a missing value returns 400 with its Line field path. Non-firm Lines need none; any sent value is ignored withsigned-share-ignoredand their signing fields stay null. Firm values are returned exactly as sent, without rounding;signedShareOfWholeuses the Layer’s Line basis andsigningFactor = signedShare / writtenShare(null when Written share is zero). The firm Signed total, converted to % of Order, must equalmin(firm written total, 100), within10^-decimals(default 4). Oversubscribed Layers must total 100%; short or exactly full Layers must total their firm Written shares. A discrepancy producessigned-total-mismatchwith the Layer path and expected and actual totals. A moved To stand Line producesto-stand-share-moved; a Signed share above Written producessigned-share-above-written, both with Line paths. Warnings preserve the supplied values. Layer status and other facts still derive from Written Lines as before. The pro rata To stand overflow rule does not suppress supplied shares. - Reinsurer viewpoint. Only Our non-declined Lines are returned. Supplied Signed shares take precedence under either rule. The signing factor, whole-Layer Placement facts, and Contract and Program totals are null with one
viewpoint-layer-facts-unavailablelimitation. See Viewpoints for the full list of fields and warnings. - Unavailable Layer amount: an unlimited Layer or an explicit
layerAmount: nullreturnsamountPlaced: null, is left out of Contract and Program money totals, and gets one limitation per Layer. When a finite Layer omitslayerAmount, its amount is derived fromupperLimit − lowerLimit. If no Layer has a known amount, the totals are empty arrays. - Order zero in the whole viewpoint: percentages of Order (
firmTotal,support,placedOfOrder,gap,oversubscription) and signing fields arenull, status isopen, and the Layer has onezero-orderwarning.placedOfWholeis 0, as isamountPlacedwhen its Layer amount is known. Written shares of whole are still returned.
Stored-program mirror
Section titled “Stored-program mirror”The private programs app may call this without an API key, including when programs are read-only:
POST /api/v1/programs/:id/placementsThe body is { "decimals": 1 }, or {} for the default. It runs the same Engine on the stored request, returns the same response shape and stores no placement results. The body cannot replace the stored Program. An unknown id returns 404; invalid decimals returns 400.
Keep this route private behind the deployment proxy, like every /programs route.
Errors
Section titled “Errors”| Status | Meaning |
|---|---|
400 |
Core model or decimals validation failed; errors contains request paths and messages. |
401 |
Missing or invalid API key on the public endpoint. |
Full example: Northshore
Section titled “Full example: Northshore”This response excerpt shows the oversubscribed and short Cat XL Layers in the 2026 program. Shares on the Lines are percentages of the whole Layer.
Download the Northshore request.
{ "contracts": [ { "contractRef": "NSM-CAT", "layers": [ { "layerRef": "NSM-CAT-01", "order": 100, "firmTotal": 115, "placedOfWhole": 100, "status": "oversubscribed", "gap": 0, "oversubscription": 15, "lines": [ { "reinsurer": "Meridian Vale Re", "signedShareOfWhole": 25 }, { "reinsurer": "Harbour Re", "signedShareOfWhole": 25 }, { "reinsurer": "Alpensable Rück", "signedShareOfWhole": 25 }, { "reinsurer": "Willowglass Re", "signedShareOfWhole": 25 } ] }, { "layerRef": "NSM-CAT-03", "order": 85, "firmTotal": 35.294117647058826, "placedOfWhole": 30, "status": "short", "gap": 64.70588235294117, "oversubscription": 0, "lines": [ { "reinsurer": "Meridian Vale Re", "signedShareOfWhole": 30 } ] } ] } ]}