Import a broker position as a single trade
POST/api/v1/reconciliation/import-position
Creates a single new trade in UTM from a broker position, backed by a synthetic execution that summarises the broker average and quantity. Use this only when there are no pending_review broker executions for the symbol. When orphan executions exist, prefer POST /api/v1/reconciliation/create-trade so the trade is backed by the real fills (issue #650). For splitting a position across multiple trades, use the split-import-position endpoint instead.
Request
Responses
- 200
- 400
- 401
- 409
- 422
- 500
Position imported as a new trade
Validation error
Authentication required
Conflict. code: OPPOSING_POSITION_OPEN - the imported trade would be the opposing side of an existing non-terminal trade for the same (account, symbol) on a netting broker (Alpaca, TradeStation). Response details.conflictingTradeId carries the existing trade id.
Import sanity check failed. code: IMPORT_SANITY_FAILED and details.reason is one of IMPORT_SIDE_MISMATCH or IMPORT_QTY_EXCEEDS_BROKER. The rejected import is recorded on the pending-review queue so an operator can resolve it.
Server error