Link an order and its executions to a trade
POST/api/v1/reconciliation/link-order
Links an entire order (and all its child executions) to an existing trade in one transaction (#1334) - fills follow their order, so an order can never land half-moved. The order's symbol must match the trade's symbol. Optionally deletes synthetic executions on the target trade before linking. This is the only way to link a fill that carries an orderId; POST /link rejects those.
Request
Responses
- 200
- 400
- 401
- 404
- 409
- 500
Order linked to trade
Validation error, symbol mismatch, or order has no executions
Authentication required
Order or trade not found, or access denied
Linking would push the trade's recalculated aggregates above the broker's reported position (#1360). The order/execution move is rolled back atomically with the refusal, so no partial state is written. code: RECONCILIATION_SYNTHETIC_CONFLICT when the target trade still holds a synthetic estimate for the same shares (remove it first); code: RECONCILIATION_OVER_EXPOSURE otherwise. details carries the accountId, symbol, side, brokerQuantity, utmOpenSum, exceedsBy, and conflictingTradeIds.
Server error