Depending on applicable regulations or business limitations, specific API requests may not be available for your use.

Get a Closed Tax Lot

This request returns the information for a closed tax lot for an account. A closed tax lot represents a position of shares that have been sold from within a taxable account. The closed lot contains initial and adjusted purchase information, the holding period of the shares, and the realized gain or loss from the sale of the shares.

Request URL

Syntax GET /restapi/accounts/{accountnumber}/closedtaxlots/{originatingtransactionid}/{closingtransactionid}
Example URL https://api.uat.foliofn.com/restapi/accounts/RA1234ABCD/closedtaxlots/105235910/110191035

Error Codes

HTTP Code Status Field Code Message Description
404 - - - Tax data is currently not available.

Response Data Fields

Field Description
accountNumber The account number whose closed tax lot was requested.
shareQuantity The number of the shares in the tax lot.
salePrice The unit cost of a share at which the tax lot was relieved. For example, if a client sells 50 shares of security A at $10.00 per share, salePrice is $10.00.
netSaleAmount The proceeds from selling the tax lot. It is shareQuantity × salePrice.
gainLossTerm An indicator of whether the gain/loss for the tax lot is long-term or short-term. The available options are “SHORT_TERM”, “LONG_TERM”, and “UNKNOWN”.
unadjustedShareQuantity The quantity of shares without regarding wash sales.
reportableGainLoss The gain/loss after taking into account wash sales.
saleDate The trade date of the relieving transaction.
federalTaxWithholding The amount of federal tax already withheld from this lot’s closing transaction.
stateTaxWithholding The amount of state tax already withheld from this lot’s closing transaction.
foreignTaxWithholding The amount of foreign tax already withheld from this lot’s closing transaction.
withholdingCountry The country to which foreignTaxWithholding applies.
withholdingState The state to which stateTaxWithholding applies.
covered A Boolean indicator of whether the security is covered. “true” or “false”. Each security has a covered start data associated with it. Purchases prior to that security’s covered date or ones where we do not know the acquisition date will be uncovered. See What are covered and noncovered securities? for more information.
costBasisKnown A Boolean indicator of whether cost basis is known. A cost basis may not be known if this is an uncovered lot that is transferred in from other financial institution. The value is either “true” or “false”.
security.ticker The ticker of the security transacted in this tax lot.
security.cusip The CUSIP of the security.
security.id The unique identifier of the security.
originatingTransactionId The transaction ID of the transaction that created the open lot.
closingTransactionId The transaction ID of the transaction that sells the shares bought by the originating transaction (originatingTransactionId).
adjustedCostBasis The adjusted cost basis of the closed lot, adjusted to account for various events such as stock splits, exchanges, return of capital transactions, and wash sales.
origionalSharePrice The original unit price of the closed lot.
adjustedAcquisitionDate The adjusted cost basis of the closed lot, adjusted for wash sales.
disallowedLoss The amount of loss disallowed due to wash sales.
originalAcquisitionDate The original acquisition date. If there were wash sales, the adjusted acquisition date will be in adjustedAcquisitionDate. This field can be null.
originalCostBasis The cost of the lot at the time of purchase. If there were wash sales, the adjusted cost basis will be in adjustedCostBasis.

Response Example


    Status Code: 200 OK
    Content-Type: application/json
    Date: Wed, 18 Dec 2013 18:51:40 GMT
    Server: Sun GlassFish Enterprise Server v2.1.1
    Transfer-Encoding: chunked
    X-Powered-By: Servlet/2.5

{
  "accountNumber": "RA1234ABCD",
  "shareQuantity": "327.86902",
  "salePrice": "9.640001",
  "netSaleAmount": "3160.61",
  "gainLossTerm": "SHORT_TERM",
  "unadjustedShareQuantity": "327.86902",
  "reportableGainLoss": "-839.39",
  "saleDate": "2013-06-29T00:00:00.000-05:00",
  "federalTaxWithholding": null,
  "stateTaxWithholding": null,
  "foreignTaxWithholding": null,
  "withholdingCountry": null,
  "withholdingState": null,
  "covered": true,
  "costBasisKnown": true,
  "security": {
    "ticker": "AAUKY",
    "cusip": "03485P201",
    "id": null
  },
  "originatingTransactionId": "105235910",
  "closingTransactionId": "110191035",
  "adjustedCostBasis": "4000.00",
  "origionalSharePrice": "12.19999",
  "adjustedAcquisitionDate": "2013-05-10 T00:00:00.000-05:00",
  "disallowedLoss": "0.00",
  "originalAcquisitionDate": "2013-05-10 T00:00:00.000-05:00",
  "originalCostBasis": "4000.00"
}


Change Log

07/22/2016

  1. Updated text.

02/22/2016

  1. Add error codes information.

Getting Started

REST APIs

Resources