Import a remnant as a historical trade
POST/api/v1/reconciliation/import-history
Imports a remnant (#1197) as a historical (usually closed) trade. Two
body shapes are accepted. When executionIds is present the round-trip
is reconstructed from its own pending-review fills and the aggregates -
including the CLOSED status, realised P&L, average entry, and average
exit - are rebuilt from them. When the original fills are no longer
returnable from the broker (older fills outside Alpaca's window, and
the only path TradeStation can use), supply the summary fallback
(side, quantity, avgEntryPrice, avgExitPrice, realisedPnl,
openedAt, closedAt) and a synthetic closed trade is created from it,
clearly flagged as an estimate in metadata. Either way the trade is
marked reconciled (reversible from the Reconciled tab), stamped with
metadata.importedAsHistory: true and
metadata.affectsCurrentPosition: false, audit-logged against the
trade, and any stale PendingImport rejection rows for the symbol are
cleared. JWT-only.
Request
Responses
- 200
- 400
- 401
- 404
- 500
Historical trade created
Validation error
Authentication required
Account, strategy, or executions not found
Server error