---
title: "One account's booked lines folded into its own size shares (BE-ADJ-19)"
method: GET
path: "/api/v1/order-book/account-size-curve"
tags: ["order_book"]
---

# One account's booked lines folded into its own size shares (BE-ADJ-19)

`GET /api/v1/order-book/account-size-curve`

## Request

- Base URL: `https://api.app.tightly.io`
- URL: `https://api.app.tightly.io/api/v1/order-book/account-size-curve`
- Auth: HTTP bearer

One account's booked lines, folded into its own size shares in basis points summing to 10000. This is the run this retailer actually takes, beside the buy's own curve.

`trading_partner_id` is required. The scope is `season_code` or `commitment_id`, one of which is required: served scopeless, a size run would read as "this account runs no sizes", which is a finding rather than an unstated question. Given only a Commitment, the season resolves from its declared season label.

A size is read off `product_variants.selected_options` under a recognised size key. A line at style grain (a hold, "sizes to follow") or whose variant names no size option contributes no share; its units are counted in `unsized_units`/`unsized_lines` rather than dropped or folded in as if it had spoken.

`shares_bp` is null with a `reason` where the account has no booked line in scope at all, or where every one of its lines is unsized. An absence is a sentence, never a zero.

Sold with Essentials+: without Tightly Connect the answer is 403 `plan_excludes`.

Scope: `order_book:read`.

## Query parameters

- `trading_partner_id` string, required
- `season_code` string
- `commitment_id` string
- `as_of` string, date-time

## Headers

- `Tightly-Version` string

## Response `200`

The account's size shares in basis points, the units and line count they stand on, the unsized share, and when the size run itself could not be composed.

- object
  - `data` object
    - `as_of` string, date-time
    - `commitment_id` string, nullable
    - `computed_at` string, date-time: When this fold was computed. The size run is measured fresh on every read.
    - `lines` integer, nullable: The sized live line count the shares stand on.
    - `reason` string, nullable
    - `scope_reason` string, nullable
    - `season_code` string, nullable
    - `season_source` string, nullable: Whether the season was stated or resolved from the Commitment.
    - `shares_bp` object, nullable: Size -> basis points, summing to exactly 10000. Null with `reason` where the account has no sized line in scope.
    - `trading_partner_id` string
    - `units` integer, nullable: The sized units the shares stand on.
    - `unsized_lines` integer
    - `unsized_units` integer: Units on live lines that named no resolvable size (holds and unsized variants).
  - `message` object: severity, service and desc.

## Other responses

- `400`: A required parameter is missing, or the request could not be read
- `401`: No usable key: malformed, unknown, revoked, expired or stopped. One refusal covers all five, telling a caller which is which maps the surface for them. A request with no Authorization header at all is refused 400 before any key is looked for.
- `403`: The key may not reach this operation. `plan_excludes` when Order book is sold with Essentials+ and this organisation's plan does not include it; `scope_missing` when the key does not hold Order book; `organization_mismatch` when the path names an organisation that is not the key's; `ip_not_allowed` when the caller's address is outside the key's allowlist; `account_mismatch` when a key issued to one account names another in `trading_partner_id`, and the sentence names both accounts.
- `429`: The key has spent its allowance for this minute. 600 reads and 120 writes a minute, counted per key, refused calls included. `Retry-After` says how long to wait.
- `503`: The database is briefly out of reach, which is what a failover or a full connection pool looks like from outside. Wait the seconds `Retry-After` names and send the request again. A read is safe to repeat. A write is not, because the connection was lost in the middle of it, so read the object back before sending it a second time. Branch on the status rather than on `code`, which is `POSTGRES_UNAVAILABLE` from one of the two seams that raise this and `SERVICE_UNAVAILABLE` from the other.

---

[API](https://skmtc.dev/tightly/apis/tightly-api.md) · [All operations](https://skmtc.dev/tightly/apis/tightly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tightly/apis/tightly-api/revisions/199f7eb35afb?raw)
