Portfolios

Records one purchase or sale as a lot. Pass `optionContract` with the OCC symbol to record an option contract, or omit it for shares. `quantity` is signed — negative for a short sale or a written option — and `costPerUnit` is always a positive price per share, because the direction is carried by the sign of the quantity alone. Repeating an identical request within a few minutes returns the lot already recorded with `deduplicated: true` and HTTP 200 instead of adding a second holding, so a retried timeout is safe.

post/v1/portfolios/{id}/lots

Request

Path parameters

idstring uuid required

The portfolio to add to, from the portfolio list.

Request body

tickerstring required

Stock ticker, or MIC:TICKER for a listing on another exchange (e.g. XPAR:AIR). For an option, the ticker of the UNDERLYING, as MIC:TICKER for a Canadian contract (e.g. XTSE:RY).

optionContractstring nullable

Optional OCC option symbol, e.g. O:AAPL260116C00250000. When present the contract's expiration, strike, type and contract size are read back from the live options data, so an unknown or expired symbol is rejected rather than stored. Omit it to record shares.

quantitynumber double required

Signed size: shares for a stock, contracts for an option. Negative for a short sale or a written (sold-to-open) option.

costPerUnitnumber double required

Price per share, always positive: paid for a long, received for a short. For an option this is the premium per share of the underlying, so a $3.20 contract is 3.20, not 320. In the currency the stock trades in, in major units: London prices in pounds, not pence.

acquiredDatestring date required

The trade date, yyyy-MM-dd. Cannot be in the future.

notestring nullable

Optional note about this lot.

fxRatenumber double nullable

Optional broker exchange rate on the trade: units of the portfolio's currency per 1 unit of the lot's currency (the stock's trading currency; USD for an option). Only for a lot in another currency than the portfolio's. Omitted, the cost converts at the official rate on acquiredDate.

Response

OK

portfolioIdstring uuid
portfolioNamestring nullable
deduplicatedboolean

True when this request repeated an add that had already landed, so nothing was created and the existing lot is returned. A client that retried a timed-out request reads this instead of discovering a second holding. The response is 200 rather than 201.

Changes

No recorded changes to this operation across all 1 revision of this API.