Portfolios

Records a sale. Closing part of a lot splits it: the closed quantity becomes its own closed row and the remainder stays open on its original cost basis, so a later close of the rest is still priced against what was actually paid for it. The response carries the CLOSED lot, whose id differs from the original one after a partial close.

post/v1/portfolios/{id}/lots/{lotId}/close

Request

Path parameters

idstring uuid required

The portfolio holding the lot.

lotIdstring uuid required

The open lot to close.

Request body

closePricePerUnitnumber double required

Price per share the position was closed at, always positive — received for a long, paid to cover a short. For an option, the premium per share of the underlying.

closeDatestring date required

The date it was closed, yyyy-MM-dd. Cannot be before the lot was acquired.

quantitynumber double nullable

How much to close, unsigned. Omit to close the whole lot; pass less to close part of it.

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.