Catalog/tax-wash-sale

Calculators

Wash-sale rule detector API

Detect whether a realized loss is disallowed under the IRS wash-sale rule — a repurchase of substantially identical shares within 30 days before through 30 days after the sale (61-day window) — returning days apart, whether the window is hit, the disallowed loss, and an interpretation. Answers 'is this a wash sale','will my loss be disallowed','did I rebuy within 30 days','wash-sale 61-day window check'.

Price$0.01per request
MethodPOST
Route/v1/calc/tax-wash-sale
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
taxwash-salelossirs61-dayinvestingstockscalc
API URLhttps://x402.hexl.dev/v1/calc/tax-wash-sale
Integration docs
Example request
{
  "sellDate": "2024-01-10",
  "sellGainLoss": -1000,
  "repurchaseDate": "2024-01-25"
}
Example response
{
  "sellDate": "2024-01-10",
  "repurchaseDate": "2024-01-25",
  "daysApart": 15,
  "isLoss": true,
  "withinWashSaleWindow": true,
  "washSaleTriggered": true,
  "disallowedLoss": 1000,
  "interpretation": "Wash sale: the loss is disallowed and added to the basis of the replacement shares.",
  "note": "Estimate. IRS wash-sale rule: 30 days before through 30 days after the sale (61-day window)."
}
Input schema
{
  "type": "object",
  "required": [
    "sellDate",
    "sellGainLoss"
  ],
  "properties": {
    "sellDate": {
      "type": "string",
      "description": "ISO sale date",
      "examples": [
        "2024-01-10"
      ]
    },
    "sellGainLoss": {
      "type": "number",
      "description": "Realized amount; negative = loss",
      "examples": [
        -1000
      ]
    },
    "repurchaseDate": {
      "type": "string",
      "description": "ISO repurchase date",
      "examples": [
        "2024-01-25"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}