Skip to main content
POST
Calculate a target share count for a position

Authorizations

x-api-key
string
header
required

Raw API key shown once when created in the Allocait app (Settings > API keys). Send it verbatim in this header; the server stores and compares only its SHA-256 hash. Allocait generates every key: alc_ followed by 64 lowercase hex characters. Keys issued before 2026-10-10 are 64 hex characters with no prefix and keep working. A key may carry an expiry (90 days or 1 year, or never). A malformed, unknown, revoked or expired key gets 401 with no further detail, and a malformed one is refused before any lookup. Keys cannot be created through this API.

Body

application/json
current_shares
number
required

Shares held now. Negative for a short you hold.

portfolio_value
number
required

The portfolio's total value, above 0.

price
number

Per-share price, above 0. Required, as price or current_price.

current_price
number
deprecated

Older name for price. Read only when price is absent.

size_min_pct
number | null

Lower bound of the position size range for this one holding, as % of portfolio value. Omit both size bounds for MANUAL sizing; the response is then UNEVALUATED.

Required range: 0 <= x <= 100
size_max_pct
number | null

Upper bound of the position size range for this one holding, as % of portfolio value.

Required range: 0 <= x <= 100
min_position_pct
number | null
deprecated

Deprecated alias for size_min_pct. Read only when size_min_pct is absent or null.

Required range: 0 <= x <= 100
max_position_pct
number | null
deprecated

Deprecated alias for size_max_pct. Read only when size_max_pct is absent or null.

Required range: 0 <= x <= 100
sizing_mode
enum<string>
default:MANUAL

MANUAL (the default) sizes to manual_shares, or starts from the current size when there is none. MINIMUM, BALANCED and MAXIMUM size to the bottom, midpoint or top of the size range, and each needs its bound: MINIMUM needs size_min_pct, MAXIMUM needs size_max_pct, BALANCED needs both (a mode without its bound is refused with 400).

Available options:
MANUAL,
MINIMUM,
BALANCED,
MAXIMUM
basis_points
number
default:0

Basis points added to the target percent, either sign (100 = 1%). With MANUAL and no manual_shares the target is the current size, so this moves the holding. A positive adjustment makes a short larger. Ignored when manual_shares is given (a typed count is the size, so nothing is added to it).

manual_shares
number | null

Target shares for MANUAL. Always a positive count, a short's too; direction sets the side.

direction
enum<string> | null
default:long

long (the default) or short. null counts as not sent. For a short, send the class's short size range as size_min_pct and size_max_pct; the count comes back negative.

Available options:
long,
short,
null
cash
number
default:0

Cash available. Without it (or current_cash), the response leaves out can_afford and cash_after_trade.

current_cash
number
deprecated

Older name for cash. Read only when cash is absent.

Response

Sizing result

For direction short, target_shares, target_value, target_pct, current_value, current_pct, shares_delta and value_delta are negative, and compliance_status judges the size without its sign. A portfolio worth zero or less is sized to 0 shares and 0%, read against the range, as it always was.

target_shares
number
target_value
number
target_pct
number
current_value
number
current_pct
number
shares_delta
number

target_shares minus the shares you supplied

value_delta
number
cash_impact
number

Cash debited (negative) or credited (positive) if this size were applied

cash_after_trade
number

Present only when the request sent cash (or current_cash).

can_afford
boolean

Present only when the request sent cash (or current_cash).

compliance_status
enum<string>

Verdict of target_pct, without its sign, against the range you supplied (size_min_pct / size_max_pct). UNEVALUATED when either bound was omitted; it is not a pass. The target is never moved into the range to make it pass: a basis_points adjustment that lands outside it reads BELOW_MIN or ABOVE_MAX. This is not the asset class verdict from /compliance/check.

Available options:
COMPLIANT,
BELOW_MIN,
ABOVE_MAX,
UNEVALUATED