swagger: '2.0' info: title: OANDA v20 REST Accounts API description: The full OANDA v20 REST API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more. contact: name: OANDA API Support url: http://developer.oanda.com/rest-live-v20/introduction/ email: api@oanda.com license: name: MIT url: https://github.com/oanda/v20-openapi/blob/master/LICENSE.txt version: 3.0.25 basePath: /v3 schemes: - https consumes: - application/json produces: - application/json tags: - name: Accounts paths: /accounts/{accountID}/positions: get: summary: List Positions description: List all Positions for an Account. The Positions returned are for every instrument that has had a position during the lifetime of an the Account. operationId: listPositions parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/accountIDPathParam' responses: '200': description: The Account's Positions are provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: positions: type: array description: The list of Account Positions. items: $ref: '#/definitions/Position' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/openPositions: get: summary: Open Positions description: List all open Positions for an Account. An open Position is a Position in an Account that currently has a Trade opened for it. operationId: listOpenPositions parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/accountIDPathParam' responses: '200': description: The Account's open Positions are provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: positions: type: array description: The list of open Positions in the Account. items: $ref: '#/definitions/Position' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/positions/{instrument}: get: summary: Instrument Position description: Get the details of a single Instrument's Position in an Account. The Position may by open or not. operationId: getPosition parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/instrumentNamePathParam' responses: '200': description: The Position is provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: position: $ref: '#/definitions/Position' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/positions/{instrument}/close: put: summary: Close Position description: Closeout the open Position for a specific instrument in an Account. operationId: closePosition parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/instrumentNamePathParam' - name: closePositionBody description: Representation of how to close the position in: body schema: type: object properties: longUnits: type: string description: Indication of how much of the long Position to closeout. Either the string "ALL", the string "NONE", or a DecimalNumber representing how many units of the long position to close using a PositionCloseout MarketOrder. The units specified must always be positive. longClientExtensions: $ref: '#/definitions/ClientExtensions' shortUnits: type: string description: Indication of how much of the short Position to closeout. Either the string "ALL", the string "NONE", or a DecimalNumber representing how many units of the short position to close using a PositionCloseout MarketOrder. The units specified must always be positive. shortClientExtensions: $ref: '#/definitions/ClientExtensions' required: true responses: '200': description: The Position closeout request has been successfully processed. headers: Location: description: A link to the Position that was just closed out type: string RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: longOrderCreateTransaction: $ref: '#/definitions/MarketOrderTransaction' longOrderFillTransaction: $ref: '#/definitions/OrderFillTransaction' longOrderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' shortOrderCreateTransaction: $ref: '#/definitions/MarketOrderTransaction' shortOrderFillTransaction: $ref: '#/definitions/OrderFillTransaction' shortOrderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': description: The Parameters provided that describe the Position closeout are invalid. schema: type: object properties: longOrderRejectTransaction: $ref: '#/definitions/MarketOrderRejectTransaction' shortOrderRejectTransaction: $ref: '#/definitions/MarketOrderRejectTransaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '401': $ref: '#/responses/401' '404': description: The Account or one or more of the Positions specified does not exist. schema: type: object properties: longOrderRejectTransaction: $ref: '#/definitions/MarketOrderRejectTransaction' shortOrderRejectTransaction: $ref: '#/definitions/MarketOrderRejectTransaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. Only present if the Account exists. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. Only present if the Account exists. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/trades: get: summary: List Trades description: Get a list of Trades for an Account operationId: listTrades parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: ids description: List of Trade IDs to retrieve. in: query type: array items: type: string format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. collectionFormat: csv - name: state description: The state to filter the requested Trades by. in: query type: string - name: instrument description: The instrument to filter the requested Trades by. in: query type: string format: A string containing the base currency and quote currency delimited by a "_". - name: count description: The maximum number of Trades to return. in: query type: integer - name: beforeID description: The maximum Trade ID to return. If not provided the most recent Trades in the Account are returned. in: query type: string format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. responses: '200': description: The list of Trades requested headers: Link: description: A link to the next page of Trades if the results were paginated type: string RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: trades: type: array description: The list of Trade detail objects items: $ref: '#/definitions/Trade' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/openTrades: get: summary: List Open Trades description: Get the list of open Trades for an Account operationId: listOpenTrades parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' responses: '200': description: The Account's list of open Trades is provided headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: trades: type: array description: The Account's list of open Trades items: $ref: '#/definitions/Trade' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/trades/{tradeSpecifier}: get: summary: Trade Details description: Get the details of a specific Trade in an Account operationId: getTrade parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/tradeSpecifierPathParam' responses: '200': description: The details for the requested Trade is provided headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: trade: $ref: '#/definitions/Trade' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/trades/{tradeSpecifier}/close: put: summary: Close Trade description: Close (partially or fully) a specific open Trade in an Account operationId: closeTrade parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/tradeSpecifierPathParam' - name: closeTradeBody description: Details of how much of the open Trade to close. in: body schema: type: object properties: units: type: string description: Indication of how much of the Trade to close. Either the string "ALL" (indicating that all of the Trade should be closed), or a DecimalNumber representing the number of units of the open Trade to Close using a TradeClose MarketOrder. The units specified must always be positive, and the magnitude of the value cannot exceed the magnitude of the Trade's open units. required: true responses: '200': description: The Trade has been closed as requested headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: orderCreateTransaction: $ref: '#/definitions/MarketOrderTransaction' orderFillTransaction: $ref: '#/definitions/OrderFillTransaction' orderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': description: The Trade cannot be closed as requested. schema: type: object properties: orderRejectTransaction: $ref: '#/definitions/MarketOrderRejectTransaction' errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '401': $ref: '#/responses/401' '404': description: The Account or Trade specified does not exist. schema: type: object properties: orderRejectTransaction: $ref: '#/definitions/MarketOrderRejectTransaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. Only present if the Account exists. format: String representation of the numerical OANDA-assigned TransactionID relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. Only present if the Account exists. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/trades/{tradeSpecifier}/clientExtensions: put: summary: Set Trade Client Extensions description: Update the Client Extensions for a Trade. Do not add, update, or delete the Client Extensions if your account is associated with MT4. operationId: setTradeClientExtensions parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/tradeSpecifierPathParam' - name: setTradeClientExtensionsBody description: Details of how to modify the Trade's Client Extensions. in: body schema: type: object properties: clientExtensions: $ref: '#/definitions/ClientExtensions' required: true responses: '200': description: The Trade's Client Extensions have been updated as requested. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: tradeClientExtensionsModifyTransaction: $ref: '#/definitions/TradeClientExtensionsModifyTransaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': description: The Trade's Client Extensions cannot be modified as requested. schema: type: object properties: tradeClientExtensionsModifyRejectTransaction: $ref: '#/definitions/TradeClientExtensionsModifyRejectTransaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '401': $ref: '#/responses/401' '404': description: The Account or Trade specified does not exist. schema: type: object properties: tradeClientExtensionsModifyRejectTransaction: $ref: '#/definitions/TradeClientExtensionsModifyRejectTransaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. Only present if the Account exists. format: String representation of the numerical OANDA-assigned TransactionID relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. Only present if the Account exists. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/trades/{tradeSpecifier}/orders: put: summary: Set Dependent Orders description: Create, replace and cancel a Trade's dependent Orders (Take Profit, Stop Loss and Trailing Stop Loss) through the Trade itself operationId: setTradeDependentOrders parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/tradeSpecifierPathParam' - name: setTradeDependentOrdersBody description: Details of how to modify the Trade's dependent Orders. in: body schema: type: object properties: takeProfit: $ref: '#/definitions/TakeProfitDetails' stopLoss: $ref: '#/definitions/StopLossDetails' trailingStopLoss: $ref: '#/definitions/TrailingStopLossDetails' required: true responses: '200': description: The Trade's dependent Orders have been modified as requested. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: takeProfitOrderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' takeProfitOrderTransaction: $ref: '#/definitions/TakeProfitOrderTransaction' takeProfitOrderFillTransaction: $ref: '#/definitions/OrderFillTransaction' takeProfitOrderCreatedCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' stopLossOrderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' stopLossOrderTransaction: $ref: '#/definitions/StopLossOrderTransaction' stopLossOrderFillTransaction: $ref: '#/definitions/OrderFillTransaction' stopLossOrderCreatedCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' trailingStopLossOrderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' trailingStopLossOrderTransaction: $ref: '#/definitions/TrailingStopLossOrderTransaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': description: The Trade's dependent Orders cannot be modified as requested. schema: type: object properties: takeProfitOrderCancelRejectTransaction: $ref: '#/definitions/OrderCancelRejectTransaction' takeProfitOrderRejectTransaction: $ref: '#/definitions/TakeProfitOrderRejectTransaction' stopLossOrderCancelRejectTransaction: $ref: '#/definitions/OrderCancelRejectTransaction' stopLossOrderRejectTransaction: $ref: '#/definitions/StopLossOrderRejectTransaction' trailingStopLossOrderCancelRejectTransaction: $ref: '#/definitions/OrderCancelRejectTransaction' trailingStopLossOrderRejectTransaction: $ref: '#/definitions/TrailingStopLossOrderRejectTransaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts: get: summary: List Accounts description: Get a list of all Accounts authorized for the provided token. operationId: listAccounts parameters: - $ref: '#/parameters/authorizationHeaderParam' responses: '200': description: The list of authorized Accounts has been provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: accounts: type: array description: The list of Accounts the client is authorized to access and their associated properties. items: $ref: '#/definitions/AccountProperties' '401': $ref: '#/responses/401' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}: get: summary: Account Details description: Get the full details for a single Account that a client has access to. Full pending Order, open Trade and open Position representations are provided. operationId: getAccount parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' responses: '200': description: The full Account details are provided headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: account: $ref: '#/definitions/Account' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/summary: get: summary: Account Summary description: Get a summary for a single Account that a client has access to. operationId: getAccountSummary parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' responses: '200': description: The Account summary are provided headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: account: $ref: '#/definitions/AccountSummary' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/instruments: get: summary: Account Instruments description: Get the list of tradeable instruments for the given Account. The list of tradeable instruments is dependent on the regulatory division that the Account is located in, thus should be the same for all Accounts owned by a single user. operationId: getAccountInstruments parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: instruments description: List of instruments to query specifically. in: query type: array items: type: string format: A string containing the base currency and quote currency delimited by a "_". collectionFormat: csv responses: '200': description: The list of tradeable instruments for the Account has been provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: instruments: type: array description: The requested list of instruments. items: $ref: '#/definitions/Instrument' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/configuration: patch: summary: Configure Account description: Set the client-configurable portions of an Account. operationId: configureAccount parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: configureAccountBody description: Representation of the Account configuration to set in: body schema: type: object properties: alias: type: string description: Client-defined alias (name) for the Account marginRate: type: string description: The string representation of a decimal number. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. responses: '200': description: The Account was configured successfully. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: clientConfigureTransaction: $ref: '#/definitions/ClientConfigureTransaction' lastTransactionID: type: string description: The ID of the last Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID '400': description: The configuration specification was invalid. schema: type: object properties: clientConfigureRejectTransaction: $ref: '#/definitions/ClientConfigureRejectTransaction' lastTransactionID: type: string description: The ID of the last Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '403': description: The configuration operation was forbidden on the Account. schema: type: object properties: clientConfigureRejectTransaction: $ref: '#/definitions/ClientConfigureRejectTransaction' lastTransactionID: type: string description: The ID of the last Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/changes: get: summary: Poll Account Updates description: Endpoint used to poll an Account for its current state and changes since a specified TransactionID. operationId: getAccountChanges parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: sinceTransactionID description: ID of the Transaction to get Account changes since. in: query type: string format: String representation of the numerical OANDA-assigned TransactionID responses: '200': description: The Account state and changes are provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: changes: $ref: '#/definitions/AccountChanges' state: $ref: '#/definitions/AccountChangesState' lastTransactionID: type: string description: The ID of the last Transaction created for the Account. This Transaction ID should be used for future poll requests, as the client has already observed all changes up to and including it. format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' '416': $ref: '#/responses/416' tags: - Accounts /accounts/{accountID}/transactions: get: summary: List Transactions description: Get a list of Transactions pages that satisfy a time-based Transaction query. operationId: listTransactions parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: from description: The starting time (inclusive) of the time range for the Transactions being queried. in: query type: string format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). - name: to description: The ending time (inclusive) of the time range for the Transactions being queried. in: query type: string format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). - name: pageSize description: The number of Transactions to include in each page of the results. in: query type: integer - name: type description: A filter for restricting the types of Transactions to retreive. in: query type: array items: type: string collectionFormat: csv responses: '200': description: The requested time range of Transaction pages are provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: from: type: string description: The starting time provided in the request. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). to: type: string description: The ending time provided in the request. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). pageSize: type: integer description: The pageSize provided in the request type: type: array description: The Transaction-type filter provided in the request items: type: string description: A filter that can be used when fetching Transactions enum: - ORDER - FUNDING - ADMIN - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ONE_CANCELS_ALL_ORDER - ONE_CANCELS_ALL_ORDER_REJECT - ONE_CANCELS_ALL_ORDER_TRIGGERED - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL count: type: integer description: The number of Transactions that are contained in the pages returned pages: type: array description: The list of URLs that represent idrange queries providing the data for each page in the query results items: type: string lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '403': $ref: '#/responses/403' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' '416': $ref: '#/responses/416' tags: - Accounts /accounts/{accountID}/transactions/{transactionID}: get: summary: Transaction Details description: Get the details of a single Account Transaction. operationId: getTransaction parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/transactionIDPathParam' responses: '200': description: The details of the requested Transaction are provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: transaction: $ref: '#/definitions/Transaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/transactions/idrange: get: summary: Transaction ID Range description: Get a range of Transactions for an Account based on the Transaction IDs. operationId: getTransactionRange parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: from description: The starting Transacion ID (inclusive) to fetch. in: query type: string format: String representation of the numerical OANDA-assigned TransactionID required: true - name: to description: The ending Transaction ID (inclusive) to fetch. in: query type: string format: String representation of the numerical OANDA-assigned TransactionID required: true - name: type description: The filter that restricts the types of Transactions to retreive. in: query type: array items: type: string collectionFormat: csv responses: '200': description: The requested time range of Transactions are provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: transactions: type: array description: The list of Transactions that satisfy the request. items: $ref: '#/definitions/Transaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' '416': $ref: '#/responses/416' tags: - Accounts /accounts/{accountID}/transactions/sinceid: get: summary: Transactions Since ID description: Get a range of Transactions for an Account starting at (but not including) a provided Transaction ID. operationId: getTransactionsSinceId parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: id description: The ID of the last Transacion fetched. This query will return all Transactions newer than the TransactionID. in: query type: string format: String representation of the numerical OANDA-assigned TransactionID required: true responses: '200': description: The requested time range of Transactions are provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: transactions: type: array description: The list of Transactions that satisfy the request. items: $ref: '#/definitions/Transaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' '416': $ref: '#/responses/416' tags: - Accounts /accounts/{accountID}/transactions/stream: get: summary: Transaction Stream description: Get a stream of Transactions for an Account starting from when the request is made. operationId: streamTransactions parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/accountIDPathParam' responses: '200': description: Connecting to the Transaction Stream was successful. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object description: 'The response body for the Transaction Stream uses chunked transfer encoding. Each chunk contains Transaction and/or TransactionHeartbeat objects encoded as JSON. Each JSON object is serialized into a single line of text, and multiple objects found in the same chunk are separated by newlines. TransactionHeartbeats are sent every 5 seconds.' properties: transaction: $ref: '#/definitions/Transaction' heartbeat: $ref: '#/definitions/TransactionHeartbeat' '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/pricing: get: summary: Current Account Prices description: Get pricing information for a specified list of Instruments within an Account. operationId: getPrices parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: instruments description: List of Instruments to get pricing for. in: query type: array items: type: string format: A string containing the base currency and quote currency delimited by a "_". collectionFormat: csv required: true - name: since description: Date/Time filter to apply to the response. Only prices and home conversions (if requested) with a time later than this filter (i.e. the price has changed after the since time) will be provided, and are filtered independently. in: query type: string format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). - name: includeUnitsAvailable description: Flag that enables the inclusion of the unitsAvailable field in the returned Price objects. in: query type: boolean - name: includeHomeConversions description: Flag that enables the inclusion of the homeConversions field in the returned response. An entry will be returned for each currency in the set of all base and quote currencies present in the requested instruments list. in: query type: boolean responses: '200': description: Pricing information has been successfully provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: prices: type: array description: The list of Price objects requested. items: $ref: '#/definitions/ClientPrice' homeConversions: type: array description: The list of home currency conversion factors requested. This field will only be present if includeHomeConversions was set to true in the request. items: $ref: '#/definitions/HomeConversions' time: type: string description: The DateTime value to use for the "since" parameter in the next poll request. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/pricing/stream: get: summary: Price Stream description: 'Get a stream of Account Prices starting from when the request is made. This pricing stream does not include every single price created for the Account, but instead will provide at most 4 prices per second (every 250 milliseconds) for each instrument being requested. If more than one price is created for an instrument during the 250 millisecond window, only the price in effect at the end of the window is sent. This means that during periods of rapid price movement, subscribers to this stream will not be sent every price. Pricing windows for different connections to the price stream are not all aligned in the same way (i.e. they are not all aligned to the top of the second). This means that during periods of rapid price movement, different subscribers may observe different prices depending on their alignment.' operationId: streamPricing parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: instruments description: List of Instruments to stream Prices for. in: query type: array items: type: string format: A string containing the base currency and quote currency delimited by a "_". collectionFormat: csv required: true - name: snapshot description: Flag that enables/disables the sending of a pricing snapshot when initially connecting to the stream. in: query type: boolean responses: '200': description: Connecting to the Price Stream was successful. headers: Link: description: A link to the next/previous order book snapshot. type: string RequestID: description: The unique identifier generated for the request type: string schema: type: object description: 'The response body for the Pricing Stream uses chunked transfer encoding. Each chunk contains Price and/or PricingHeartbeat objects encoded as JSON. Each JSON object is serialized into a single line of text, and multiple objects found in the same chunk are separated by newlines. Heartbeats are sent every 5 seconds.' properties: price: $ref: '#/definitions/ClientPrice' heartbeat: $ref: '#/definitions/PricingHeartbeat' '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/instruments/{instrument}/candles: get: summary: Get Candlesticks description: Fetch candlestick data for an instrument. operationId: getInstrumentCandles parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/instrumentNamePathParam' - name: price description: The Price component(s) to get candlestick data for. Can contain any combination of the characters "M" (midpoint candles) "B" (bid candles) and "A" (ask candles). in: query type: string - name: granularity description: The granularity of the candlesticks to fetch in: query type: string - name: count description: The number of candlesticks to return in the response. Count should not be specified if both the start and end parameters are provided, as the time range combined with the granularity will determine the number of candlesticks to return. in: query type: integer - name: from description: The start of the time range to fetch candlesticks for. in: query type: string format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). - name: to description: The end of the time range to fetch candlesticks for. in: query type: string format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). - name: smooth description: A flag that controls whether the candlestick is "smoothed" or not. A smoothed candlestick uses the previous candle's close price as its open price, while an unsmoothed candlestick uses the first price from its time range as its open price. in: query type: boolean - name: includeFirst description: A flag that controls whether the candlestick that is covered by the from time should be included in the results. This flag enables clients to use the timestamp of the last completed candlestick received to poll for future candlesticks but avoid receiving the previous candlestick repeatedly. in: query type: boolean - name: dailyAlignment description: The hour of the day (in the specified timezone) to use for granularities that have daily alignments. in: query type: integer - name: alignmentTimezone description: The timezone to use for the dailyAlignment parameter. Candlesticks with daily alignment will be aligned to the dailyAlignment hour within the alignmentTimezone. Note that the returned times will still be represented in UTC. in: query type: string - name: weeklyAlignment description: The day of the week used for granularities that have weekly alignment. in: query type: string - name: units description: The number of units used to calculate the volume-weighted average bid and ask prices in the returned candles. in: query type: string format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. responses: '200': description: Pricing information has been successfully provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: instrument: type: string description: The instrument whose Prices are represented by the candlesticks. format: A string containing the base currency and quote currency delimited by a "_". granularity: type: string description: The granularity of the candlesticks provided. enum: - S5 - S10 - S15 - S30 - M1 - M2 - M4 - M5 - M10 - M15 - M30 - H1 - H2 - H3 - H4 - H6 - H8 - H12 - D - W - M candles: type: array description: The list of candlesticks that satisfy the request. items: $ref: '#/definitions/Candlestick' '400': $ref: '#/responses/400' '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/orders: post: summary: Create Order description: Create an Order for an Account operationId: createOrder parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: createOrderBody in: body schema: type: object properties: order: $ref: '#/definitions/OrderRequest' required: true responses: '201': description: The Order was created as specified headers: Location: description: A link to the Order that was just created type: string RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: orderCreateTransaction: $ref: '#/definitions/Transaction' orderFillTransaction: $ref: '#/definitions/OrderFillTransaction' orderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' orderReissueTransaction: $ref: '#/definitions/Transaction' orderReissueRejectTransaction: $ref: '#/definitions/Transaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': description: The Order specification was invalid schema: type: object properties: orderRejectTransaction: $ref: '#/definitions/Transaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '401': $ref: '#/responses/401' '403': $ref: '#/responses/403' '404': description: The Order or Account specified does not exist. schema: type: object properties: orderRejectTransaction: $ref: '#/definitions/Transaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. Only present if the Account exists. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. Only present if the Account exists. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '405': $ref: '#/responses/405' tags: - Accounts get: summary: List Orders description: Get a list of Orders for an Account operationId: listOrders parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - name: ids description: List of Order IDs to retrieve in: query type: array items: type: string format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. collectionFormat: csv - name: state description: The state to filter the requested Orders by in: query type: string - name: instrument description: The instrument to filter the requested orders by in: query type: string format: A string containing the base currency and quote currency delimited by a "_". - name: count description: The maximum number of Orders to return in: query type: integer - name: beforeID description: The maximum Order ID to return. If not provided the most recent Orders in the Account are returned in: query type: string format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. responses: '200': description: The list of Orders requested headers: Link: description: A link to the next page of results if the results were paginated type: string RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: orders: type: array description: The list of Order detail objects items: $ref: '#/definitions/Order' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': $ref: '#/responses/400' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/pendingOrders: get: summary: Pending Orders description: List all pending Orders in an Account operationId: listPendingOrders parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' responses: '200': description: List of pending Orders for the Account headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: orders: type: array description: The list of pending Order details items: $ref: '#/definitions/Order' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/orders/{orderSpecifier}: get: summary: Get Order description: Get details for a single Order in an Account operationId: getOrder parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/orderSpecifierPathParam' responses: '200': description: The details of the Order requested headers: Link: description: A link to the next page of results if the results were paginated type: string RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: order: $ref: '#/definitions/Order' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': $ref: '#/responses/404' '405': $ref: '#/responses/405' tags: - Accounts put: summary: Replace Order description: Replace an Order in an Account by simultaneously cancelling it and creating a replacement Order operationId: replaceOrder parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/clientRequestIDHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/orderSpecifierPathParam' - name: replaceOrderBody description: Specification of the replacing Order. The replacing order must have the same type as the replaced Order. in: body schema: type: object properties: order: $ref: '#/definitions/OrderRequest' required: true responses: '201': description: The Order was successfully cancelled and replaced headers: Location: description: A link to the replacing Order type: string RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: orderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' orderCreateTransaction: $ref: '#/definitions/Transaction' orderFillTransaction: $ref: '#/definitions/OrderFillTransaction' orderReissueTransaction: $ref: '#/definitions/Transaction' orderReissueRejectTransaction: $ref: '#/definitions/Transaction' replacingOrderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '400': description: The Order specification was invalid schema: type: object properties: orderRejectTransaction: $ref: '#/definitions/Transaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '401': $ref: '#/responses/401' '404': description: The Account or Order specified does not exist. schema: type: object properties: orderCancelRejectTransaction: $ref: '#/definitions/Transaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. Only present if the Account exists. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. Only present if the Account exists. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/orders/{orderSpecifier}/cancel: put: summary: Cancel Order description: Cancel a pending Order in an Account operationId: cancelOrder parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/clientRequestIDHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/orderSpecifierPathParam' responses: '200': description: The Order was cancelled as specified headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: orderCancelTransaction: $ref: '#/definitions/OrderCancelTransaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID '401': $ref: '#/responses/401' '404': description: The Account or Order specified does not exist. schema: type: object properties: orderCancelRejectTransaction: $ref: '#/definitions/OrderCancelRejectTransaction' relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. Only present if the Account exists. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. Only present if the Account exists. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '405': $ref: '#/responses/405' tags: - Accounts /accounts/{accountID}/orders/{orderSpecifier}/clientExtensions: put: summary: Set Order Extensions description: Update the Client Extensions for an Order in an Account. Do not set, modify, or delete clientExtensions if your account is associated with MT4. operationId: setOrderClientExtensions parameters: - $ref: '#/parameters/authorizationHeaderParam' - $ref: '#/parameters/acceptDatetimeFormatHeaderParam' - $ref: '#/parameters/accountIDPathParam' - $ref: '#/parameters/orderSpecifierPathParam' - name: setOrderClientExtensionsBody description: Representation of the replacing Order in: body schema: type: object properties: clientExtensions: $ref: '#/definitions/ClientExtensions' tradeClientExtensions: $ref: '#/definitions/ClientExtensions' required: true responses: '200': description: The Order's Client Extensions were successfully modified headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: orderClientExtensionsModifyTransaction: $ref: '#/definitions/OrderClientExtensionsModifyTransaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID '400': description: The Order Client Extensions specification was invalid schema: type: object properties: orderClientExtensionsModifyRejectTransaction: $ref: '#/definitions/OrderClientExtensionsModifyRejectTransaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '401': $ref: '#/responses/401' '404': description: The Account or Order specified does not exist. schema: type: object properties: orderClientExtensionsModifyRejectTransaction: $ref: '#/definitions/OrderClientExtensionsModifyRejectTransaction' lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account. Only present if the Account exists. format: String representation of the numerical OANDA-assigned TransactionID relatedTransactionIDs: type: array description: The IDs of all Transactions that were created while satisfying the request. Only present if the Account exists. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '405': $ref: '#/responses/405' tags: - Accounts definitions: Account: type: object description: The full details of a client's Account. This includes full open Trade, open Position and pending Order representation. properties: id: type: string description: The Account's identifier format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' alias: type: string description: Client-assigned alias for the Account. Only provided if the Account has an alias set currency: type: string description: The home currency of the Account format: A string containing an ISO 4217 currency (http://en.wikipedia.org/wiki/ISO_4217) balance: type: string description: The current balance of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. createdByUserID: type: integer description: ID of the user that created the Account. createdTime: type: string description: The date/time when the Account was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). guaranteedStopLossOrderMode: type: string description: The current guaranteed Stop Loss Order mode of the Account. enum: - DISABLED - ALLOWED - REQUIRED pl: type: string description: The total profit/loss realized over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. resettablePL: type: string description: The total realized profit/loss for the Account since it was last reset by the client. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. resettablePLTime: type: string description: The date/time that the Account's resettablePL was last reset. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). financing: type: string description: The total amount of financing paid/collected over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. commission: type: string description: The total amount of commission paid over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. guaranteedExecutionFees: type: string description: The total amount of fees charged over the lifetime of the Account for the execution of guaranteed Stop Loss Orders. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginRate: type: string description: Client-provided margin rate override for the Account. The effective margin rate of the Account is the lesser of this value and the OANDA margin rate for the Account's division. This value is only provided if a margin rate override exists for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. marginCallEnterTime: type: string description: The date/time when the Account entered a margin call state. Only provided if the Account is in a margin call. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). marginCallExtensionCount: type: integer description: The number of times that the Account's current margin call was extended. lastMarginCallExtensionTime: type: string description: The date/time of the Account's last margin call extension. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). openTradeCount: type: integer description: The number of Trades currently open in the Account. openPositionCount: type: integer description: The number of Positions currently open in the Account. pendingOrderCount: type: integer description: The number of Orders currently pending in the Account. hedgingEnabled: type: boolean description: Flag indicating that the Account has hedging enabled. lastOrderFillTimestamp: type: string description: The date/time of the last order that was filled for this account. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). unrealizedPL: type: string description: The total unrealized profit/loss for all Trades currently open in the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. NAV: type: string description: The net asset value of the Account. Equal to Account balance + unrealizedPL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginUsed: type: string description: Margin currently used for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginAvailable: type: string description: Margin available for Account currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. positionValue: type: string description: The value of the Account's open positions represented in the Account's home currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutUnrealizedPL: type: string description: The Account's margin closeout unrealized PL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutNAV: type: string description: The Account's margin closeout NAV. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutMarginUsed: type: string description: The Account's margin closeout margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutPercent: type: string description: The Account's margin closeout percentage. When this value is 1.0 or above the Account is in a margin closeout situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. marginCloseoutPositionValue: type: string description: The value of the Account's open positions as used for margin closeout calculations represented in the Account's home currency. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. withdrawalLimit: type: string description: The current WithdrawalLimit for the account which will be zero or a positive value indicating how much can be withdrawn from the account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCallMarginUsed: type: string description: The Account's margin call margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCallPercent: type: string description: The Account's margin call percentage. When this value is 1.0 or above the Account is in a margin call situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. lastTransactionID: type: string description: The ID of the last Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID trades: type: array description: The details of the Trades currently open in the Account. items: $ref: '#/definitions/TradeSummary' positions: type: array description: The details all Account Positions. items: $ref: '#/definitions/Position' orders: type: array description: The details of the Orders currently pending in the Account. items: $ref: '#/definitions/Order' Instrument: type: object description: Full specification of an Instrument. properties: name: type: string description: The name of the Instrument format: A string containing the base currency and quote currency delimited by a "_". type: type: string description: The type of the Instrument enum: - CURRENCY - CFD - METAL displayName: type: string description: The display name of the Instrument pipLocation: type: integer description: The location of the "pip" for this instrument. The decimal position of the pip in this Instrument's price can be found at 10 ^ pipLocation (e.g. -4 pipLocation results in a decimal pip position of 10 ^ -4 = 0.0001). displayPrecision: type: integer description: The number of decimal places that should be used to display prices for this instrument. (e.g. a displayPrecision of 5 would result in a price of "1" being displayed as "1.00000") tradeUnitsPrecision: type: integer description: The amount of decimal places that may be provided when specifying the number of units traded for this instrument. minimumTradeSize: type: string description: The smallest number of units allowed to be traded for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. maximumTrailingStopDistance: type: string description: The maximum trailing stop distance allowed for a trailing stop loss created for this instrument. Specified in price units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. minimumTrailingStopDistance: type: string description: The minimum trailing stop distance allowed for a trailing stop loss created for this instrument. Specified in price units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. maximumPositionSize: type: string description: The maximum position size allowed for this instrument. Specified in units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. maximumOrderUnits: type: string description: The maximum units allowed for an Order placed for this instrument. Specified in units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. marginRate: type: string description: The margin rate for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. commission: $ref: '#/definitions/InstrumentCommission' PriceBucket: type: object description: A Price Bucket represents a price available for an amount of liquidity properties: price: type: string description: The Price offered by the PriceBucket format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. liquidity: type: integer description: The amount of liquidity offered by the PriceBucket TradeReduce: type: object description: A TradeReduce object represents a Trade for an instrument that was reduced (either partially or fully) in an Account. It is found embedded in Transactions that affect the position of an instrument in the account, specifically the OrderFill Transaction. properties: tradeID: type: string description: The ID of the Trade that was reduced or closed format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. units: type: string description: The number of units that the Trade was reduced by format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. price: type: string description: The average price that the units were closed at. This price may be clamped for guaranteed Stop Loss Orders. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. realizedPL: type: string description: The PL realized when reducing the Trade format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. financing: type: string description: The financing paid/collected when reducing the Trade format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. guaranteedExecutionFee: type: string description: This is the fee that is charged for closing the Trade if it has a guaranteed Stop Loss Order attached to it. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. halfSpreadCost: type: string description: The half spread cost for the trade reduce/close. This can be a positive or negative value and is represented in the home currency of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. AccountProperties: type: object description: Properties related to an Account. properties: id: type: string description: The Account's identifier format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' mt4AccountID: type: integer description: The Account's associated MT4 Account ID. This field will not be present if the Account is not an MT4 account. tags: type: array description: The Account's tags items: type: string ClientPrice: type: object description: The specification of an Account-specific Price. properties: type: type: string description: The string "PRICE". Used to identify the a Price object when found in a stream. instrument: type: string description: The Price's Instrument. format: A string containing the base currency and quote currency delimited by a "_". time: type: string description: The date/time when the Price was created format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). status: type: string description: The status of the Price. enum: - tradeable - non-tradeable - invalid tradeable: type: boolean description: Flag indicating if the Price is tradeable or not bids: type: array description: The list of prices and liquidity available on the Instrument's bid side. It is possible for this list to be empty if there is no bid liquidity currently available for the Instrument in the Account. items: $ref: '#/definitions/PriceBucket' asks: type: array description: The list of prices and liquidity available on the Instrument's ask side. It is possible for this list to be empty if there is no ask liquidity currently available for the Instrument in the Account. items: $ref: '#/definitions/PriceBucket' closeoutBid: type: string description: The closeout bid Price. This Price is used when a bid is required to closeout a Position (margin closeout or manual) yet there is no bid liquidity. The closeout bid is never used to open a new position. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. closeoutAsk: type: string description: The closeout ask Price. This Price is used when a ask is required to closeout a Position (margin closeout or manual) yet there is no ask liquidity. The closeout ask is never used to open a new position. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. quoteHomeConversionFactors: $ref: '#/definitions/QuoteHomeConversionFactors' unitsAvailable: $ref: '#/definitions/UnitsAvailable' ClientConfigureTransaction: type: object description: A ClientConfigureTransaction represents the configuration of an Account by a client. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "CLIENT_CONFIGURE" in a ClientConfigureTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL alias: type: string description: The client-provided alias for the Account. marginRate: type: string description: The margin rate override for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. Trade: type: object description: The specification of a Trade within an Account. This includes the full representation of the Trade's dependent Orders in addition to the IDs of those Orders. properties: id: type: string description: The Trade's identifier, unique within the Trade's Account. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. instrument: type: string description: The Trade's Instrument. format: A string containing the base currency and quote currency delimited by a "_". price: type: string description: The execution price of the Trade. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. openTime: type: string description: The date/time when the Trade was opened. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). state: type: string description: The current state of the Trade. enum: - OPEN - CLOSED - CLOSE_WHEN_TRADEABLE initialUnits: type: string description: The initial size of the Trade. Negative values indicate a short Trade, and positive values indicate a long Trade. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. initialMarginRequired: type: string description: The margin required at the time the Trade was created. Note, this is the 'pure' margin required, it is not the 'effective' margin used that factors in the trade risk if a GSLO is attached to the trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. currentUnits: type: string description: The number of units currently open for the Trade. This value is reduced to 0.0 as the Trade is closed. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. realizedPL: type: string description: The total profit/loss realized on the closed portion of the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. unrealizedPL: type: string description: The unrealized profit/loss on the open portion of the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginUsed: type: string description: Margin currently used by the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. averageClosePrice: type: string description: The average closing price of the Trade. Only present if the Trade has been closed or reduced at least once. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. closingTransactionIDs: type: array description: The IDs of the Transactions that have closed portions of this Trade. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID financing: type: string description: The financing paid/collected for this Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. closeTime: type: string description: The date/time when the Trade was fully closed. Only provided for Trades whose state is CLOSED. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). clientExtensions: $ref: '#/definitions/ClientExtensions' takeProfitOrder: $ref: '#/definitions/TakeProfitOrder' stopLossOrder: $ref: '#/definitions/StopLossOrder' trailingStopLossOrder: $ref: '#/definitions/TrailingStopLossOrder' InstrumentCommission: type: object description: An InstrumentCommission represents an instrument-specific commission properties: commission: type: string description: The commission amount (in the Account's home currency) charged per unitsTraded of the instrument format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. unitsTraded: type: string description: The number of units traded that the commission amount is based on. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. minimumCommission: type: string description: The minimum commission amount (in the Account's home currency) that is charged when an Order is filled for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. OrderRequest: type: object description: The base Order specification used when requesting that an Order be created. Each specific Order-type extends this definition. properties: {} CandlestickData: type: object description: The price data (open, high, low, close) for the Candlestick representation. properties: o: type: string description: The first (open) price in the time-range represented by the candlestick. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. h: type: string description: The highest price in the time-range represented by the candlestick. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. l: type: string description: The lowest price in the time-range represented by the candlestick. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. c: type: string description: The last (closing) price in the time-range represented by the candlestick. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. OrderCancelTransaction: type: object description: An OrderCancelTransaction represents the cancellation of an Order in the client's Account. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "ORDER_CANCEL" for an OrderCancelTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL orderID: type: string description: The ID of the Order cancelled format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. clientOrderID: type: string description: The client ID of the Order cancelled (only provided if the Order has a client Order ID). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. reason: type: string description: The reason that the Order was cancelled. enum: - INTERNAL_SERVER_ERROR - ACCOUNT_LOCKED - ACCOUNT_NEW_POSITIONS_LOCKED - ACCOUNT_ORDER_CREATION_LOCKED - ACCOUNT_ORDER_FILL_LOCKED - CLIENT_REQUEST - MIGRATION - MARKET_HALTED - LINKED_TRADE_CLOSED - TIME_IN_FORCE_EXPIRED - INSUFFICIENT_MARGIN - FIFO_VIOLATION - BOUNDS_VIOLATION - CLIENT_REQUEST_REPLACED - INSUFFICIENT_LIQUIDITY - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST - TAKE_PROFIT_ON_FILL_LOSS - LOSING_TAKE_PROFIT - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - STOP_LOSS_ON_FILL_LOSS - STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - STOP_LOSS_ON_FILL_REQUIRED - STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED - STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED - STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - CLIENT_TRADE_ID_ALREADY_EXISTS - POSITION_CLOSEOUT_FAILED - OPEN_TRADES_ALLOWED_EXCEEDED - PENDING_ORDERS_ALLOWED_EXCEEDED - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS - STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS - POSITION_SIZE_EXCEEDED - HEDGING_GSLO_VIOLATION - ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED - INSTRUMENT_BID_REDUCE_ONLY - INSTRUMENT_ASK_REDUCE_ONLY - INSTRUMENT_BID_HALTED - INSTRUMENT_ASK_HALTED - STOP_LOSS_ON_FILL_GUARANTEED_BID_HALTED - STOP_LOSS_ON_FILL_GUARANTEED_ASK_HALTED replacedByOrderID: type: string description: The ID of the Order that replaced this Order (only provided if this Order was cancelled for replacement). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. OrderCancelRejectTransaction: type: object description: An OrderCancelRejectTransaction represents the rejection of the cancellation of an Order in the client's Account. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "ORDER_CANCEL_REJECT" for an OrderCancelRejectTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL orderID: type: string description: The ID of the Order intended to be cancelled format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. clientOrderID: type: string description: The client ID of the Order intended to be cancelled (only provided if the Order has a client Order ID). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. rejectReason: type: string description: The reason that the Reject Transaction was created enum: - INTERNAL_SERVER_ERROR - INSTRUMENT_PRICE_UNKNOWN - ACCOUNT_NOT_ACTIVE - ACCOUNT_LOCKED - ACCOUNT_ORDER_CREATION_LOCKED - ACCOUNT_CONFIGURATION_LOCKED - ACCOUNT_DEPOSIT_LOCKED - ACCOUNT_WITHDRAWAL_LOCKED - ACCOUNT_ORDER_CANCEL_LOCKED - INSTRUMENT_NOT_TRADEABLE - PENDING_ORDERS_ALLOWED_EXCEEDED - ORDER_ID_UNSPECIFIED - ORDER_DOESNT_EXIST - ORDER_IDENTIFIER_INCONSISTENCY - TRADE_ID_UNSPECIFIED - TRADE_DOESNT_EXIST - TRADE_IDENTIFIER_INCONSISTENCY - INSUFFICIENT_MARGIN - INSTRUMENT_MISSING - INSTRUMENT_UNKNOWN - UNITS_MISSING - UNITS_INVALID - UNITS_PRECISION_EXCEEDED - UNITS_LIMIT_EXCEEDED - UNITS_MIMIMUM_NOT_MET - PRICE_MISSING - PRICE_INVALID - PRICE_PRECISION_EXCEEDED - PRICE_DISTANCE_MISSING - PRICE_DISTANCE_INVALID - PRICE_DISTANCE_PRECISION_EXCEEDED - PRICE_DISTANCE_MAXIMUM_EXCEEDED - PRICE_DISTANCE_MINIMUM_NOT_MET - TIME_IN_FORCE_MISSING - TIME_IN_FORCE_INVALID - TIME_IN_FORCE_GTD_TIMESTAMP_MISSING - TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST - PRICE_BOUND_INVALID - PRICE_BOUND_PRECISION_EXCEEDED - ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS - TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED - CLIENT_ORDER_ID_INVALID - CLIENT_ORDER_ID_ALREADY_EXISTS - CLIENT_ORDER_TAG_INVALID - CLIENT_ORDER_COMMENT_INVALID - CLIENT_TRADE_ID_INVALID - CLIENT_TRADE_ID_ALREADY_EXISTS - CLIENT_TRADE_TAG_INVALID - CLIENT_TRADE_COMMENT_INVALID - ORDER_FILL_POSITION_ACTION_MISSING - ORDER_FILL_POSITION_ACTION_INVALID - TRIGGER_CONDITION_MISSING - TRIGGER_CONDITION_INVALID - ORDER_PARTIAL_FILL_OPTION_MISSING - ORDER_PARTIAL_FILL_OPTION_INVALID - INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL - TAKE_PROFIT_ORDER_ALREADY_EXISTS - TAKE_PROFIT_ON_FILL_PRICE_MISSING - TAKE_PROFIT_ON_FILL_PRICE_INVALID - TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID - STOP_LOSS_ORDER_ALREADY_EXISTS - STOP_LOSS_ORDER_GUARANTEED_REQUIRED - STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD - STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ORDER_NOT_CANCELABLE - STOP_LOSS_ORDER_NOT_REPLACEABLE - STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER - STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED - STOP_LOSS_ON_FILL_PRICE_MISSING - STOP_LOSS_ON_FILL_PRICE_INVALID - STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_INVALID - STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - CLOSE_TRADE_TYPE_MISSING - CLOSE_TRADE_PARTIAL_UNITS_MISSING - CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE - CLOSEOUT_POSITION_DOESNT_EXIST - CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION - CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE - CLOSEOUT_POSITION_REJECT - CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING - MARKUP_GROUP_ID_INVALID - POSITION_AGGREGATION_MODE_INVALID - ADMIN_CONFIGURE_DATA_MISSING - MARGIN_RATE_INVALID - MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT - ALIAS_INVALID - CLIENT_CONFIGURE_DATA_MISSING - MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL - AMOUNT_INVALID - INSUFFICIENT_FUNDS - AMOUNT_MISSING - FUNDING_REASON_MISSING - CLIENT_EXTENSIONS_DATA_MISSING - REPLACING_ORDER_INVALID - REPLACING_TRADE_ID_INVALID PositionSide: type: object description: The representation of a Position for a single direction (long or short). properties: units: type: string description: Number of units in the position (negative value indicates short position, positive indicates long position). format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. averagePrice: type: string description: Volume-weighted average of the underlying Trade open prices for the Position. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. tradeIDs: type: array description: List of the open Trade IDs which contribute to the open Position. items: type: string description: The Trade's identifier, unique within the Trade's Account. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. pl: type: string description: Profit/loss realized by the PositionSide over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. unrealizedPL: type: string description: The unrealized profit/loss of all open Trades that contribute to this PositionSide. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. resettablePL: type: string description: Profit/loss realized by the PositionSide since the Account's resettablePL was last reset by the client. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. financing: type: string description: The total amount of financing paid/collected for this PositionSide over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. guaranteedExecutionFees: type: string description: The total amount of fees charged over the lifetime of the Account for the execution of guaranteed Stop Loss Orders attached to Trades for this PositionSide. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. HomeConversions: type: object description: HomeConversions represents the factors to use to convert quantities of a given currency into the Account's home currency. The conversion factor depends on the scenario the conversion is required for. properties: currency: type: string description: The currency to be converted into the home currency. format: A string containing an ISO 4217 currency (http://en.wikipedia.org/wiki/ISO_4217) accountGain: type: string description: The factor used to convert any gains for an Account in the specified currency into the Account's home currency. This would include positive realized P/L and positive financing amounts. Conversion is performed by multiplying the positive P/L by the conversion factor. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. accountLoss: type: string description: The string representation of a decimal number. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. positionValue: type: string description: The factor used to convert a Position or Trade Value in the specified currency into the Account's home currency. Conversion is performed by multiplying the Position or Trade Value by the conversion factor. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. StopLossOrderRejectTransaction: type: object description: A StopLossOrderRejectTransaction represents the rejection of the creation of a StopLoss Order. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "STOP_LOSS_ORDER_REJECT" in a StopLossOrderRejectTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL tradeID: type: string description: The ID of the Trade to close when the price threshold is breached. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade to be closed when the price threshold is breached. price: type: string description: The price threshold specified for the Stop Loss Order. If the guaranteed flag is false, the associated Trade will be closed by a market price that is equal to or worse than this threshold. If the flag is true the associated Trade will be closed at this price. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. distance: type: string description: Specifies the distance (in price units) from the Account's current price to use as the Stop Loss Order price. If the Trade is short the Instrument's bid price is used, and for long Trades the ask is used. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time-in-force requested for the StopLoss Order. Restricted to "GTC", "GFD" and "GTD" for StopLoss Orders. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date/time when the StopLoss Order will be cancelled if its timeInForce is "GTD". format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). triggerCondition: type: string description: 'Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA''s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order''s trigger condition is set to the default value when indicating the distance from an Order''s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and "BID", and for short trades "DEFAULT" and "ASK" are valid.' enum: - DEFAULT - INVERSE - BID - ASK - MID guaranteed: type: boolean description: Flag indicating that the Stop Loss Order is guaranteed. The default value depends on the GuaranteedStopLossOrderMode of the account, if it is REQUIRED, the default will be true, for DISABLED or ENABLED the default is false. reason: type: string description: The reason that the Stop Loss Order was initiated enum: - CLIENT_ORDER - REPLACEMENT - ON_FILL clientExtensions: $ref: '#/definitions/ClientExtensions' orderFillTransactionID: type: string description: The ID of the OrderFill Transaction that caused this Order to be created (only provided if this Order was created automatically when another Order was filled). format: String representation of the numerical OANDA-assigned TransactionID intendedReplacesOrderID: type: string description: The ID of the Order that this Order was intended to replace (only provided if this Order was intended to replace an existing Order). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. rejectReason: type: string description: The reason that the Reject Transaction was created enum: - INTERNAL_SERVER_ERROR - INSTRUMENT_PRICE_UNKNOWN - ACCOUNT_NOT_ACTIVE - ACCOUNT_LOCKED - ACCOUNT_ORDER_CREATION_LOCKED - ACCOUNT_CONFIGURATION_LOCKED - ACCOUNT_DEPOSIT_LOCKED - ACCOUNT_WITHDRAWAL_LOCKED - ACCOUNT_ORDER_CANCEL_LOCKED - INSTRUMENT_NOT_TRADEABLE - PENDING_ORDERS_ALLOWED_EXCEEDED - ORDER_ID_UNSPECIFIED - ORDER_DOESNT_EXIST - ORDER_IDENTIFIER_INCONSISTENCY - TRADE_ID_UNSPECIFIED - TRADE_DOESNT_EXIST - TRADE_IDENTIFIER_INCONSISTENCY - INSUFFICIENT_MARGIN - INSTRUMENT_MISSING - INSTRUMENT_UNKNOWN - UNITS_MISSING - UNITS_INVALID - UNITS_PRECISION_EXCEEDED - UNITS_LIMIT_EXCEEDED - UNITS_MIMIMUM_NOT_MET - PRICE_MISSING - PRICE_INVALID - PRICE_PRECISION_EXCEEDED - PRICE_DISTANCE_MISSING - PRICE_DISTANCE_INVALID - PRICE_DISTANCE_PRECISION_EXCEEDED - PRICE_DISTANCE_MAXIMUM_EXCEEDED - PRICE_DISTANCE_MINIMUM_NOT_MET - TIME_IN_FORCE_MISSING - TIME_IN_FORCE_INVALID - TIME_IN_FORCE_GTD_TIMESTAMP_MISSING - TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST - PRICE_BOUND_INVALID - PRICE_BOUND_PRECISION_EXCEEDED - ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS - TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED - CLIENT_ORDER_ID_INVALID - CLIENT_ORDER_ID_ALREADY_EXISTS - CLIENT_ORDER_TAG_INVALID - CLIENT_ORDER_COMMENT_INVALID - CLIENT_TRADE_ID_INVALID - CLIENT_TRADE_ID_ALREADY_EXISTS - CLIENT_TRADE_TAG_INVALID - CLIENT_TRADE_COMMENT_INVALID - ORDER_FILL_POSITION_ACTION_MISSING - ORDER_FILL_POSITION_ACTION_INVALID - TRIGGER_CONDITION_MISSING - TRIGGER_CONDITION_INVALID - ORDER_PARTIAL_FILL_OPTION_MISSING - ORDER_PARTIAL_FILL_OPTION_INVALID - INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL - TAKE_PROFIT_ORDER_ALREADY_EXISTS - TAKE_PROFIT_ON_FILL_PRICE_MISSING - TAKE_PROFIT_ON_FILL_PRICE_INVALID - TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID - STOP_LOSS_ORDER_ALREADY_EXISTS - STOP_LOSS_ORDER_GUARANTEED_REQUIRED - STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD - STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ORDER_NOT_CANCELABLE - STOP_LOSS_ORDER_NOT_REPLACEABLE - STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER - STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED - STOP_LOSS_ON_FILL_PRICE_MISSING - STOP_LOSS_ON_FILL_PRICE_INVALID - STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_INVALID - STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - CLOSE_TRADE_TYPE_MISSING - CLOSE_TRADE_PARTIAL_UNITS_MISSING - CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE - CLOSEOUT_POSITION_DOESNT_EXIST - CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION - CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE - CLOSEOUT_POSITION_REJECT - CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING - MARKUP_GROUP_ID_INVALID - POSITION_AGGREGATION_MODE_INVALID - ADMIN_CONFIGURE_DATA_MISSING - MARGIN_RATE_INVALID - MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT - ALIAS_INVALID - CLIENT_CONFIGURE_DATA_MISSING - MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL - AMOUNT_INVALID - INSUFFICIENT_FUNDS - AMOUNT_MISSING - FUNDING_REASON_MISSING - CLIENT_EXTENSIONS_DATA_MISSING - REPLACING_ORDER_INVALID - REPLACING_TRADE_ID_INVALID PricingHeartbeat: type: object description: A PricingHeartbeat object is injected into the Pricing stream to ensure that the HTTP connection remains active. properties: type: type: string description: The string "HEARTBEAT" time: type: string description: The date/time when the Heartbeat was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). TakeProfitOrder: type: object description: A TakeProfitOrder is an order that is linked to an open Trade and created with a price threshold. The Order will be filled (closing the Trade) by the first price that is equal to or better than the threshold. A TakeProfitOrder cannot be used to open a new Position. properties: id: type: string description: The Order's identifier, unique within the Order's Account. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. createTime: type: string description: The time when the Order was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). state: type: string description: The current state of the Order. enum: - PENDING - FILLED - TRIGGERED - CANCELLED clientExtensions: $ref: '#/definitions/ClientExtensions' type: type: string description: The type of the Order. Always set to "TAKE_PROFIT" for Take Profit Orders. enum: - MARKET - LIMIT - STOP - MARKET_IF_TOUCHED - TAKE_PROFIT - STOP_LOSS - TRAILING_STOP_LOSS - FIXED_PRICE tradeID: type: string description: The ID of the Trade to close when the price threshold is breached. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade to be closed when the price threshold is breached. price: type: string description: The price threshold specified for the TakeProfit Order. The associated Trade will be closed by a market price that is equal to or better than this threshold. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. timeInForce: type: string description: The time-in-force requested for the TakeProfit Order. Restricted to "GTC", "GFD" and "GTD" for TakeProfit Orders. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date/time when the TakeProfit Order will be cancelled if its timeInForce is "GTD". format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). triggerCondition: type: string description: 'Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA''s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order''s trigger condition is set to the default value when indicating the distance from an Order''s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and "BID", and for short trades "DEFAULT" and "ASK" are valid.' enum: - DEFAULT - INVERSE - BID - ASK - MID fillingTransactionID: type: string description: ID of the Transaction that filled this Order (only provided when the Order's state is FILLED) format: String representation of the numerical OANDA-assigned TransactionID filledTime: type: string description: Date/time when the Order was filled (only provided when the Order's state is FILLED) format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). tradeOpenedID: type: string description: Trade ID of Trade opened when the Order was filled (only provided when the Order's state is FILLED and a Trade was opened as a result of the fill) format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. tradeReducedID: type: string description: Trade ID of Trade reduced when the Order was filled (only provided when the Order's state is FILLED and a Trade was reduced as a result of the fill) format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. tradeClosedIDs: type: array description: Trade IDs of Trades closed when the Order was filled (only provided when the Order's state is FILLED and one or more Trades were closed as a result of the fill) items: type: string description: The Trade's identifier, unique within the Trade's Account. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. cancellingTransactionID: type: string description: ID of the Transaction that cancelled the Order (only provided when the Order's state is CANCELLED) format: String representation of the numerical OANDA-assigned TransactionID cancelledTime: type: string description: Date/time when the Order was cancelled (only provided when the state of the Order is CANCELLED) format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). replacesOrderID: type: string description: The ID of the Order that was replaced by this Order (only provided if this Order was created as part of a cancel/replace). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. replacedByOrderID: type: string description: The ID of the Order that replaced this Order (only provided if this Order was cancelled as part of a cancel/replace). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. UnitsAvailableDetails: type: object description: Representation of many units of an Instrument are available to be traded for both long and short Orders. properties: long: type: string description: The units available for long Orders. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. short: type: string description: The units available for short Orders. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. StopLossOrder: type: object description: A StopLossOrder is an order that is linked to an open Trade and created with a price threshold. The Order will be filled (closing the Trade) by the first price that is equal to or worse than the threshold. A StopLossOrder cannot be used to open a new Position. properties: id: type: string description: The Order's identifier, unique within the Order's Account. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. createTime: type: string description: The time when the Order was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). state: type: string description: The current state of the Order. enum: - PENDING - FILLED - TRIGGERED - CANCELLED clientExtensions: $ref: '#/definitions/ClientExtensions' type: type: string description: The type of the Order. Always set to "STOP_LOSS" for Stop Loss Orders. enum: - MARKET - LIMIT - STOP - MARKET_IF_TOUCHED - TAKE_PROFIT - STOP_LOSS - TRAILING_STOP_LOSS - FIXED_PRICE guaranteedExecutionPremium: type: string description: The premium that will be charged if the Stop Loss Order is guaranteed and the Order is filled at the guaranteed price. It is in price units and is charged for each unit of the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. tradeID: type: string description: The ID of the Trade to close when the price threshold is breached. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade to be closed when the price threshold is breached. price: type: string description: The price threshold specified for the Stop Loss Order. If the guaranteed flag is false, the associated Trade will be closed by a market price that is equal to or worse than this threshold. If the flag is true the associated Trade will be closed at this price. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. distance: type: string description: Specifies the distance (in price units) from the Account's current price to use as the Stop Loss Order price. If the Trade is short the Instrument's bid price is used, and for long Trades the ask is used. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time-in-force requested for the StopLoss Order. Restricted to "GTC", "GFD" and "GTD" for StopLoss Orders. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date/time when the StopLoss Order will be cancelled if its timeInForce is "GTD". format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). triggerCondition: type: string description: 'Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA''s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order''s trigger condition is set to the default value when indicating the distance from an Order''s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and "BID", and for short trades "DEFAULT" and "ASK" are valid.' enum: - DEFAULT - INVERSE - BID - ASK - MID guaranteed: type: boolean description: Flag indicating that the Stop Loss Order is guaranteed. The default value depends on the GuaranteedStopLossOrderMode of the account, if it is REQUIRED, the default will be true, for DISABLED or ENABLED the default is false. fillingTransactionID: type: string description: ID of the Transaction that filled this Order (only provided when the Order's state is FILLED) format: String representation of the numerical OANDA-assigned TransactionID filledTime: type: string description: Date/time when the Order was filled (only provided when the Order's state is FILLED) format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). tradeOpenedID: type: string description: Trade ID of Trade opened when the Order was filled (only provided when the Order's state is FILLED and a Trade was opened as a result of the fill) format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. tradeReducedID: type: string description: Trade ID of Trade reduced when the Order was filled (only provided when the Order's state is FILLED and a Trade was reduced as a result of the fill) format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. tradeClosedIDs: type: array description: Trade IDs of Trades closed when the Order was filled (only provided when the Order's state is FILLED and one or more Trades were closed as a result of the fill) items: type: string description: The Trade's identifier, unique within the Trade's Account. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. cancellingTransactionID: type: string description: ID of the Transaction that cancelled the Order (only provided when the Order's state is CANCELLED) format: String representation of the numerical OANDA-assigned TransactionID cancelledTime: type: string description: Date/time when the Order was cancelled (only provided when the state of the Order is CANCELLED) format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). replacesOrderID: type: string description: The ID of the Order that was replaced by this Order (only provided if this Order was created as part of a cancel/replace). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. replacedByOrderID: type: string description: The ID of the Order that replaced this Order (only provided if this Order was cancelled as part of a cancel/replace). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. TrailingStopLossOrder: type: object description: A TrailingStopLossOrder is an order that is linked to an open Trade and created with a price distance. The price distance is used to calculate a trailing stop value for the order that is in the losing direction from the market price at the time of the order's creation. The trailing stop value will follow the market price as it moves in the winning direction, and the order will filled (closing the Trade) by the first price that is equal to or worse than the trailing stop value. A TrailingStopLossOrder cannot be used to open a new Position. properties: id: type: string description: The Order's identifier, unique within the Order's Account. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. createTime: type: string description: The time when the Order was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). state: type: string description: The current state of the Order. enum: - PENDING - FILLED - TRIGGERED - CANCELLED clientExtensions: $ref: '#/definitions/ClientExtensions' type: type: string description: The type of the Order. Always set to "TRAILING_STOP_LOSS" for Trailing Stop Loss Orders. enum: - MARKET - LIMIT - STOP - MARKET_IF_TOUCHED - TAKE_PROFIT - STOP_LOSS - TRAILING_STOP_LOSS - FIXED_PRICE tradeID: type: string description: The ID of the Trade to close when the price threshold is breached. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade to be closed when the price threshold is breached. distance: type: string description: The price distance (in price units) specified for the TrailingStopLoss Order. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time-in-force requested for the TrailingStopLoss Order. Restricted to "GTC", "GFD" and "GTD" for TrailingStopLoss Orders. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date/time when the StopLoss Order will be cancelled if its timeInForce is "GTD". format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). triggerCondition: type: string description: 'Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA''s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order''s trigger condition is set to the default value when indicating the distance from an Order''s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and "BID", and for short trades "DEFAULT" and "ASK" are valid.' enum: - DEFAULT - INVERSE - BID - ASK - MID trailingStopValue: type: string description: The trigger price for the Trailing Stop Loss Order. The trailing stop value will trail (follow) the market price by the TSL order's configured "distance" as the market price moves in the winning direction. If the market price moves to a level that is equal to or worse than the trailing stop value, the order will be filled and the Trade will be closed. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. fillingTransactionID: type: string description: ID of the Transaction that filled this Order (only provided when the Order's state is FILLED) format: String representation of the numerical OANDA-assigned TransactionID filledTime: type: string description: Date/time when the Order was filled (only provided when the Order's state is FILLED) format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). tradeOpenedID: type: string description: Trade ID of Trade opened when the Order was filled (only provided when the Order's state is FILLED and a Trade was opened as a result of the fill) format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. tradeReducedID: type: string description: Trade ID of Trade reduced when the Order was filled (only provided when the Order's state is FILLED and a Trade was reduced as a result of the fill) format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. tradeClosedIDs: type: array description: Trade IDs of Trades closed when the Order was filled (only provided when the Order's state is FILLED and one or more Trades were closed as a result of the fill) items: type: string description: The Trade's identifier, unique within the Trade's Account. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. cancellingTransactionID: type: string description: ID of the Transaction that cancelled the Order (only provided when the Order's state is CANCELLED) format: String representation of the numerical OANDA-assigned TransactionID cancelledTime: type: string description: Date/time when the Order was cancelled (only provided when the state of the Order is CANCELLED) format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). replacesOrderID: type: string description: The ID of the Order that was replaced by this Order (only provided if this Order was created as part of a cancel/replace). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. replacedByOrderID: type: string description: The ID of the Order that replaced this Order (only provided if this Order was cancelled as part of a cancel/replace). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. ClientConfigureRejectTransaction: type: object description: A ClientConfigureRejectTransaction represents the reject of configuration of an Account by a client. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "CLIENT_CONFIGURE_REJECT" in a ClientConfigureRejectTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL alias: type: string description: The client-provided alias for the Account. marginRate: type: string description: The margin rate override for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. rejectReason: type: string description: The reason that the Reject Transaction was created enum: - INTERNAL_SERVER_ERROR - INSTRUMENT_PRICE_UNKNOWN - ACCOUNT_NOT_ACTIVE - ACCOUNT_LOCKED - ACCOUNT_ORDER_CREATION_LOCKED - ACCOUNT_CONFIGURATION_LOCKED - ACCOUNT_DEPOSIT_LOCKED - ACCOUNT_WITHDRAWAL_LOCKED - ACCOUNT_ORDER_CANCEL_LOCKED - INSTRUMENT_NOT_TRADEABLE - PENDING_ORDERS_ALLOWED_EXCEEDED - ORDER_ID_UNSPECIFIED - ORDER_DOESNT_EXIST - ORDER_IDENTIFIER_INCONSISTENCY - TRADE_ID_UNSPECIFIED - TRADE_DOESNT_EXIST - TRADE_IDENTIFIER_INCONSISTENCY - INSUFFICIENT_MARGIN - INSTRUMENT_MISSING - INSTRUMENT_UNKNOWN - UNITS_MISSING - UNITS_INVALID - UNITS_PRECISION_EXCEEDED - UNITS_LIMIT_EXCEEDED - UNITS_MIMIMUM_NOT_MET - PRICE_MISSING - PRICE_INVALID - PRICE_PRECISION_EXCEEDED - PRICE_DISTANCE_MISSING - PRICE_DISTANCE_INVALID - PRICE_DISTANCE_PRECISION_EXCEEDED - PRICE_DISTANCE_MAXIMUM_EXCEEDED - PRICE_DISTANCE_MINIMUM_NOT_MET - TIME_IN_FORCE_MISSING - TIME_IN_FORCE_INVALID - TIME_IN_FORCE_GTD_TIMESTAMP_MISSING - TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST - PRICE_BOUND_INVALID - PRICE_BOUND_PRECISION_EXCEEDED - ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS - TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED - CLIENT_ORDER_ID_INVALID - CLIENT_ORDER_ID_ALREADY_EXISTS - CLIENT_ORDER_TAG_INVALID - CLIENT_ORDER_COMMENT_INVALID - CLIENT_TRADE_ID_INVALID - CLIENT_TRADE_ID_ALREADY_EXISTS - CLIENT_TRADE_TAG_INVALID - CLIENT_TRADE_COMMENT_INVALID - ORDER_FILL_POSITION_ACTION_MISSING - ORDER_FILL_POSITION_ACTION_INVALID - TRIGGER_CONDITION_MISSING - TRIGGER_CONDITION_INVALID - ORDER_PARTIAL_FILL_OPTION_MISSING - ORDER_PARTIAL_FILL_OPTION_INVALID - INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL - TAKE_PROFIT_ORDER_ALREADY_EXISTS - TAKE_PROFIT_ON_FILL_PRICE_MISSING - TAKE_PROFIT_ON_FILL_PRICE_INVALID - TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID - STOP_LOSS_ORDER_ALREADY_EXISTS - STOP_LOSS_ORDER_GUARANTEED_REQUIRED - STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD - STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ORDER_NOT_CANCELABLE - STOP_LOSS_ORDER_NOT_REPLACEABLE - STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER - STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED - STOP_LOSS_ON_FILL_PRICE_MISSING - STOP_LOSS_ON_FILL_PRICE_INVALID - STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_INVALID - STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - CLOSE_TRADE_TYPE_MISSING - CLOSE_TRADE_PARTIAL_UNITS_MISSING - CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE - CLOSEOUT_POSITION_DOESNT_EXIST - CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION - CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE - CLOSEOUT_POSITION_REJECT - CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING - MARKUP_GROUP_ID_INVALID - POSITION_AGGREGATION_MODE_INVALID - ADMIN_CONFIGURE_DATA_MISSING - MARGIN_RATE_INVALID - MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT - ALIAS_INVALID - CLIENT_CONFIGURE_DATA_MISSING - MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL - AMOUNT_INVALID - INSUFFICIENT_FUNDS - AMOUNT_MISSING - FUNDING_REASON_MISSING - CLIENT_EXTENSIONS_DATA_MISSING - REPLACING_ORDER_INVALID - REPLACING_TRADE_ID_INVALID TrailingStopLossOrderTransaction: type: object description: A TrailingStopLossOrderTransaction represents the creation of a TrailingStopLoss Order in the user's Account. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "TRAILING_STOP_LOSS_ORDER" in a TrailingStopLossOrderTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL tradeID: type: string description: The ID of the Trade to close when the price threshold is breached. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade to be closed when the price threshold is breached. distance: type: string description: The price distance (in price units) specified for the TrailingStopLoss Order. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time-in-force requested for the TrailingStopLoss Order. Restricted to "GTC", "GFD" and "GTD" for TrailingStopLoss Orders. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date/time when the StopLoss Order will be cancelled if its timeInForce is "GTD". format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). triggerCondition: type: string description: 'Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA''s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order''s trigger condition is set to the default value when indicating the distance from an Order''s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and "BID", and for short trades "DEFAULT" and "ASK" are valid.' enum: - DEFAULT - INVERSE - BID - ASK - MID reason: type: string description: The reason that the Trailing Stop Loss Order was initiated enum: - CLIENT_ORDER - REPLACEMENT - ON_FILL clientExtensions: $ref: '#/definitions/ClientExtensions' orderFillTransactionID: type: string description: The ID of the OrderFill Transaction that caused this Order to be created (only provided if this Order was created automatically when another Order was filled). format: String representation of the numerical OANDA-assigned TransactionID replacesOrderID: type: string description: The ID of the Order that this Order replaces (only provided if this Order replaces an existing Order). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. cancellingTransactionID: type: string description: The ID of the Transaction that cancels the replaced Order (only provided if this Order replaces an existing Order). format: String representation of the numerical OANDA-assigned TransactionID StopLossOrderTransaction: type: object description: A StopLossOrderTransaction represents the creation of a StopLoss Order in the user's Account. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "STOP_LOSS_ORDER" in a StopLossOrderTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL tradeID: type: string description: The ID of the Trade to close when the price threshold is breached. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade to be closed when the price threshold is breached. price: type: string description: The price threshold specified for the Stop Loss Order. If the guaranteed flag is false, the associated Trade will be closed by a market price that is equal to or worse than this threshold. If the flag is true the associated Trade will be closed at this price. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. distance: type: string description: Specifies the distance (in price units) from the Account's current price to use as the Stop Loss Order price. If the Trade is short the Instrument's bid price is used, and for long Trades the ask is used. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time-in-force requested for the StopLoss Order. Restricted to "GTC", "GFD" and "GTD" for StopLoss Orders. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date/time when the StopLoss Order will be cancelled if its timeInForce is "GTD". format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). triggerCondition: type: string description: 'Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA''s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order''s trigger condition is set to the default value when indicating the distance from an Order''s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and "BID", and for short trades "DEFAULT" and "ASK" are valid.' enum: - DEFAULT - INVERSE - BID - ASK - MID guaranteed: type: boolean description: Flag indicating that the Stop Loss Order is guaranteed. The default value depends on the GuaranteedStopLossOrderMode of the account, if it is REQUIRED, the default will be true, for DISABLED or ENABLED the default is false. guaranteedExecutionPremium: type: string description: The fee that will be charged if the Stop Loss Order is guaranteed and the Order is filled at the guaranteed price. The value is determined at Order creation time. It is in price units and is charged for each unit of the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. reason: type: string description: The reason that the Stop Loss Order was initiated enum: - CLIENT_ORDER - REPLACEMENT - ON_FILL clientExtensions: $ref: '#/definitions/ClientExtensions' orderFillTransactionID: type: string description: The ID of the OrderFill Transaction that caused this Order to be created (only provided if this Order was created automatically when another Order was filled). format: String representation of the numerical OANDA-assigned TransactionID replacesOrderID: type: string description: The ID of the Order that this Order replaces (only provided if this Order replaces an existing Order). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. cancellingTransactionID: type: string description: The ID of the Transaction that cancels the replaced Order (only provided if this Order replaces an existing Order). format: String representation of the numerical OANDA-assigned TransactionID TradeClientExtensionsModifyRejectTransaction: type: object description: A TradeClientExtensionsModifyRejectTransaction represents the rejection of the modification of a Trade's Client Extensions. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT" for a TradeClientExtensionsModifyRejectTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL tradeID: type: string description: The ID of the Trade who's client extensions are to be modified. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The original Client ID of the Trade who's client extensions are to be modified. tradeClientExtensionsModify: $ref: '#/definitions/ClientExtensions' rejectReason: type: string description: The reason that the Reject Transaction was created enum: - INTERNAL_SERVER_ERROR - INSTRUMENT_PRICE_UNKNOWN - ACCOUNT_NOT_ACTIVE - ACCOUNT_LOCKED - ACCOUNT_ORDER_CREATION_LOCKED - ACCOUNT_CONFIGURATION_LOCKED - ACCOUNT_DEPOSIT_LOCKED - ACCOUNT_WITHDRAWAL_LOCKED - ACCOUNT_ORDER_CANCEL_LOCKED - INSTRUMENT_NOT_TRADEABLE - PENDING_ORDERS_ALLOWED_EXCEEDED - ORDER_ID_UNSPECIFIED - ORDER_DOESNT_EXIST - ORDER_IDENTIFIER_INCONSISTENCY - TRADE_ID_UNSPECIFIED - TRADE_DOESNT_EXIST - TRADE_IDENTIFIER_INCONSISTENCY - INSUFFICIENT_MARGIN - INSTRUMENT_MISSING - INSTRUMENT_UNKNOWN - UNITS_MISSING - UNITS_INVALID - UNITS_PRECISION_EXCEEDED - UNITS_LIMIT_EXCEEDED - UNITS_MIMIMUM_NOT_MET - PRICE_MISSING - PRICE_INVALID - PRICE_PRECISION_EXCEEDED - PRICE_DISTANCE_MISSING - PRICE_DISTANCE_INVALID - PRICE_DISTANCE_PRECISION_EXCEEDED - PRICE_DISTANCE_MAXIMUM_EXCEEDED - PRICE_DISTANCE_MINIMUM_NOT_MET - TIME_IN_FORCE_MISSING - TIME_IN_FORCE_INVALID - TIME_IN_FORCE_GTD_TIMESTAMP_MISSING - TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST - PRICE_BOUND_INVALID - PRICE_BOUND_PRECISION_EXCEEDED - ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS - TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED - CLIENT_ORDER_ID_INVALID - CLIENT_ORDER_ID_ALREADY_EXISTS - CLIENT_ORDER_TAG_INVALID - CLIENT_ORDER_COMMENT_INVALID - CLIENT_TRADE_ID_INVALID - CLIENT_TRADE_ID_ALREADY_EXISTS - CLIENT_TRADE_TAG_INVALID - CLIENT_TRADE_COMMENT_INVALID - ORDER_FILL_POSITION_ACTION_MISSING - ORDER_FILL_POSITION_ACTION_INVALID - TRIGGER_CONDITION_MISSING - TRIGGER_CONDITION_INVALID - ORDER_PARTIAL_FILL_OPTION_MISSING - ORDER_PARTIAL_FILL_OPTION_INVALID - INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL - TAKE_PROFIT_ORDER_ALREADY_EXISTS - TAKE_PROFIT_ON_FILL_PRICE_MISSING - TAKE_PROFIT_ON_FILL_PRICE_INVALID - TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID - STOP_LOSS_ORDER_ALREADY_EXISTS - STOP_LOSS_ORDER_GUARANTEED_REQUIRED - STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD - STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ORDER_NOT_CANCELABLE - STOP_LOSS_ORDER_NOT_REPLACEABLE - STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER - STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED - STOP_LOSS_ON_FILL_PRICE_MISSING - STOP_LOSS_ON_FILL_PRICE_INVALID - STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_INVALID - STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - CLOSE_TRADE_TYPE_MISSING - CLOSE_TRADE_PARTIAL_UNITS_MISSING - CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE - CLOSEOUT_POSITION_DOESNT_EXIST - CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION - CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE - CLOSEOUT_POSITION_REJECT - CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING - MARKUP_GROUP_ID_INVALID - POSITION_AGGREGATION_MODE_INVALID - ADMIN_CONFIGURE_DATA_MISSING - MARGIN_RATE_INVALID - MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT - ALIAS_INVALID - CLIENT_CONFIGURE_DATA_MISSING - MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL - AMOUNT_INVALID - INSUFFICIENT_FUNDS - AMOUNT_MISSING - FUNDING_REASON_MISSING - CLIENT_EXTENSIONS_DATA_MISSING - REPLACING_ORDER_INVALID - REPLACING_TRADE_ID_INVALID TradeSummary: type: object description: The summary of a Trade within an Account. This representation does not provide the full details of the Trade's dependent Orders. properties: id: type: string description: The Trade's identifier, unique within the Trade's Account. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. instrument: type: string description: The Trade's Instrument. format: A string containing the base currency and quote currency delimited by a "_". price: type: string description: The execution price of the Trade. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. openTime: type: string description: The date/time when the Trade was opened. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). state: type: string description: The current state of the Trade. enum: - OPEN - CLOSED - CLOSE_WHEN_TRADEABLE initialUnits: type: string description: The initial size of the Trade. Negative values indicate a short Trade, and positive values indicate a long Trade. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. initialMarginRequired: type: string description: The margin required at the time the Trade was created. Note, this is the 'pure' margin required, it is not the 'effective' margin used that factors in the trade risk if a GSLO is attached to the trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. currentUnits: type: string description: The number of units currently open for the Trade. This value is reduced to 0.0 as the Trade is closed. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. realizedPL: type: string description: The total profit/loss realized on the closed portion of the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. unrealizedPL: type: string description: The unrealized profit/loss on the open portion of the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginUsed: type: string description: Margin currently used by the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. averageClosePrice: type: string description: The average closing price of the Trade. Only present if the Trade has been closed or reduced at least once. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. closingTransactionIDs: type: array description: The IDs of the Transactions that have closed portions of this Trade. items: type: string description: The unique Transaction identifier within each Account. format: String representation of the numerical OANDA-assigned TransactionID financing: type: string description: The financing paid/collected for this Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. closeTime: type: string description: The date/time when the Trade was fully closed. Only provided for Trades whose state is CLOSED. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). clientExtensions: $ref: '#/definitions/ClientExtensions' takeProfitOrderID: type: string description: ID of the Trade's Take Profit Order, only provided if such an Order exists. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. stopLossOrderID: type: string description: ID of the Trade's Stop Loss Order, only provided if such an Order exists. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. trailingStopLossOrderID: type: string description: ID of the Trade's Trailing Stop Loss Order, only provided if such an Order exists. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. TradeClientExtensionsModifyTransaction: type: object description: A TradeClientExtensionsModifyTransaction represents the modification of a Trade's Client Extensions. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "TRADE_CLIENT_EXTENSIONS_MODIFY" for a TradeClientExtensionsModifyTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL tradeID: type: string description: The ID of the Trade who's client extensions are to be modified. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The original Client ID of the Trade who's client extensions are to be modified. tradeClientExtensionsModify: $ref: '#/definitions/ClientExtensions' Transaction: type: object description: The base Transaction specification. Specifies properties that are common between all Transaction. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. CalculatedTradeState: type: object description: The dynamic (calculated) state of an open Trade properties: id: type: string description: The Trade's ID. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. unrealizedPL: type: string description: The Trade's unrealized profit/loss. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginUsed: type: string description: Margin currently used by the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. ClientExtensions: type: object description: A ClientExtensions object allows a client to attach a clientID, tag and comment to Orders and Trades in their Account. Do not set, modify, or delete this field if your account is associated with MT4. properties: id: type: string description: The Client ID of the Order/Trade tag: type: string description: A tag associated with the Order/Trade comment: type: string description: A comment associated with the Order/Trade AccountChangesState: type: object description: An AccountState Object is used to represent an Account's current price-dependent state. Price-dependent Account state is dependent on OANDA's current Prices, and includes things like unrealized PL, NAV and Trailing Stop Loss Order state. properties: unrealizedPL: type: string description: The total unrealized profit/loss for all Trades currently open in the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. NAV: type: string description: The net asset value of the Account. Equal to Account balance + unrealizedPL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginUsed: type: string description: Margin currently used for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginAvailable: type: string description: Margin available for Account currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. positionValue: type: string description: The value of the Account's open positions represented in the Account's home currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutUnrealizedPL: type: string description: The Account's margin closeout unrealized PL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutNAV: type: string description: The Account's margin closeout NAV. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutMarginUsed: type: string description: The Account's margin closeout margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutPercent: type: string description: The Account's margin closeout percentage. When this value is 1.0 or above the Account is in a margin closeout situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. marginCloseoutPositionValue: type: string description: The value of the Account's open positions as used for margin closeout calculations represented in the Account's home currency. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. withdrawalLimit: type: string description: The current WithdrawalLimit for the account which will be zero or a positive value indicating how much can be withdrawn from the account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCallMarginUsed: type: string description: The Account's margin call margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCallPercent: type: string description: The Account's margin call percentage. When this value is 1.0 or above the Account is in a margin call situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. orders: type: array description: The price-dependent state of each pending Order in the Account. items: $ref: '#/definitions/DynamicOrderState' trades: type: array description: The price-dependent state for each open Trade in the Account. items: $ref: '#/definitions/CalculatedTradeState' positions: type: array description: The price-dependent state for each open Position in the Account. items: $ref: '#/definitions/CalculatedPositionState' CalculatedPositionState: type: object description: The dynamic (calculated) state of a Position properties: instrument: type: string description: The Position's Instrument. format: A string containing the base currency and quote currency delimited by a "_". netUnrealizedPL: type: string description: The Position's net unrealized profit/loss format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. longUnrealizedPL: type: string description: The unrealized profit/loss of the Position's long open Trades format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. shortUnrealizedPL: type: string description: The unrealized profit/loss of the Position's short open Trades format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginUsed: type: string description: Margin currently used by the Position. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. QuoteHomeConversionFactors: type: object description: QuoteHomeConversionFactors represents the factors that can be used used to convert quantities of a Price's Instrument's quote currency into the Account's home currency. properties: positiveUnits: type: string description: The factor used to convert a positive amount of the Price's Instrument's quote currency into a positive amount of the Account's home currency. Conversion is performed by multiplying the quote units by the conversion factor. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. negativeUnits: type: string description: The factor used to convert a negative amount of the Price's Instrument's quote currency into a negative amount of the Account's home currency. Conversion is performed by multiplying the quote units by the conversion factor. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. MarketOrderTradeClose: type: object description: A MarketOrderTradeClose specifies the extensions to a Market Order that has been created specifically to close a Trade. properties: tradeID: type: string description: The ID of the Trade requested to be closed format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade requested to be closed units: type: string description: Indication of how much of the Trade to close. Either "ALL", or a DecimalNumber reflection a partial close of the Trade. Order: type: object description: The base Order definition specifies the properties that are common to all Orders. properties: id: type: string description: The Order's identifier, unique within the Order's Account. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. createTime: type: string description: The time when the Order was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). state: type: string description: The current state of the Order. enum: - PENDING - FILLED - TRIGGERED - CANCELLED clientExtensions: $ref: '#/definitions/ClientExtensions' Candlestick: type: object description: The Candlestick representation properties: time: type: string description: The start time of the candlestick format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). bid: $ref: '#/definitions/CandlestickData' ask: $ref: '#/definitions/CandlestickData' mid: $ref: '#/definitions/CandlestickData' volume: type: integer description: The number of prices created during the time-range represented by the candlestick. complete: type: boolean description: A flag indicating if the candlestick is complete. A complete candlestick is one whose ending time is not in the future. TakeProfitOrderRejectTransaction: type: object description: A TakeProfitOrderRejectTransaction represents the rejection of the creation of a TakeProfit Order. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "TAKE_PROFIT_ORDER_REJECT" in a TakeProfitOrderRejectTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL tradeID: type: string description: The ID of the Trade to close when the price threshold is breached. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade to be closed when the price threshold is breached. price: type: string description: The price threshold specified for the TakeProfit Order. The associated Trade will be closed by a market price that is equal to or better than this threshold. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. timeInForce: type: string description: The time-in-force requested for the TakeProfit Order. Restricted to "GTC", "GFD" and "GTD" for TakeProfit Orders. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date/time when the TakeProfit Order will be cancelled if its timeInForce is "GTD". format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). triggerCondition: type: string description: 'Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA''s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order''s trigger condition is set to the default value when indicating the distance from an Order''s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and "BID", and for short trades "DEFAULT" and "ASK" are valid.' enum: - DEFAULT - INVERSE - BID - ASK - MID reason: type: string description: The reason that the Take Profit Order was initiated enum: - CLIENT_ORDER - REPLACEMENT - ON_FILL clientExtensions: $ref: '#/definitions/ClientExtensions' orderFillTransactionID: type: string description: The ID of the OrderFill Transaction that caused this Order to be created (only provided if this Order was created automatically when another Order was filled). format: String representation of the numerical OANDA-assigned TransactionID intendedReplacesOrderID: type: string description: The ID of the Order that this Order was intended to replace (only provided if this Order was intended to replace an existing Order). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. rejectReason: type: string description: The reason that the Reject Transaction was created enum: - INTERNAL_SERVER_ERROR - INSTRUMENT_PRICE_UNKNOWN - ACCOUNT_NOT_ACTIVE - ACCOUNT_LOCKED - ACCOUNT_ORDER_CREATION_LOCKED - ACCOUNT_CONFIGURATION_LOCKED - ACCOUNT_DEPOSIT_LOCKED - ACCOUNT_WITHDRAWAL_LOCKED - ACCOUNT_ORDER_CANCEL_LOCKED - INSTRUMENT_NOT_TRADEABLE - PENDING_ORDERS_ALLOWED_EXCEEDED - ORDER_ID_UNSPECIFIED - ORDER_DOESNT_EXIST - ORDER_IDENTIFIER_INCONSISTENCY - TRADE_ID_UNSPECIFIED - TRADE_DOESNT_EXIST - TRADE_IDENTIFIER_INCONSISTENCY - INSUFFICIENT_MARGIN - INSTRUMENT_MISSING - INSTRUMENT_UNKNOWN - UNITS_MISSING - UNITS_INVALID - UNITS_PRECISION_EXCEEDED - UNITS_LIMIT_EXCEEDED - UNITS_MIMIMUM_NOT_MET - PRICE_MISSING - PRICE_INVALID - PRICE_PRECISION_EXCEEDED - PRICE_DISTANCE_MISSING - PRICE_DISTANCE_INVALID - PRICE_DISTANCE_PRECISION_EXCEEDED - PRICE_DISTANCE_MAXIMUM_EXCEEDED - PRICE_DISTANCE_MINIMUM_NOT_MET - TIME_IN_FORCE_MISSING - TIME_IN_FORCE_INVALID - TIME_IN_FORCE_GTD_TIMESTAMP_MISSING - TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST - PRICE_BOUND_INVALID - PRICE_BOUND_PRECISION_EXCEEDED - ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS - TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED - CLIENT_ORDER_ID_INVALID - CLIENT_ORDER_ID_ALREADY_EXISTS - CLIENT_ORDER_TAG_INVALID - CLIENT_ORDER_COMMENT_INVALID - CLIENT_TRADE_ID_INVALID - CLIENT_TRADE_ID_ALREADY_EXISTS - CLIENT_TRADE_TAG_INVALID - CLIENT_TRADE_COMMENT_INVALID - ORDER_FILL_POSITION_ACTION_MISSING - ORDER_FILL_POSITION_ACTION_INVALID - TRIGGER_CONDITION_MISSING - TRIGGER_CONDITION_INVALID - ORDER_PARTIAL_FILL_OPTION_MISSING - ORDER_PARTIAL_FILL_OPTION_INVALID - INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL - TAKE_PROFIT_ORDER_ALREADY_EXISTS - TAKE_PROFIT_ON_FILL_PRICE_MISSING - TAKE_PROFIT_ON_FILL_PRICE_INVALID - TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID - STOP_LOSS_ORDER_ALREADY_EXISTS - STOP_LOSS_ORDER_GUARANTEED_REQUIRED - STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD - STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ORDER_NOT_CANCELABLE - STOP_LOSS_ORDER_NOT_REPLACEABLE - STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER - STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED - STOP_LOSS_ON_FILL_PRICE_MISSING - STOP_LOSS_ON_FILL_PRICE_INVALID - STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_INVALID - STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - CLOSE_TRADE_TYPE_MISSING - CLOSE_TRADE_PARTIAL_UNITS_MISSING - CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE - CLOSEOUT_POSITION_DOESNT_EXIST - CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION - CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE - CLOSEOUT_POSITION_REJECT - CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING - MARKUP_GROUP_ID_INVALID - POSITION_AGGREGATION_MODE_INVALID - ADMIN_CONFIGURE_DATA_MISSING - MARGIN_RATE_INVALID - MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT - ALIAS_INVALID - CLIENT_CONFIGURE_DATA_MISSING - MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL - AMOUNT_INVALID - INSUFFICIENT_FUNDS - AMOUNT_MISSING - FUNDING_REASON_MISSING - CLIENT_EXTENSIONS_DATA_MISSING - REPLACING_ORDER_INVALID - REPLACING_TRADE_ID_INVALID DynamicOrderState: type: object description: The dynamic state of an Order. This is only relevant to TrailingStopLoss Orders, as no other Order type has dynamic state. properties: id: type: string description: The Order's ID. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. trailingStopValue: type: string description: The Order's calculated trailing stop value. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. triggerDistance: type: string description: The distance between the Trailing Stop Loss Order's trailingStopValue and the current Market Price. This represents the distance (in price units) of the Order from a triggering price. If the distance could not be determined, this value will not be set. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. isTriggerDistanceExact: type: boolean description: True if an exact trigger distance could be calculated. If false, it means the provided trigger distance is a best estimate. If the distance could not be determined, this value will not be set. Position: type: object description: The specification of a Position within an Account. properties: instrument: type: string description: The Position's Instrument. format: A string containing the base currency and quote currency delimited by a "_". pl: type: string description: Profit/loss realized by the Position over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. unrealizedPL: type: string description: The unrealized profit/loss of all open Trades that contribute to this Position. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginUsed: type: string description: Margin currently used by the Position. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. resettablePL: type: string description: Profit/loss realized by the Position since the Account's resettablePL was last reset by the client. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. financing: type: string description: The total amount of financing paid/collected for this instrument over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. commission: type: string description: The total amount of commission paid for this instrument over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. guaranteedExecutionFees: type: string description: The total amount of fees charged over the lifetime of the Account for the execution of guaranteed Stop Loss Orders for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. long: $ref: '#/definitions/PositionSide' short: $ref: '#/definitions/PositionSide' TransactionHeartbeat: type: object description: A TransactionHeartbeat object is injected into the Transaction stream to ensure that the HTTP connection remains active. properties: type: type: string description: The string "HEARTBEAT" lastTransactionID: type: string description: The ID of the most recent Transaction created for the Account format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the TransactionHeartbeat was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). OrderClientExtensionsModifyRejectTransaction: type: object description: A OrderClientExtensionsModifyRejectTransaction represents the rejection of the modification of an Order's Client Extensions. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT" for a OrderClientExtensionsModifyRejectTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL orderID: type: string description: The ID of the Order who's client extensions are to be modified. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. clientOrderID: type: string description: The original Client ID of the Order who's client extensions are to be modified. clientExtensionsModify: $ref: '#/definitions/ClientExtensions' tradeClientExtensionsModify: $ref: '#/definitions/ClientExtensions' rejectReason: type: string description: The reason that the Reject Transaction was created enum: - INTERNAL_SERVER_ERROR - INSTRUMENT_PRICE_UNKNOWN - ACCOUNT_NOT_ACTIVE - ACCOUNT_LOCKED - ACCOUNT_ORDER_CREATION_LOCKED - ACCOUNT_CONFIGURATION_LOCKED - ACCOUNT_DEPOSIT_LOCKED - ACCOUNT_WITHDRAWAL_LOCKED - ACCOUNT_ORDER_CANCEL_LOCKED - INSTRUMENT_NOT_TRADEABLE - PENDING_ORDERS_ALLOWED_EXCEEDED - ORDER_ID_UNSPECIFIED - ORDER_DOESNT_EXIST - ORDER_IDENTIFIER_INCONSISTENCY - TRADE_ID_UNSPECIFIED - TRADE_DOESNT_EXIST - TRADE_IDENTIFIER_INCONSISTENCY - INSUFFICIENT_MARGIN - INSTRUMENT_MISSING - INSTRUMENT_UNKNOWN - UNITS_MISSING - UNITS_INVALID - UNITS_PRECISION_EXCEEDED - UNITS_LIMIT_EXCEEDED - UNITS_MIMIMUM_NOT_MET - PRICE_MISSING - PRICE_INVALID - PRICE_PRECISION_EXCEEDED - PRICE_DISTANCE_MISSING - PRICE_DISTANCE_INVALID - PRICE_DISTANCE_PRECISION_EXCEEDED - PRICE_DISTANCE_MAXIMUM_EXCEEDED - PRICE_DISTANCE_MINIMUM_NOT_MET - TIME_IN_FORCE_MISSING - TIME_IN_FORCE_INVALID - TIME_IN_FORCE_GTD_TIMESTAMP_MISSING - TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST - PRICE_BOUND_INVALID - PRICE_BOUND_PRECISION_EXCEEDED - ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS - TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED - CLIENT_ORDER_ID_INVALID - CLIENT_ORDER_ID_ALREADY_EXISTS - CLIENT_ORDER_TAG_INVALID - CLIENT_ORDER_COMMENT_INVALID - CLIENT_TRADE_ID_INVALID - CLIENT_TRADE_ID_ALREADY_EXISTS - CLIENT_TRADE_TAG_INVALID - CLIENT_TRADE_COMMENT_INVALID - ORDER_FILL_POSITION_ACTION_MISSING - ORDER_FILL_POSITION_ACTION_INVALID - TRIGGER_CONDITION_MISSING - TRIGGER_CONDITION_INVALID - ORDER_PARTIAL_FILL_OPTION_MISSING - ORDER_PARTIAL_FILL_OPTION_INVALID - INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL - TAKE_PROFIT_ORDER_ALREADY_EXISTS - TAKE_PROFIT_ON_FILL_PRICE_MISSING - TAKE_PROFIT_ON_FILL_PRICE_INVALID - TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID - STOP_LOSS_ORDER_ALREADY_EXISTS - STOP_LOSS_ORDER_GUARANTEED_REQUIRED - STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD - STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ORDER_NOT_CANCELABLE - STOP_LOSS_ORDER_NOT_REPLACEABLE - STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER - STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED - STOP_LOSS_ON_FILL_PRICE_MISSING - STOP_LOSS_ON_FILL_PRICE_INVALID - STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_INVALID - STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - CLOSE_TRADE_TYPE_MISSING - CLOSE_TRADE_PARTIAL_UNITS_MISSING - CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE - CLOSEOUT_POSITION_DOESNT_EXIST - CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION - CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE - CLOSEOUT_POSITION_REJECT - CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING - MARKUP_GROUP_ID_INVALID - POSITION_AGGREGATION_MODE_INVALID - ADMIN_CONFIGURE_DATA_MISSING - MARGIN_RATE_INVALID - MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT - ALIAS_INVALID - CLIENT_CONFIGURE_DATA_MISSING - MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL - AMOUNT_INVALID - INSUFFICIENT_FUNDS - AMOUNT_MISSING - FUNDING_REASON_MISSING - CLIENT_EXTENSIONS_DATA_MISSING - REPLACING_ORDER_INVALID - REPLACING_TRADE_ID_INVALID OrderClientExtensionsModifyTransaction: type: object description: A OrderClientExtensionsModifyTransaction represents the modification of an Order's Client Extensions. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "ORDER_CLIENT_EXTENSIONS_MODIFY" for a OrderClienteExtensionsModifyTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL orderID: type: string description: The ID of the Order who's client extensions are to be modified. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. clientOrderID: type: string description: The original Client ID of the Order who's client extensions are to be modified. clientExtensionsModify: $ref: '#/definitions/ClientExtensions' tradeClientExtensionsModify: $ref: '#/definitions/ClientExtensions' MarketOrderDelayedTradeClose: type: object description: Details for the Market Order extensions specific to a Market Order placed with the intent of fully closing a specific open trade that should have already been closed but wasn't due to halted market conditions properties: tradeID: type: string description: The ID of the Trade being closed format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The Client ID of the Trade being closed format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. sourceTransactionID: type: string description: The Transaction ID of the DelayedTradeClosure transaction to which this Delayed Trade Close belongs to format: String representation of the numerical OANDA-assigned TransactionID TrailingStopLossOrderRejectTransaction: type: object description: A TrailingStopLossOrderRejectTransaction represents the rejection of the creation of a TrailingStopLoss Order. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "TRAILING_STOP_LOSS_ORDER_REJECT" in a TrailingStopLossOrderRejectTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL tradeID: type: string description: The ID of the Trade to close when the price threshold is breached. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade to be closed when the price threshold is breached. distance: type: string description: The price distance (in price units) specified for the TrailingStopLoss Order. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time-in-force requested for the TrailingStopLoss Order. Restricted to "GTC", "GFD" and "GTD" for TrailingStopLoss Orders. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date/time when the StopLoss Order will be cancelled if its timeInForce is "GTD". format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). triggerCondition: type: string description: 'Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA''s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order''s trigger condition is set to the default value when indicating the distance from an Order''s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and "BID", and for short trades "DEFAULT" and "ASK" are valid.' enum: - DEFAULT - INVERSE - BID - ASK - MID reason: type: string description: The reason that the Trailing Stop Loss Order was initiated enum: - CLIENT_ORDER - REPLACEMENT - ON_FILL clientExtensions: $ref: '#/definitions/ClientExtensions' orderFillTransactionID: type: string description: The ID of the OrderFill Transaction that caused this Order to be created (only provided if this Order was created automatically when another Order was filled). format: String representation of the numerical OANDA-assigned TransactionID intendedReplacesOrderID: type: string description: The ID of the Order that this Order was intended to replace (only provided if this Order was intended to replace an existing Order). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. rejectReason: type: string description: The reason that the Reject Transaction was created enum: - INTERNAL_SERVER_ERROR - INSTRUMENT_PRICE_UNKNOWN - ACCOUNT_NOT_ACTIVE - ACCOUNT_LOCKED - ACCOUNT_ORDER_CREATION_LOCKED - ACCOUNT_CONFIGURATION_LOCKED - ACCOUNT_DEPOSIT_LOCKED - ACCOUNT_WITHDRAWAL_LOCKED - ACCOUNT_ORDER_CANCEL_LOCKED - INSTRUMENT_NOT_TRADEABLE - PENDING_ORDERS_ALLOWED_EXCEEDED - ORDER_ID_UNSPECIFIED - ORDER_DOESNT_EXIST - ORDER_IDENTIFIER_INCONSISTENCY - TRADE_ID_UNSPECIFIED - TRADE_DOESNT_EXIST - TRADE_IDENTIFIER_INCONSISTENCY - INSUFFICIENT_MARGIN - INSTRUMENT_MISSING - INSTRUMENT_UNKNOWN - UNITS_MISSING - UNITS_INVALID - UNITS_PRECISION_EXCEEDED - UNITS_LIMIT_EXCEEDED - UNITS_MIMIMUM_NOT_MET - PRICE_MISSING - PRICE_INVALID - PRICE_PRECISION_EXCEEDED - PRICE_DISTANCE_MISSING - PRICE_DISTANCE_INVALID - PRICE_DISTANCE_PRECISION_EXCEEDED - PRICE_DISTANCE_MAXIMUM_EXCEEDED - PRICE_DISTANCE_MINIMUM_NOT_MET - TIME_IN_FORCE_MISSING - TIME_IN_FORCE_INVALID - TIME_IN_FORCE_GTD_TIMESTAMP_MISSING - TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST - PRICE_BOUND_INVALID - PRICE_BOUND_PRECISION_EXCEEDED - ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS - TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED - CLIENT_ORDER_ID_INVALID - CLIENT_ORDER_ID_ALREADY_EXISTS - CLIENT_ORDER_TAG_INVALID - CLIENT_ORDER_COMMENT_INVALID - CLIENT_TRADE_ID_INVALID - CLIENT_TRADE_ID_ALREADY_EXISTS - CLIENT_TRADE_TAG_INVALID - CLIENT_TRADE_COMMENT_INVALID - ORDER_FILL_POSITION_ACTION_MISSING - ORDER_FILL_POSITION_ACTION_INVALID - TRIGGER_CONDITION_MISSING - TRIGGER_CONDITION_INVALID - ORDER_PARTIAL_FILL_OPTION_MISSING - ORDER_PARTIAL_FILL_OPTION_INVALID - INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL - TAKE_PROFIT_ORDER_ALREADY_EXISTS - TAKE_PROFIT_ON_FILL_PRICE_MISSING - TAKE_PROFIT_ON_FILL_PRICE_INVALID - TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID - STOP_LOSS_ORDER_ALREADY_EXISTS - STOP_LOSS_ORDER_GUARANTEED_REQUIRED - STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD - STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ORDER_NOT_CANCELABLE - STOP_LOSS_ORDER_NOT_REPLACEABLE - STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER - STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED - STOP_LOSS_ON_FILL_PRICE_MISSING - STOP_LOSS_ON_FILL_PRICE_INVALID - STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_INVALID - STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - CLOSE_TRADE_TYPE_MISSING - CLOSE_TRADE_PARTIAL_UNITS_MISSING - CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE - CLOSEOUT_POSITION_DOESNT_EXIST - CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION - CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE - CLOSEOUT_POSITION_REJECT - CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING - MARKUP_GROUP_ID_INVALID - POSITION_AGGREGATION_MODE_INVALID - ADMIN_CONFIGURE_DATA_MISSING - MARGIN_RATE_INVALID - MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT - ALIAS_INVALID - CLIENT_CONFIGURE_DATA_MISSING - MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL - AMOUNT_INVALID - INSUFFICIENT_FUNDS - AMOUNT_MISSING - FUNDING_REASON_MISSING - CLIENT_EXTENSIONS_DATA_MISSING - REPLACING_ORDER_INVALID - REPLACING_TRADE_ID_INVALID UnitsAvailable: type: object description: Representation of how many units of an Instrument are available to be traded by an Order depending on its postionFill option. properties: default: $ref: '#/definitions/UnitsAvailableDetails' reduceFirst: $ref: '#/definitions/UnitsAvailableDetails' reduceOnly: $ref: '#/definitions/UnitsAvailableDetails' openOnly: $ref: '#/definitions/UnitsAvailableDetails' TradeOpen: type: object description: A TradeOpen object represents a Trade for an instrument that was opened in an Account. It is found embedded in Transactions that affect the position of an instrument in the Account, specifically the OrderFill Transaction. properties: tradeID: type: string description: The ID of the Trade that was opened format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. units: type: string description: The number of units opened by the Trade format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. price: type: string description: The average price that the units were opened at. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. guaranteedExecutionFee: type: string description: This is the fee charged for opening the trade if it has a guaranteed Stop Loss Order attached to it. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. clientExtensions: $ref: '#/definitions/ClientExtensions' halfSpreadCost: type: string description: The half spread cost for the trade open. This can be a positive or negative value and is represented in the home currency of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. initialMarginRequired: type: string description: The margin required at the time the Trade was created. Note, this is the 'pure' margin required, it is not the 'effective' margin used that factors in the trade risk if a GSLO is attached to the trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. TrailingStopLossDetails: type: object description: TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Trailing Stop Loss, or when a Trade's dependent Trailing Stop Loss Order is modified directly through the Trade. properties: distance: type: string description: The distance (in price units) from the Trade's fill price that the Trailing Stop Loss Order will be triggered at. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time in force for the created Trailing Stop Loss Order. This may only be GTC, GTD or GFD. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date when the Trailing Stop Loss Order will be cancelled on if timeInForce is GTD. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). clientExtensions: $ref: '#/definitions/ClientExtensions' TakeProfitOrderTransaction: type: object description: A TakeProfitOrderTransaction represents the creation of a TakeProfit Order in the user's Account. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "TAKE_PROFIT_ORDER" in a TakeProfitOrderTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL tradeID: type: string description: The ID of the Trade to close when the price threshold is breached. format: The string representation of the OANDA-assigned TradeID. OANDA-assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade. clientTradeID: type: string description: The client ID of the Trade to be closed when the price threshold is breached. price: type: string description: The price threshold specified for the TakeProfit Order. The associated Trade will be closed by a market price that is equal to or better than this threshold. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. timeInForce: type: string description: The time-in-force requested for the TakeProfit Order. Restricted to "GTC", "GFD" and "GTD" for TakeProfit Orders. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date/time when the TakeProfit Order will be cancelled if its timeInForce is "GTD". format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). triggerCondition: type: string description: 'Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA''s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order''s trigger condition is set to the default value when indicating the distance from an Order''s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and "BID", and for short trades "DEFAULT" and "ASK" are valid.' enum: - DEFAULT - INVERSE - BID - ASK - MID reason: type: string description: The reason that the Take Profit Order was initiated enum: - CLIENT_ORDER - REPLACEMENT - ON_FILL clientExtensions: $ref: '#/definitions/ClientExtensions' orderFillTransactionID: type: string description: The ID of the OrderFill Transaction that caused this Order to be created (only provided if this Order was created automatically when another Order was filled). format: String representation of the numerical OANDA-assigned TransactionID replacesOrderID: type: string description: The ID of the Order that this Order replaces (only provided if this Order replaces an existing Order). format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. cancellingTransactionID: type: string description: The ID of the Transaction that cancels the replaced Order (only provided if this Order replaces an existing Order). format: String representation of the numerical OANDA-assigned TransactionID StopLossDetails: type: object description: StopLossDetails specifies the details of a Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Stop Loss, or when a Trade's dependent Stop Loss Order is modified directly through the Trade. properties: price: type: string description: The price that the Stop Loss Order will be triggered at. Only one of the price and distance fields may be specified. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. distance: type: string description: Specifies the distance (in price units) from the Trade's open price to use as the Stop Loss Order price. Only one of the distance and price fields may be specified. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time in force for the created Stop Loss Order. This may only be GTC, GTD or GFD. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date when the Stop Loss Order will be cancelled on if timeInForce is GTD. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). clientExtensions: $ref: '#/definitions/ClientExtensions' guaranteed: type: boolean description: Flag indicating that the price for the Stop Loss Order is guaranteed. The default value depends on the GuaranteedStopLossOrderMode of the account, if it is REQUIRED, the default will be true, for DISABLED or ENABLED the default is false. MarketOrderPositionCloseout: type: object description: A MarketOrderPositionCloseout specifies the extensions to a Market Order when it has been created to closeout a specific Position. properties: instrument: type: string description: The instrument of the Position being closed out. format: A string containing the base currency and quote currency delimited by a "_". units: type: string description: Indication of how much of the Position to close. Either "ALL", or a DecimalNumber reflection a partial close of the Trade. The DecimalNumber must always be positive, and represent a number that doesn't exceed the absolute size of the Position. MarketOrderRejectTransaction: type: object description: A MarketOrderRejectTransaction represents the rejection of the creation of a Market Order. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "MARKET_ORDER_REJECT" in a MarketOrderRejectTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL instrument: type: string description: The Market Order's Instrument. format: A string containing the base currency and quote currency delimited by a "_". units: type: string description: The quantity requested to be filled by the Market Order. A posititive number of units results in a long Order, and a negative number of units results in a short Order. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time-in-force requested for the Market Order. Restricted to FOK or IOC for a MarketOrder. enum: - GTC - GTD - GFD - FOK - IOC priceBound: type: string description: The worst price that the client is willing to have the Market Order filled at. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. positionFill: type: string description: Specification of how Positions in the Account are modified when the Order is filled. enum: - OPEN_ONLY - REDUCE_FIRST - REDUCE_ONLY - DEFAULT tradeClose: $ref: '#/definitions/MarketOrderTradeClose' longPositionCloseout: $ref: '#/definitions/MarketOrderPositionCloseout' shortPositionCloseout: $ref: '#/definitions/MarketOrderPositionCloseout' marginCloseout: $ref: '#/definitions/MarketOrderMarginCloseout' delayedTradeClose: $ref: '#/definitions/MarketOrderDelayedTradeClose' reason: type: string description: The reason that the Market Order was created enum: - CLIENT_ORDER - TRADE_CLOSE - POSITION_CLOSEOUT - MARGIN_CLOSEOUT - DELAYED_TRADE_CLOSE clientExtensions: $ref: '#/definitions/ClientExtensions' takeProfitOnFill: $ref: '#/definitions/TakeProfitDetails' stopLossOnFill: $ref: '#/definitions/StopLossDetails' trailingStopLossOnFill: $ref: '#/definitions/TrailingStopLossDetails' tradeClientExtensions: $ref: '#/definitions/ClientExtensions' rejectReason: type: string description: The reason that the Reject Transaction was created enum: - INTERNAL_SERVER_ERROR - INSTRUMENT_PRICE_UNKNOWN - ACCOUNT_NOT_ACTIVE - ACCOUNT_LOCKED - ACCOUNT_ORDER_CREATION_LOCKED - ACCOUNT_CONFIGURATION_LOCKED - ACCOUNT_DEPOSIT_LOCKED - ACCOUNT_WITHDRAWAL_LOCKED - ACCOUNT_ORDER_CANCEL_LOCKED - INSTRUMENT_NOT_TRADEABLE - PENDING_ORDERS_ALLOWED_EXCEEDED - ORDER_ID_UNSPECIFIED - ORDER_DOESNT_EXIST - ORDER_IDENTIFIER_INCONSISTENCY - TRADE_ID_UNSPECIFIED - TRADE_DOESNT_EXIST - TRADE_IDENTIFIER_INCONSISTENCY - INSUFFICIENT_MARGIN - INSTRUMENT_MISSING - INSTRUMENT_UNKNOWN - UNITS_MISSING - UNITS_INVALID - UNITS_PRECISION_EXCEEDED - UNITS_LIMIT_EXCEEDED - UNITS_MIMIMUM_NOT_MET - PRICE_MISSING - PRICE_INVALID - PRICE_PRECISION_EXCEEDED - PRICE_DISTANCE_MISSING - PRICE_DISTANCE_INVALID - PRICE_DISTANCE_PRECISION_EXCEEDED - PRICE_DISTANCE_MAXIMUM_EXCEEDED - PRICE_DISTANCE_MINIMUM_NOT_MET - TIME_IN_FORCE_MISSING - TIME_IN_FORCE_INVALID - TIME_IN_FORCE_GTD_TIMESTAMP_MISSING - TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST - PRICE_BOUND_INVALID - PRICE_BOUND_PRECISION_EXCEEDED - ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS - TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED - CLIENT_ORDER_ID_INVALID - CLIENT_ORDER_ID_ALREADY_EXISTS - CLIENT_ORDER_TAG_INVALID - CLIENT_ORDER_COMMENT_INVALID - CLIENT_TRADE_ID_INVALID - CLIENT_TRADE_ID_ALREADY_EXISTS - CLIENT_TRADE_TAG_INVALID - CLIENT_TRADE_COMMENT_INVALID - ORDER_FILL_POSITION_ACTION_MISSING - ORDER_FILL_POSITION_ACTION_INVALID - TRIGGER_CONDITION_MISSING - TRIGGER_CONDITION_INVALID - ORDER_PARTIAL_FILL_OPTION_MISSING - ORDER_PARTIAL_FILL_OPTION_INVALID - INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL - TAKE_PROFIT_ORDER_ALREADY_EXISTS - TAKE_PROFIT_ON_FILL_PRICE_MISSING - TAKE_PROFIT_ON_FILL_PRICE_INVALID - TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING - TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING - TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID - TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING - TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID - STOP_LOSS_ORDER_ALREADY_EXISTS - STOP_LOSS_ORDER_GUARANTEED_REQUIRED - STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD - STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION - STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED - STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ORDER_NOT_CANCELABLE - STOP_LOSS_ORDER_NOT_REPLACEABLE - STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER - STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED - STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED - STOP_LOSS_ON_FILL_PRICE_MISSING - STOP_LOSS_ON_FILL_PRICE_INVALID - STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET - STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_INVALID - STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED - STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED - TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING - TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING - TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID - TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID - TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING - TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID - CLOSE_TRADE_TYPE_MISSING - CLOSE_TRADE_PARTIAL_UNITS_MISSING - CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE - CLOSEOUT_POSITION_DOESNT_EXIST - CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION - CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE - CLOSEOUT_POSITION_REJECT - CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING - MARKUP_GROUP_ID_INVALID - POSITION_AGGREGATION_MODE_INVALID - ADMIN_CONFIGURE_DATA_MISSING - MARGIN_RATE_INVALID - MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT - ALIAS_INVALID - CLIENT_CONFIGURE_DATA_MISSING - MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL - AMOUNT_INVALID - INSUFFICIENT_FUNDS - AMOUNT_MISSING - FUNDING_REASON_MISSING - CLIENT_EXTENSIONS_DATA_MISSING - REPLACING_ORDER_INVALID - REPLACING_TRADE_ID_INVALID MarketOrderTransaction: type: object description: 'A MarketOrderTransaction represents the creation of a Market Order in the user''s account. A Market Order is an Order that is filled immediately at the current market price. Market Orders can be specialized when they are created to accomplish a specific task: to close a Trade, to closeout a Position or to particiate in in a Margin closeout.' properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "MARKET_ORDER" in a MarketOrderTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL instrument: type: string description: The Market Order's Instrument. format: A string containing the base currency and quote currency delimited by a "_". units: type: string description: The quantity requested to be filled by the Market Order. A posititive number of units results in a long Order, and a negative number of units results in a short Order. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. timeInForce: type: string description: The time-in-force requested for the Market Order. Restricted to FOK or IOC for a MarketOrder. enum: - GTC - GTD - GFD - FOK - IOC priceBound: type: string description: The worst price that the client is willing to have the Market Order filled at. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. positionFill: type: string description: Specification of how Positions in the Account are modified when the Order is filled. enum: - OPEN_ONLY - REDUCE_FIRST - REDUCE_ONLY - DEFAULT tradeClose: $ref: '#/definitions/MarketOrderTradeClose' longPositionCloseout: $ref: '#/definitions/MarketOrderPositionCloseout' shortPositionCloseout: $ref: '#/definitions/MarketOrderPositionCloseout' marginCloseout: $ref: '#/definitions/MarketOrderMarginCloseout' delayedTradeClose: $ref: '#/definitions/MarketOrderDelayedTradeClose' reason: type: string description: The reason that the Market Order was created enum: - CLIENT_ORDER - TRADE_CLOSE - POSITION_CLOSEOUT - MARGIN_CLOSEOUT - DELAYED_TRADE_CLOSE clientExtensions: $ref: '#/definitions/ClientExtensions' takeProfitOnFill: $ref: '#/definitions/TakeProfitDetails' stopLossOnFill: $ref: '#/definitions/StopLossDetails' trailingStopLossOnFill: $ref: '#/definitions/TrailingStopLossDetails' tradeClientExtensions: $ref: '#/definitions/ClientExtensions' MarketOrderMarginCloseout: type: object description: Details for the Market Order extensions specific to a Market Order placed that is part of a Market Order Margin Closeout in a client's account properties: reason: type: string description: The reason the Market Order was created to perform a margin closeout enum: - MARGIN_CHECK_VIOLATION - REGULATORY_MARGIN_CALL_VIOLATION - REGULATORY_MARGIN_CHECK_VIOLATION AccountChanges: type: object description: An AccountChanges Object is used to represent the changes to an Account's Orders, Trades and Positions since a specified Account TransactionID in the past. properties: ordersCreated: type: array description: The Orders created. These Orders may have been filled, cancelled or triggered in the same period. items: $ref: '#/definitions/Order' ordersCancelled: type: array description: The Orders cancelled. items: $ref: '#/definitions/Order' ordersFilled: type: array description: The Orders filled. items: $ref: '#/definitions/Order' ordersTriggered: type: array description: The Orders triggered. items: $ref: '#/definitions/Order' tradesOpened: type: array description: The Trades opened. items: $ref: '#/definitions/TradeSummary' tradesReduced: type: array description: The Trades reduced. items: $ref: '#/definitions/TradeSummary' tradesClosed: type: array description: The Trades closed. items: $ref: '#/definitions/TradeSummary' positions: type: array description: The Positions changed. items: $ref: '#/definitions/Position' transactions: type: array description: The Transactions that have been generated. items: $ref: '#/definitions/Transaction' TakeProfitDetails: type: object description: TakeProfitDetails specifies the details of a Take Profit Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Take Profit, or when a Trade's dependent Take Profit Order is modified directly through the Trade. properties: price: type: string description: The price that the Take Profit Order will be triggered at. Only one of the price and distance fields may be specified. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. timeInForce: type: string description: The time in force for the created Take Profit Order. This may only be GTC, GTD or GFD. enum: - GTC - GTD - GFD - FOK - IOC gtdTime: type: string description: The date when the Take Profit Order will be cancelled on if timeInForce is GTD. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). clientExtensions: $ref: '#/definitions/ClientExtensions' OrderFillTransaction: type: object description: An OrderFillTransaction represents the filling of an Order in the client's Account. properties: id: type: string description: The Transaction's Identifier. format: String representation of the numerical OANDA-assigned TransactionID time: type: string description: The date/time when the Transaction was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). userID: type: integer description: The ID of the user that initiated the creation of the Transaction. accountID: type: string description: The ID of the Account the Transaction was created for. format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' batchID: type: string description: The ID of the "batch" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously. format: String representation of the numerical OANDA-assigned TransactionID requestID: type: string description: The Request ID of the request which generated the transaction. type: type: string description: The Type of the Transaction. Always set to "ORDER_FILL" for an OrderFillTransaction. enum: - CREATE - CLOSE - REOPEN - CLIENT_CONFIGURE - CLIENT_CONFIGURE_REJECT - TRANSFER_FUNDS - TRANSFER_FUNDS_REJECT - MARKET_ORDER - MARKET_ORDER_REJECT - FIXED_PRICE_ORDER - LIMIT_ORDER - LIMIT_ORDER_REJECT - STOP_ORDER - STOP_ORDER_REJECT - MARKET_IF_TOUCHED_ORDER - MARKET_IF_TOUCHED_ORDER_REJECT - TAKE_PROFIT_ORDER - TAKE_PROFIT_ORDER_REJECT - STOP_LOSS_ORDER - STOP_LOSS_ORDER_REJECT - TRAILING_STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER_REJECT - ORDER_FILL - ORDER_CANCEL - ORDER_CANCEL_REJECT - ORDER_CLIENT_EXTENSIONS_MODIFY - ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT - TRADE_CLIENT_EXTENSIONS_MODIFY - TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT - MARGIN_CALL_ENTER - MARGIN_CALL_EXTEND - MARGIN_CALL_EXIT - DELAYED_TRADE_CLOSURE - DAILY_FINANCING - RESET_RESETTABLE_PL orderID: type: string description: The ID of the Order filled. format: The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order. clientOrderID: type: string description: The client Order ID of the Order filled (only provided if the client has assigned one). instrument: type: string description: The name of the filled Order's instrument. format: A string containing the base currency and quote currency delimited by a "_". units: type: string description: The number of units filled by the OrderFill. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. gainQuoteHomeConversionFactor: type: string description: This is the conversion factor in effect for the Account at the time of the OrderFill for converting any gains realized in Instrument quote units into units of the Account's home currency. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. lossQuoteHomeConversionFactor: type: string description: This is the conversion factor in effect for the Account at the time of the OrderFill for converting any losses realized in Instrument quote units into units of the Account's home currency. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. price: type: string description: This field is now deprecated and should no longer be used. The individual tradesClosed, tradeReduced and tradeOpened fields contain the exact/official price each unit was filled at. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. fullVWAP: type: string description: The price that all of the units of the OrderFill should have been filled at, in the absence of guaranteed price execution. This factors in the Account's current ClientPrice, used liquidity and the units of the OrderFill only. If no Trades were closed with their price clamped for guaranteed stop loss enforcement, then this value will match the price fields of each Trade opened, closed, and reduced, and they will all be the exact same. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument. fullPrice: $ref: '#/definitions/ClientPrice' reason: type: string description: The reason that an Order was filled enum: - LIMIT_ORDER - STOP_ORDER - MARKET_IF_TOUCHED_ORDER - TAKE_PROFIT_ORDER - STOP_LOSS_ORDER - TRAILING_STOP_LOSS_ORDER - MARKET_ORDER - MARKET_ORDER_TRADE_CLOSE - MARKET_ORDER_POSITION_CLOSEOUT - MARKET_ORDER_MARGIN_CLOSEOUT - MARKET_ORDER_DELAYED_TRADE_CLOSE pl: type: string description: The profit or loss incurred when the Order was filled. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. financing: type: string description: The financing paid or collected when the Order was filled. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. commission: type: string description: The commission charged in the Account's home currency as a result of filling the Order. The commission is always represented as a positive quantity of the Account's home currency, however it reduces the balance in the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. guaranteedExecutionFee: type: string description: The total guaranteed execution fees charged for all Trades opened, closed or reduced with guaranteed Stop Loss Orders. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. accountBalance: type: string description: The Account's balance after the Order was filled. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. tradeOpened: $ref: '#/definitions/TradeOpen' tradesClosed: type: array description: The Trades that were closed when the Order was filled (only provided if filling the Order resulted in a closing open Trades). items: $ref: '#/definitions/TradeReduce' tradeReduced: $ref: '#/definitions/TradeReduce' halfSpreadCost: type: string description: The half spread cost for the OrderFill, which is the sum of the halfSpreadCost values in the tradeOpened, tradesClosed and tradeReduced fields. This can be a positive or negative value and is represented in the home currency of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. AccountSummary: type: object description: A summary representation of a client's Account. The AccountSummary does not provide to full specification of pending Orders, open Trades and Positions. properties: id: type: string description: The Account's identifier format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' alias: type: string description: Client-assigned alias for the Account. Only provided if the Account has an alias set currency: type: string description: The home currency of the Account format: A string containing an ISO 4217 currency (http://en.wikipedia.org/wiki/ISO_4217) balance: type: string description: The current balance of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. createdByUserID: type: integer description: ID of the user that created the Account. createdTime: type: string description: The date/time when the Account was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). guaranteedStopLossOrderMode: type: string description: The current guaranteed Stop Loss Order mode of the Account. enum: - DISABLED - ALLOWED - REQUIRED pl: type: string description: The total profit/loss realized over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. resettablePL: type: string description: The total realized profit/loss for the Account since it was last reset by the client. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. resettablePLTime: type: string description: The date/time that the Account's resettablePL was last reset. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). financing: type: string description: The total amount of financing paid/collected over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. commission: type: string description: The total amount of commission paid over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. guaranteedExecutionFees: type: string description: The total amount of fees charged over the lifetime of the Account for the execution of guaranteed Stop Loss Orders. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginRate: type: string description: Client-provided margin rate override for the Account. The effective margin rate of the Account is the lesser of this value and the OANDA margin rate for the Account's division. This value is only provided if a margin rate override exists for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. marginCallEnterTime: type: string description: The date/time when the Account entered a margin call state. Only provided if the Account is in a margin call. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). marginCallExtensionCount: type: integer description: The number of times that the Account's current margin call was extended. lastMarginCallExtensionTime: type: string description: The date/time of the Account's last margin call extension. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). openTradeCount: type: integer description: The number of Trades currently open in the Account. openPositionCount: type: integer description: The number of Positions currently open in the Account. pendingOrderCount: type: integer description: The number of Orders currently pending in the Account. hedgingEnabled: type: boolean description: Flag indicating that the Account has hedging enabled. lastOrderFillTimestamp: type: string description: The date/time of the last order that was filled for this account. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places). unrealizedPL: type: string description: The total unrealized profit/loss for all Trades currently open in the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. NAV: type: string description: The net asset value of the Account. Equal to Account balance + unrealizedPL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginUsed: type: string description: Margin currently used for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginAvailable: type: string description: Margin available for Account currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. positionValue: type: string description: The value of the Account's open positions represented in the Account's home currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutUnrealizedPL: type: string description: The Account's margin closeout unrealized PL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutNAV: type: string description: The Account's margin closeout NAV. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutMarginUsed: type: string description: The Account's margin closeout margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCloseoutPercent: type: string description: The Account's margin closeout percentage. When this value is 1.0 or above the Account is in a margin closeout situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. marginCloseoutPositionValue: type: string description: The value of the Account's open positions as used for margin closeout calculations represented in the Account's home currency. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. withdrawalLimit: type: string description: The current WithdrawalLimit for the account which will be zero or a positive value indicating how much can be withdrawn from the account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCallMarginUsed: type: string description: The Account's margin call margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account's home currency. marginCallPercent: type: string description: The Account's margin call percentage. When this value is 1.0 or above the Account is in a margin call situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents. lastTransactionID: type: string description: The ID of the last Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID parameters: authorizationHeaderParam: name: Authorization description: The authorization bearer token previously obtained by the client in: header type: string format: The string 'Bearer ' followed by the token. required: true clientRequestIDHeaderParam: name: ClientRequestID description: Client specified RequestID to be sent with request. in: header type: string orderSpecifierPathParam: name: orderSpecifier description: The Order Specifier in: path type: string format: Either the Order's OANDA-assigned OrderID or the Order's client-provided ClientID prefixed by the "@" symbol required: true transactionIDPathParam: name: transactionID description: A Transaction ID in: path type: string format: String representation of the numerical OANDA-assigned TransactionID required: true tradeSpecifierPathParam: name: tradeSpecifier description: Specifier for the Trade in: path type: string format: Either the Trade's OANDA-assigned TradeID or the Trade's client-provided ClientID prefixed by the "@" symbol required: true instrumentNamePathParam: name: instrument description: Name of the Instrument in: path type: string format: A string containing the base currency and quote currency delimited by a "_". required: true acceptDatetimeFormatHeaderParam: name: Accept-Datetime-Format description: Format of DateTime fields in the request and response. in: header type: string accountIDPathParam: name: accountID description: Account Identifier in: path type: string format: '"-"-delimited string with format "{siteID}-{divisionID}-{userID}-{accountNumber}"' required: true responses: '404': description: Not Found. The client has attempted to access an entity that does not exist. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '416': description: Range Not Satisfiable. The client has specified a range that is invalid or cannot be processed. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '403': description: Forbidden. The client has provided a token that does not authorize them to perform the action implemented by the API endpoint. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '401': description: Unauthorized. The endpoint being access required the client to authenticated, however the the authentication token is invalid or has not been provided. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '400': description: Bad Request. The client has provided invalid data to be processed by the server. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred. '405': description: Method Not Allowed. The client has attempted to access an endpoint using an HTTP method that is not supported. headers: RequestID: description: The unique identifier generated for the request type: string schema: type: object properties: errorCode: type: string description: The code of the error that has occurred. This field may not be returned for some errors. errorMessage: type: string description: The human-readable description of the error that has occurred.