Zum Inhalt
HALOWERK

Finopswerk

post sale replacement loss basis ledger

One uniform-basis original long stock lot sold fully at a loss plus original chronological replacement purchases determines first-bought share matching in days1..30, deferred loss, matched/unmatched replacement sublot bases, adjusted bases and unmatched original loss. Conditional own arithmetic inspired by IRS Publication550, not actual tax eligibility, substantially-identical determination, allowed deduction, filing or legal advice. Assumes taxable same-owner commonstock, no prior/sale-day.

POST https://finops.halowerk.com/v1/post-sale-replacement-loss-basis-ledger

Eingaben

Felder des veröffentlichten Eingabeschemas
FeldTypPflichtBeschreibung
sold_sharesintegerJa
original_basisintegerJa
sale_proceedsintegerJa
replacementsarrayJa
reportobjectJa
Vollständiges Eingabeschema anzeigen
{
  "type": "object",
  "properties": {
    "sold_shares": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000
    },
    "original_basis": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000000
    },
    "sale_proceeds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000000
    },
    "replacements": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "shares_domain": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "minItems": 1,
            "maxItems": 2
          },
          "cost_minor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        },
        "required": [
          "day",
          "shares_domain",
          "cost_minor"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 6
    },
    "report": {
      "type": "object",
      "required": [
        "matched_shares",
        "unmatched_shares",
        "deferred_loss",
        "matched_basis",
        "unmatched_basis",
        "adjusted_basis",
        "remaining_sold_after",
        "sale_loss",
        "deferred_total",
        "unmatched_loss",
        "matched_total",
        "unmatched_sold_total",
        "basis_increase_total",
        "loss_conservation_gap"
      ],
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "n": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]{0,63})$",
              "maxLength": 64
            },
            "d": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[1-9][0-9]{0,63}$",
              "maxLength": 64
            }
          },
          "required": [
            "n",
            "d"
          ],
          "additionalProperties": false
        },
        "minItems": 1,
        "maxItems": 6
      },
      "propertyNames": {
        "enum": [
          "matched_shares",
          "unmatched_shares",
          "deferred_loss",
          "matched_basis",
          "unmatched_basis",
          "adjusted_basis",
          "remaining_sold_after",
          "sale_loss",
          "deferred_total",
          "unmatched_loss",
          "matched_total",
          "unmatched_sold_total",
          "basis_increase_total",
          "loss_conservation_gap"
        ]
      },
      "patternProperties": {
        "^(sale_loss|deferred_total|unmatched_loss|matched_total|unmatched_sold_total|basis_increase_total|loss_conservation_gap)$": {
          "type": "object",
          "properties": {
            "n": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]{0,63})$",
              "maxLength": 64
            },
            "d": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[1-9][0-9]{0,63}$",
              "maxLength": 64
            }
          },
          "required": [
            "n",
            "d"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "required": [
    "sold_shares",
    "original_basis",
    "sale_proceeds",
    "replacements",
    "report"
  ],
  "additionalProperties": false
}

Originalschema öffnen

Veröffentlichtes Eingabebeispiel

{
  "sold_shares": 3,
  "original_basis": 100,
  "sale_proceeds": 0,
  "replacements": [
    {
      "day": 1,
      "shares_domain": [
        1
      ],
      "cost_minor": 1
    }
  ],
  "report": {
    "matched_shares": [
      {
        "n": "1",
        "d": "1"
      }
    ],
    "unmatched_shares": [
      {
        "n": "0",
        "d": "1"
      }
    ],
    "deferred_loss": [
      {
        "n": "100",
        "d": "3"
      }
    ],
    "matched_basis": [
      {
        "n": "103",
        "d": "3"
      }
    ],
    "unmatched_basis": [
      {
        "n": "0",
        "d": "1"
      }
    ],
    "adjusted_basis": [
      {
        "n": "103",
        "d": "3"
      }
    ],
    "remaining_sold_after": [
      {
        "n": "2",
        "d": "1"
      }
    ],
    "sale_loss": {
      "n": "100",
      "d": "1"
    },
    "deferred_total": {
      "n": "100",
      "d": "3"
    },
    "unmatched_loss": {
      "n": "200",
      "d": "3"
    },
    "matched_total": {
      "n": "1",
      "d": "1"
    },
    "unmatched_sold_total": {
      "n": "2",
      "d": "1"
    },
    "basis_increase_total": {
      "n": "100",
      "d": "3"
    },
    "loss_conservation_gap": {
      "n": "0",
      "d": "1"
    }
  }
}

Ergebnis & Dokumentation

Maschinenlesbare Dokumentation dieses Hubs

Quelle dieser Seite: der veröffentlichte HALOWERK-Katalog. Stand: 2026-11-07, 02:42 UTC.

Weitere Endpunkte dieses Hubs

Alle Endpunkte dieses Hubs →