REST APITradeMargin

GET

Returns the net open positions snapshot as of a given time for the specified account.

Path Params

  • accountId string required
    The ID of the account

Query Params

  • transactionDateLt string date-time required
    Returns unsettled positions based on transactions that occurred before this timestamp.
  • currency array of strings
    Filter results to specific currencies. If omitted, returns unsettled positions for all currencies with non-zero balances.
  • useFutureTransfers boolean
    If true, applies position transfers sent after transactionDateLt to cover short positions as of transactionDateLt.

    Defaults to false

Responses

200
Net open positions snapshot

Response Body

object

  • netOpenPositions array of objects required
    netOpenPositions object
    • currency string required
      The currency symbol for this position
    • enterpriseId string required
      The enterprise ID associated with this position
    • accountId string required
      The trading account ID
    • netOpenPosition string required
      The net position quantity at the snapshot time. Negative values indicate short positions (borrowed/owed), positive values indicate long positions (owned).

      matches ^-?[0-9]+(\.[0-9]+)?$

    • appliedFutureTransfers string required
      The total amount of pending transfers (after cutoff) applied to cover this position (only when useFutureTransfers=true). Always zero for long positions. For short positions, shows how much of the position will be covered by pending incoming transfers.

      matches ^[0-9]+(\.[0-9]+)?$

    • earliestTransactionDate string date-time required
      Timestamp of the earliest transaction that contributed to this position
    • latestTransactionDate string date-time required
      Timestamp of the most recent transaction that contributed to this position (before the cutoff)
    • latestFutureTransferDate string date-time nullable
      Timestamp of the most recent pending transfer applied to this position. Only present when useFutureTransfers=true and pending transfers were applied. Null otherwise.
400
Bad request - Invalid or missing query parameters

Response Body

object

  • error string required
  • errorName string required
  • reqId string required
  • context object
    Optional structured metadata for REST validation failures. The schema is fixed for client contract stability.
    context object
    • errorName string required
      Same value as the top-level errorName.
    • field string
      Request field associated with the validation failure.
    • message string
      Human-readable field-level validation message.
401
Unauthorized - Invalid or missing authentication

Response Body

object

  • error string required
  • errorName string required
  • reqId string required
  • context object
    Optional structured metadata for REST validation failures. The schema is fixed for client contract stability.
    context object
    • errorName string required
      Same value as the top-level errorName.
    • field string
      Request field associated with the validation failure.
    • message string
      Human-readable field-level validation message.
403
Forbidden - Insufficient permissions

Response Body

object

  • error string required
  • errorName string required
  • reqId string required
  • context object
    Optional structured metadata for REST validation failures. The schema is fixed for client contract stability.
    context object
    • errorName string required
      Same value as the top-level errorName.
    • field string
      Request field associated with the validation failure.
    • message string
      Human-readable field-level validation message.
500
Internal Server Error

Response Body

object

  • error string required
  • errorName string required
  • reqId string required
  • context object
    Optional structured metadata for REST validation failures. The schema is fixed for client contract stability.
    context object
    • errorName string required
      Same value as the top-level errorName.
    • field string
      Request field associated with the validation failure.
    • message string
      Human-readable field-level validation message.