---
title: "Corrects a lot that was entered wrong. Only the fields you send change. The instrument itself cannot be edited — a lot on the wrong stock or contract is a different holding, so delete it and add the right one. To record a sale, close the lot instead of editing its quantity down; editing it away loses the realized profit."
method: PATCH
path: "/v1/portfolios/{id}/lots/{lotId}"
tags: ["Portfolios"]
---

# Corrects a lot that was entered wrong. Only the fields you send change. The instrument itself cannot be edited — a lot on the wrong stock or contract is a different holding, so delete it and add the right one. To record a sale, close the lot instead of editing its quantity down; editing it away loses the realized profit.

`PATCH /v1/portfolios/{id}/lots/{lotId}`

## Request

- Base URL: `https://api.equibles.com`
- URL: `https://api.equibles.com/v1/portfolios/{id}/lots/{lotId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/equibles/apis/equibles-api/docs/v1/portfolios/:id/lots/:lotId/patch.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `id` string, uuid, required
- `lotId` string, uuid, required

## Request body

- UpdatePortfolioLotRequest
  - `quantity` number, double, nullable: The corrected signed size. Negative is a short position or a written option.
  - `costPerUnit` number, double, nullable: The corrected price per share, always positive.
  - `acquiredDate` string, date, nullable: The corrected trade date, yyyy-MM-dd.
  - `note` string, nullable: The corrected note. Send an empty string to clear it.
  - `fxRate` number, double, nullable: The corrected broker exchange rate: units of the portfolio's currency per 1 unit of the lot's currency.
  - `clearFxRate` boolean, nullable: Send true to remove the broker exchange rate, so the lot converts at the official rate on its trade date. Cannot be combined with fxRate.

## Response `200`

OK

- PortfolioLotResponse
  - `portfolioId` string, uuid
  - `portfolioName` string, nullable
  - `deduplicated` boolean: 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.
  - `lot` PortfolioLotDto
    - `id` string, uuid
    - `instrumentKind` string, nullable: Stock or Option.
    - `ticker` string, nullable: The listed symbol: the stock itself, or an option's underlying.
    - `exchange` string, nullable: The exchange's market identifier code (MIC, e.g. XPAR) for a listing outside the U.S.; null for a U.S. listing. Together with ticker it names the listing, e.g. XPAR:AIR.
    - `name` string, nullable
    - `occTicker` string, nullable: OCC option symbol, e.g. O:AAPL260116C00250000. Null on a stock lot.
    - `expirationDate` string, date, nullable
    - `strikePrice` number, double, nullable
    - `contractType` string, nullable: Call or Put. Null on a stock lot.
    - `sharesPerContract` integer, nullable: Shares of the underlying one contract controls — the P&L multiplier. Null on a stock lot.
    - `quantity` number, double: Signed: shares for a stock, contracts for an option; negative is short or written.
    - `costPerUnit` number, double: Price per share the lot was opened at, always positive. For an option, the premium per share of the underlying rather than per contract.
    - `costBasis` number, double, nullable
    - `currency` string, nullable: ISO 4217 code the lot's prices and own figures are in: its listing's currency.
    - `purchaseFxRate` number, double, nullable: The broker exchange rate recorded with the lot: units of purchaseFxCurrency per 1 unit of currency. Null when none was recorded.
    - `purchaseFxCurrency` string, nullable
    - `acquiredDate` string, date
    - `note` string, nullable
    - `closedDate` string, date, nullable: Set on a closed lot; null while the lot is open.
    - `closePricePerUnit` number, double, nullable
    - `marketValue` number, double, nullable: Null when this pass could not price the instrument — never a zero, which would read as a total loss.
    - `unrealizedGain` number, double, nullable
    - `realizedGain` number, double, nullable: Realized profit or loss on a closed lot; null while the lot is open.
    - `convertedCostBasis` number, double, nullable: The lot's figures in the portfolio's currency: cost at the purchase rate, value at the current rate, and a closed lot's proceeds at the official rate on its closing date. Null on a lot returned by a write, which carries no valuation.
    - `convertedMarketValue` number, double, nullable
    - `convertedUnrealizedGain` number, double, nullable
    - `convertedRealizedGain` number, double, nullable
    - `purchaseRate` PortfolioFxRateDto
      - `from` string, nullable
      - `to` string, nullable
      - `rate` number, double
      - `asOf` string, date, nullable: The official observation date. Weekly releases make a rate a few days old normal.
    - `closeRate` PortfolioFxRateDto
      - `from` string, nullable
      - `to` string, nullable
      - `rate` number, double
      - `asOf` string, date, nullable: The official observation date. Weekly releases make a rate a few days old normal.
    - `isOpen` boolean

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found

---

[API](https://skmtc.dev/equibles/apis/equibles-api.md) - [All operations](https://skmtc.dev/equibles/apis/equibles-api/llms.txt) - [OpenAPI document](https://skmtc.dev/equibles/apis/equibles-api/revisions/666e06778588?raw)
