Improved

Per-position errors documented on close all positions

Broker API

Documents the per-position result returned when closing all positions for an account. The wire contract is unchanged.

  • The 207 response returns one result per position: body is the closing Order when status is 200, and the error object describing the rejection for any other status.
  • Adds a documented 422 response for a request-level failure, such as an invalid cancel_orders value (code 40010001); no per-position results are returned in that case.
  • The Error schema now documents code (usually the HTTP status followed by a five-digit suffix; validation failures keep a 400 prefix) and message, plus the optional symbol, existing_qty, held_for_orders, and available fields the server can include.
  • Adds a 207 partial-close example.

Affected Endpoints

  • DELETE /v1/trading/accounts/{account_id}/positions