{
  "openapi": "3.1.0",
  "info": {
    "title": "OANDA API (independent, unofficial description by Broker API Hub)",
    "version": "2026-10-12",
    "description": "An independent, unofficial description of the OANDA API, built by Broker API Hub from OANDA's public documentation. It is not OANDA's own specification, and Broker API Hub is not affiliated with or endorsed by OANDA.\n\nIt is generated from 33 endpoint records. Every operation carries x-source, the page it was read on, and x-checked, the date that page was last checked. 1 operation carries x-status because the record is conflicting or unverified. An operation this file does not list is not recorded here, which is not evidence that it does not exist.\n\nSecurity schemes are only the authentication headers the endpoint records list. How a credential is obtained and how long it lasts is on https://openbrokerapi.com/brokers/oanda.\n\nResponse schemas: 16 of the 33 operations carry a response block written by hand for an earlier file on this site, each schema with its own x-source. Those operations are marked x-carried.\n\n17 operations carry a mock reply as an example under the default response. Its values are invented.\n\nWhere this file and OANDA's own documentation differ, the documentation wins. Educational only. Nothing here is advice.",
    "x-independent": true,
    "x-licence": "All rights reserved. Given for reference. Not part of the CC BY 4.0 downloads.",
    "x-cite": "Broker API Hub, OANDA API OpenAPI description, openbrokerapi.com/specs/oanda.json, newest check 2026-10-12",
    "x-generated": "2026-10-12",
    "x-generated-basis": "The newest checked date among the endpoint records in this file. It is not the date the file was built.",
    "x-page": "https://openbrokerapi.com/brokers/oanda",
    "x-base-addresses": {
      "live": "https://api-fxtrade.oanda.com",
      "demo": "https://api-fxpractice.oanda.com",
      "stream_live": "https://stream-fxtrade.oanda.com",
      "stream_demo": "https://stream-fxpractice.oanda.com"
    },
    "x-base-addresses-note": "The base addresses exactly as the broker record words them. Only an entry that is a plain address is listed under servers."
  },
  "externalDocs": {
    "description": "OANDA's own documentation",
    "url": "https://developer.oanda.com/rest-live-v20/introduction/"
  },
  "servers": [
    {
      "url": "https://api-fxpractice.oanda.com",
      "description": "Recorded on the OANDA record as \"demo\"."
    },
    {
      "url": "https://api-fxtrade.oanda.com",
      "description": "Recorded on the OANDA record as \"live\"."
    }
  ],
  "tags": [
    {
      "name": "Accounts"
    },
    {
      "name": "Instruments"
    },
    {
      "name": "Orders"
    },
    {
      "name": "Positions"
    },
    {
      "name": "Pricing"
    },
    {
      "name": "Trades"
    },
    {
      "name": "Transactions"
    }
  ],
  "paths": {
    "/v3/accounts": {
      "get": {
        "operationId": "accounts",
        "summary": "List every account your token can access. Start here to find your accountID.",
        "description": "Confirmed on the official account endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. One token grants access to all your sub-accounts (authentication page).",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/account-ep/"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "accounts": [
                    {
                      "id": "101-004-MOCK-001",
                      "tags": []
                    },
                    {
                      "id": "101-004-MOCK-002",
                      "tags": []
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/account-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/accounts"
      }
    },
    "/v3/accounts/{accountID}": {
      "get": {
        "operationId": "account",
        "summary": "Full account state: balance, NAV, margin, plus open trades, positions and pending orders.",
        "description": "Confirmed on the official account endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. Heavy response; prefer /summary if you only need balances.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/account-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "account": {
                    "id": "101-004-MOCK-001",
                    "alias": "Mock practice account",
                    "currency": "GBP",
                    "balance": "10000.0000",
                    "NAV": "10012.5000",
                    "unrealizedPL": "12.5000",
                    "pl": "0.0000",
                    "marginUsed": "66.6700",
                    "marginAvailable": "9945.8300",
                    "marginRate": "0.0333",
                    "openTradeCount": 1,
                    "openPositionCount": 1,
                    "pendingOrderCount": 1,
                    "hedgingEnabled": false,
                    "lastTransactionID": "9001",
                    "trades": [
                      {
                        "id": "MOCK-T-001",
                        "instrument": "EUR_USD",
                        "price": "1.10000",
                        "openTime": "2026-09-18T08:00:00.000000000Z",
                        "state": "OPEN",
                        "initialUnits": "1000",
                        "currentUnits": "1000",
                        "realizedPL": "0.0000",
                        "unrealizedPL": "1.2500",
                        "marginUsed": "33.3300"
                      }
                    ],
                    "positions": [],
                    "orders": []
                  },
                  "lastTransactionID": "9001"
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/account-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/account"
      }
    },
    "/v3/accounts/{accountID}/candles/latest": {
      "get": {
        "operationId": "candles-latest",
        "summary": "The candle still forming and the most recently completed ones, for several combinations of instrument, granularity and price component in one call.",
        "description": "Read on OANDA's own pricing endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. The page names one top level field, latestCandles. The candle fields in the mock follow this site's record for instrument candles. The format of a candle specification was not read.",
        "tags": [
          "Pricing"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/pricing-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "candleSpecifications",
            "in": "query",
            "required": true,
            "description": "Candle specifications to fetch, separated by commas.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "description": "Number of units used to work out the volume weighted average bid and ask. Default 1.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "smooth",
            "in": "query",
            "required": false,
            "description": "Use the previous close as the open. Default false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "dailyAlignment",
            "in": "query",
            "required": false,
            "description": "Hour (0 to 23) daily candles align to. Default 17.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "alignmentTimezone",
            "in": "query",
            "required": false,
            "description": "Timezone for dailyAlignment. Default America/New_York.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "weeklyAlignment",
            "in": "query",
            "required": false,
            "description": "Day weekly candles start on. Default Friday.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "latestCandles": [
                    {
                      "instrument": "EUR_USD",
                      "granularity": "H1",
                      "candles": [
                        {
                          "complete": false,
                          "volume": 321,
                          "time": "2026-09-18T09:00:00.000000000Z",
                          "mid": {
                            "o": "1.10120",
                            "h": "1.10180",
                            "l": "1.10090",
                            "c": "1.10150"
                          }
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/pricing-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/candles-latest"
      }
    },
    "/v3/accounts/{accountID}/changes": {
      "get": {
        "operationId": "account-changes",
        "summary": "Poll an account for its current state and for what has changed since a transaction you name. This is the documented way to keep a local copy of an account up to date.",
        "description": "Read on OANDA's own account endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. The page names three top level fields: changes, state and lastTransactionID. The fields inside changes and state were not read, so the mock leaves both empty.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/account-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sinceTransactionID",
            "in": "query",
            "required": false,
            "description": "ID of the transaction to report changes since. Use the lastTransactionID from your previous reply.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "changes": {},
                  "state": {},
                  "lastTransactionID": "9011"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/account-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/account-changes"
      }
    },
    "/v3/accounts/{accountID}/configuration": {
      "patch": {
        "operationId": "patch-account-configuration",
        "summary": "Change the parts of an account its owner may set: the alias and the margin rate.",
        "description": "Read on OANDA's own account endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. The page marks neither body field as required.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/account-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on every request with a body.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alias": {
                    "type": "string",
                    "description": "A name of your own for the account."
                  },
                  "marginRate": {
                    "type": "string",
                    "description": "The margin rate, as a decimal number written as a string."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "clientConfigureTransaction": {
                    "id": "9011",
                    "accountID": "101-004-MOCK-001",
                    "alias": "Mock practice account"
                  },
                  "lastTransactionID": "9011"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/account-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/patch-account-configuration"
      }
    },
    "/v3/accounts/{accountID}/instruments": {
      "get": {
        "operationId": "instruments",
        "summary": "Instruments this account can trade, with precision, pip location and margin rate.",
        "description": "Confirmed on the official account endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Instruments"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/account-ep/"
        },
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instruments",
            "in": "query",
            "required": false,
            "description": "Optional comma separated list to limit the result. Leave out for all tradeable instruments.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "instruments": [
                    {
                      "name": "EUR_USD",
                      "type": "CURRENCY",
                      "displayName": "EUR/USD",
                      "pipLocation": -4,
                      "displayPrecision": 5,
                      "tradeUnitsPrecision": 0,
                      "minimumTradeSize": "1",
                      "marginRate": "0.0333"
                    }
                  ],
                  "lastTransactionID": "9001"
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDInstrumentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/account-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/instruments"
      }
    },
    "/v3/accounts/{accountID}/instruments/{instrument}/candles": {
      "get": {
        "operationId": "account-instrument-candles",
        "summary": "Historical candlesticks for one instrument, requested through an account. Up to 5000 candles per request.",
        "description": "Read on OANDA's own pricing endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. The fields inside each candle in the mock follow this site's record for instrument candles.",
        "tags": [
          "Pricing"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/pricing-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instrument",
            "in": "path",
            "required": true,
            "description": "Instrument name with an underscore.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "price",
            "in": "query",
            "required": false,
            "description": "Price component or components to fetch. Default M.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "Candle size. Default S5.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "description": "Number of candles. Default 500, maximum 5000. Do not combine with both from and to.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of the range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "smooth",
            "in": "query",
            "required": false,
            "description": "Use the previous close as the open. Default false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeFirst",
            "in": "query",
            "required": false,
            "description": "Include the candle covered by the from time. Default true.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "dailyAlignment",
            "in": "query",
            "required": false,
            "description": "Hour (0 to 23) daily candles align to. Default 17.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "alignmentTimezone",
            "in": "query",
            "required": false,
            "description": "Timezone for dailyAlignment. Default America/New_York.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "weeklyAlignment",
            "in": "query",
            "required": false,
            "description": "Day weekly candles start on. Default Friday.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "description": "Number of units used to work out the volume weighted average bid and ask. Default 1.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "instrument": "EUR_USD",
                  "granularity": "H1",
                  "candles": [
                    {
                      "complete": true,
                      "volume": 1234,
                      "time": "2026-09-18T08:00:00.000000000Z",
                      "mid": {
                        "o": "1.10000",
                        "h": "1.10250",
                        "l": "1.09900",
                        "c": "1.10120"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/pricing-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/account-instrument-candles"
      }
    },
    "/v3/accounts/{accountID}/openPositions": {
      "get": {
        "operationId": "open-positions",
        "summary": "Positions with open trades, netted per instrument with long and short sides.",
        "description": "Confirmed on the official position endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. GET /v3/accounts/{accountID}/positions includes closed positions from the account history.",
        "tags": [
          "Positions"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/position-ep/"
        },
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "positions": [
                    {
                      "instrument": "EUR_USD",
                      "pl": "0.0000",
                      "unrealizedPL": "1.2500",
                      "long": {
                        "units": "1000",
                        "averagePrice": "1.10000",
                        "tradeIDs": [
                          "MOCK-T-001"
                        ],
                        "unrealizedPL": "1.2500"
                      },
                      "short": {
                        "units": "0",
                        "unrealizedPL": "0.0000"
                      }
                    }
                  ],
                  "lastTransactionID": "9001"
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDOpenPositionsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/position-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/open-positions"
      }
    },
    "/v3/accounts/{accountID}/openTrades": {
      "get": {
        "operationId": "open-trades",
        "summary": "All open trades on the account.",
        "description": "Confirmed on the official trade endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. GET /v3/accounts/{accountID}/trades adds filters (state, instrument, count up to 500, beforeID).",
        "tags": [
          "Trades"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/trade-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "trades": [
                    {
                      "id": "MOCK-T-001",
                      "instrument": "EUR_USD",
                      "price": "1.10000",
                      "openTime": "2026-09-18T08:00:00.000000000Z",
                      "state": "OPEN",
                      "initialUnits": "1000",
                      "currentUnits": "1000",
                      "realizedPL": "0.0000",
                      "unrealizedPL": "1.2500",
                      "marginUsed": "33.3300"
                    }
                  ],
                  "lastTransactionID": "9001"
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDOpenTradesResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/trade-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/open-trades"
      }
    },
    "/v3/accounts/{accountID}/orders": {
      "get": {
        "operationId": "orders",
        "summary": "List orders, pending by default. Filter by ids, state or instrument; paginate with beforeID.",
        "description": "Confirmed on the official order endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. GET /v3/accounts/{accountID}/pendingOrders is a shortcut for pending only.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/order-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "description": "Comma separated order IDs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "PENDING (default), FILLED, TRIGGERED, CANCELLED or ALL.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instrument",
            "in": "query",
            "required": false,
            "description": "Only orders for this instrument.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "description": "Maximum orders returned. Default 50, maximum 500.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "beforeID",
            "in": "query",
            "required": false,
            "description": "Return orders older than this order ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "orders": [
                    {
                      "id": "MOCK-O-001",
                      "type": "LIMIT",
                      "instrument": "EUR_USD",
                      "units": "1000",
                      "price": "1.09500",
                      "timeInForce": "GTC",
                      "state": "PENDING",
                      "createTime": "2026-09-18T07:55:00.000000000Z"
                    }
                  ],
                  "lastTransactionID": "9001"
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDOrdersResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/orders"
      },
      "post": {
        "operationId": "post-orders",
        "summary": "Create an order. Market, limit, stop, market if touched and dependent orders all go through this one endpoint. Returns 201.",
        "description": "Confirmed on the official order endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. Success is HTTP 201, not 200; 400 means the order was rejected and the body carries orderRejectTransaction. Units are strings. Test on a practice account first.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/order-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on every request with a body.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order": {
                    "type": "object",
                    "description": "The order request. For a market order: type MARKET, instrument, units (positive to buy, negative to sell), timeInForce FOK, positionFill DEFAULT."
                  }
                },
                "required": [
                  "order"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "orderCreateTransaction": {
                    "id": "9002",
                    "type": "MARKET_ORDER",
                    "instrument": "EUR_USD",
                    "units": "1000",
                    "timeInForce": "FOK",
                    "positionFill": "DEFAULT",
                    "reason": "CLIENT_ORDER",
                    "accountID": "101-004-MOCK-001",
                    "time": "2026-09-18T08:00:02.000000000Z"
                  },
                  "orderFillTransaction": {
                    "id": "9003",
                    "type": "ORDER_FILL",
                    "orderID": "9002",
                    "instrument": "EUR_USD",
                    "units": "1000",
                    "price": "1.10020",
                    "tradeOpened": {
                      "tradeID": "9003",
                      "units": "1000"
                    },
                    "accountID": "101-004-MOCK-001",
                    "time": "2026-09-18T08:00:02.000000000Z"
                  },
                  "relatedTransactionIDs": [
                    "9002",
                    "9003"
                  ],
                  "lastTransactionID": "9003"
                },
                "schema": {
                  "$ref": "#/components/schemas/PostAccountsAccountIDOrdersResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/OrderRejected400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/OrderRejected404"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/post-orders"
      }
    },
    "/v3/accounts/{accountID}/orders/{orderSpecifier}": {
      "get": {
        "operationId": "order",
        "summary": "The details of one order on the account, whatever its state.",
        "description": "Read on OANDA's own order endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. The @ form of the specifier follows this site's record for cancelling an order: it was not re-read today.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/order-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderSpecifier",
            "in": "path",
            "required": true,
            "description": "Order ID, or @ followed by your client order ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "order": {
                    "id": "9010",
                    "type": "LIMIT",
                    "instrument": "EUR_USD",
                    "units": "1000",
                    "price": "1.09000",
                    "timeInForce": "GTC",
                    "state": "PENDING",
                    "createTime": "2026-09-18T08:00:00.000000000Z"
                  },
                  "lastTransactionID": "9010"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/order"
      },
      "put": {
        "operationId": "put-order",
        "summary": "Replace a pending order: the old order is cancelled and a new one created from the specification you send, in a single call. Returns 201.",
        "description": "Read on OANDA's own order endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. Success is HTTP 201. The page also lists orderFillTransaction, orderReissueTransaction, orderReissueRejectTransaction and replacingOrderCancelTransaction in the reply.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/order-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on every request with a body.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ClientRequestID",
            "in": "header",
            "required": false,
            "description": "Optional. Your own request ID, sent along with the request.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderSpecifier",
            "in": "path",
            "required": true,
            "description": "Order ID, or @ followed by your client order ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order": {
                    "type": "object",
                    "description": "The full specification of the replacement order, in the same form as when creating one."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "orderCancelTransaction": {
                    "id": "9012",
                    "orderID": "9010",
                    "accountID": "101-004-MOCK-001"
                  },
                  "orderCreateTransaction": {
                    "id": "9013",
                    "instrument": "EUR_USD",
                    "units": "1000",
                    "price": "1.08900",
                    "accountID": "101-004-MOCK-001"
                  },
                  "relatedTransactionIDs": [
                    "9012",
                    "9013"
                  ],
                  "lastTransactionID": "9013"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/put-order"
      }
    },
    "/v3/accounts/{accountID}/orders/{orderSpecifier}/cancel": {
      "put": {
        "operationId": "put-order-cancel",
        "summary": "Cancel a pending order by ID or by your client ID prefixed with @.",
        "description": "Confirmed on the official order endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. 404 if the account or order does not exist.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/order-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ClientRequestID",
            "in": "header",
            "required": false,
            "description": "Optional. Your own identifier for this request, echoed back on the resulting transaction.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderSpecifier",
            "in": "path",
            "required": true,
            "description": "Order ID, or @ followed by your client order ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "orderCancelTransaction": {
                    "id": "9004",
                    "type": "ORDER_CANCEL",
                    "orderID": "MOCK-O-001",
                    "reason": "CLIENT_REQUEST",
                    "accountID": "101-004-MOCK-001",
                    "time": "2026-09-18T08:01:00.000000000Z"
                  },
                  "relatedTransactionIDs": [
                    "9004"
                  ],
                  "lastTransactionID": "9004"
                },
                "schema": {
                  "$ref": "#/components/schemas/PutAccountsAccountIDOrdersOrderSpecifierCancelResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/put-order-cancel"
      }
    },
    "/v3/accounts/{accountID}/orders/{orderSpecifier}/clientExtensions": {
      "put": {
        "operationId": "put-order-client-extensions",
        "summary": "Update the client extensions on an order: your own ID, tag and comment, for the order and for the trade it will open. OANDA says not to use them on an account linked to MT4.",
        "description": "Read on OANDA's own order endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/order-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on every request with a body.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderSpecifier",
            "in": "path",
            "required": true,
            "description": "Order ID, or @ followed by your client order ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clientExtensions": {
                    "type": "object",
                    "description": "The client extensions to set on the order."
                  },
                  "tradeClientExtensions": {
                    "type": "object",
                    "description": "The client extensions to set on the trade created when the order fills."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "orderClientExtensionsModifyTransaction": {
                    "id": "9014",
                    "orderID": "9010",
                    "accountID": "101-004-MOCK-001"
                  },
                  "relatedTransactionIDs": [
                    "9014"
                  ],
                  "lastTransactionID": "9014"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/put-order-client-extensions"
      }
    },
    "/v3/accounts/{accountID}/pendingOrders": {
      "get": {
        "operationId": "pending-orders",
        "summary": "Every pending order on the account, in one call with no filters.",
        "description": "Read on OANDA's own order endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/order-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "orders": [
                    {
                      "id": "9010",
                      "type": "LIMIT",
                      "instrument": "EUR_USD",
                      "units": "1000",
                      "price": "1.09000",
                      "timeInForce": "GTC",
                      "state": "PENDING",
                      "createTime": "2026-09-18T08:00:00.000000000Z"
                    }
                  ],
                  "lastTransactionID": "9010"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/pending-orders"
      }
    },
    "/v3/accounts/{accountID}/positions": {
      "get": {
        "operationId": "positions",
        "summary": "Every position the account has ever held, one per instrument, including those now flat. For open positions only there is a separate call.",
        "description": "Read on OANDA's own position endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. The fields inside each position in the mock follow this site's record for open positions.",
        "tags": [
          "Positions"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/position-ep/"
        },
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "positions": [
                    {
                      "instrument": "EUR_USD",
                      "pl": "0.0000",
                      "unrealizedPL": "1.0000",
                      "long": {
                        "units": "1000",
                        "averagePrice": "1.10020",
                        "tradeIDs": [
                          "MOCK-T-001"
                        ]
                      },
                      "short": {
                        "units": "0"
                      }
                    }
                  ],
                  "lastTransactionID": "9003"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/position-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/positions"
      }
    },
    "/v3/accounts/{accountID}/positions/{instrument}": {
      "get": {
        "operationId": "position",
        "summary": "The position in one instrument on the account, whether it is open or not.",
        "description": "Read on OANDA's own position endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. The fields inside the position in the mock follow this site's record for open positions.",
        "tags": [
          "Positions"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/position-ep/"
        },
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instrument",
            "in": "path",
            "required": true,
            "description": "Instrument name with an underscore, for example EUR_USD.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "position": {
                    "instrument": "EUR_USD",
                    "pl": "0.0000",
                    "unrealizedPL": "1.0000",
                    "long": {
                      "units": "1000",
                      "averagePrice": "1.10020",
                      "tradeIDs": [
                        "MOCK-T-001"
                      ]
                    },
                    "short": {
                      "units": "0"
                    }
                  },
                  "lastTransactionID": "9003"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/position-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/position"
      }
    },
    "/v3/accounts/{accountID}/positions/{instrument}/close": {
      "put": {
        "operationId": "put-position-close",
        "summary": "Close out the long side, the short side or both for one instrument.",
        "description": "Confirmed on the official position endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. The page lists ALL as the default for both sides; send NONE explicitly for the side you want to keep. 400 if nothing matches.",
        "tags": [
          "Positions"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/position-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on every request with a body.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instrument",
            "in": "path",
            "required": true,
            "description": "Instrument name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "longUnits": {
                    "type": "string",
                    "description": "ALL, NONE or a number of long units to close."
                  },
                  "shortUnits": {
                    "type": "string",
                    "description": "ALL, NONE or a number of short units to close."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "longOrderCreateTransaction": {
                    "id": "9007",
                    "type": "MARKET_ORDER",
                    "instrument": "EUR_USD",
                    "units": "-1000",
                    "reason": "POSITION_CLOSEOUT",
                    "accountID": "101-004-MOCK-001"
                  },
                  "longOrderFillTransaction": {
                    "id": "9008",
                    "type": "ORDER_FILL",
                    "instrument": "EUR_USD",
                    "units": "-1000",
                    "price": "1.10120",
                    "pl": "1.0000",
                    "accountID": "101-004-MOCK-001"
                  },
                  "relatedTransactionIDs": [
                    "9007",
                    "9008"
                  ],
                  "lastTransactionID": "9008"
                },
                "schema": {
                  "$ref": "#/components/schemas/PutAccountsAccountIDPositionsInstrumentCloseResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/position-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/put-position-close"
      }
    },
    "/v3/accounts/{accountID}/pricing": {
      "get": {
        "operationId": "pricing",
        "summary": "Current bid and ask for a list of instruments. A snapshot, not a stream.",
        "description": "Confirmed on the official pricing endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. For live ticks use the pricing stream instead of polling.",
        "tags": [
          "Pricing"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/pricing-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instruments",
            "in": "query",
            "required": true,
            "description": "Comma separated instrument names.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only return prices that changed after this time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeUnitsAvailable",
            "in": "query",
            "required": false,
            "description": "Deprecated upstream flag for units available. Usually leave out.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeHomeConversions",
            "in": "query",
            "required": false,
            "description": "Also return conversion factors into the account currency.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "time": "2026-09-18T08:00:01.000000000Z",
                  "prices": [
                    {
                      "type": "PRICE",
                      "instrument": "EUR_USD",
                      "time": "2026-09-18T08:00:00.500000000Z",
                      "tradeable": true,
                      "bids": [
                        {
                          "price": "1.10010",
                          "liquidity": 1000000
                        }
                      ],
                      "asks": [
                        {
                          "price": "1.10020",
                          "liquidity": 1000000
                        }
                      ],
                      "closeoutBid": "1.10005",
                      "closeoutAsk": "1.10025"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDPricingResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/pricing-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/pricing"
      }
    },
    "/v3/accounts/{accountID}/pricing/stream": {
      "servers": [
        {
          "url": "https://stream-fxpractice.oanda.com",
          "description": "Recorded on the OANDA record as \"stream_demo\"."
        },
        {
          "url": "https://stream-fxtrade.oanda.com",
          "description": "Recorded on the OANDA record as \"stream_live\"."
        }
      ],
      "get": {
        "operationId": "pricing-stream",
        "summary": "Streaming prices over one long lived HTTP connection. Newline delimited JSON: PRICE and HEARTBEAT objects.",
        "description": "Confirmed on the official pricing endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. Served by the stream host (stream-fxpractice.oanda.com or stream-fxtrade.oanda.com), not the REST host. At most 4 prices per second per instrument (every 250 ms); heartbeats every 5 seconds. Mock shows stream lines as an array for display only.",
        "tags": [
          "Pricing"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/pricing-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instruments",
            "in": "query",
            "required": true,
            "description": "Comma separated instrument names.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "description": "Send the current price for each instrument first. Default true.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeHomeConversions",
            "in": "query",
            "required": false,
            "description": "Include home currency conversion updates.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "stream_lines": [
                    {
                      "type": "PRICE",
                      "instrument": "EUR_USD",
                      "time": "2026-09-18T08:00:00.250000000Z",
                      "tradeable": true,
                      "bids": [
                        {
                          "price": "1.10010",
                          "liquidity": 1000000
                        }
                      ],
                      "asks": [
                        {
                          "price": "1.10020",
                          "liquidity": 1000000
                        }
                      ]
                    },
                    {
                      "type": "HEARTBEAT",
                      "time": "2026-09-18T08:00:05.000000000Z"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDPricingStreamResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/pricing-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/pricing-stream"
      }
    },
    "/v3/accounts/{accountID}/summary": {
      "get": {
        "operationId": "account-summary",
        "summary": "Account summary without the trade, position and order lists. Cheap balance and margin check.",
        "description": "Confirmed on the official account endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/account-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "account": {
                    "id": "101-004-MOCK-001",
                    "alias": "Mock practice account",
                    "currency": "GBP",
                    "balance": "10000.0000",
                    "NAV": "10012.5000",
                    "unrealizedPL": "12.5000",
                    "pl": "0.0000",
                    "marginUsed": "66.6700",
                    "marginAvailable": "9945.8300",
                    "marginRate": "0.0333",
                    "openTradeCount": 1,
                    "openPositionCount": 1,
                    "pendingOrderCount": 1,
                    "hedgingEnabled": false,
                    "lastTransactionID": "9001"
                  },
                  "lastTransactionID": "9001"
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDSummaryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/account-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/account-summary"
      }
    },
    "/v3/accounts/{accountID}/trades": {
      "get": {
        "operationId": "trades",
        "summary": "Trades on the account, filtered by state, instrument or ID. Open trades are returned unless you ask for another state.",
        "description": "Read on OANDA's own trade endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. The fields inside each trade in the mock follow this site's record for open trades.",
        "tags": [
          "Trades"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/trade-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "description": "Trade IDs to fetch, separated by commas.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "State to filter by. Default OPEN.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instrument",
            "in": "query",
            "required": false,
            "description": "Instrument to filter by.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "description": "Most trades to return. Default 50, maximum 500.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "beforeID",
            "in": "query",
            "required": false,
            "description": "Highest trade ID to return. Without it the most recent trades are returned.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "trades": [
                    {
                      "id": "MOCK-T-001",
                      "instrument": "EUR_USD",
                      "price": "1.10020",
                      "openTime": "2026-09-18T08:00:02.000000000Z",
                      "state": "OPEN",
                      "initialUnits": "1000",
                      "currentUnits": "1000",
                      "realizedPL": "0.0000",
                      "unrealizedPL": "1.0000"
                    }
                  ],
                  "lastTransactionID": "9003"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/trade-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/trades"
      }
    },
    "/v3/accounts/{accountID}/trades/{tradeSpecifier}": {
      "get": {
        "operationId": "trade",
        "summary": "The details of one trade on the account.",
        "description": "Read on OANDA's own trade endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. The fields inside the trade in the mock follow this site's record for open trades.",
        "tags": [
          "Trades"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/trade-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tradeSpecifier",
            "in": "path",
            "required": true,
            "description": "Trade ID, or @ followed by your client trade ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "trade": {
                    "id": "MOCK-T-001",
                    "instrument": "EUR_USD",
                    "price": "1.10020",
                    "openTime": "2026-09-18T08:00:02.000000000Z",
                    "state": "OPEN",
                    "initialUnits": "1000",
                    "currentUnits": "1000",
                    "realizedPL": "0.0000",
                    "unrealizedPL": "1.0000"
                  },
                  "lastTransactionID": "9003"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/trade-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/trade"
      }
    },
    "/v3/accounts/{accountID}/trades/{tradeSpecifier}/clientExtensions": {
      "put": {
        "operationId": "put-trade-client-extensions",
        "summary": "Update the client extensions on a trade: your own ID, tag and comment. OANDA says not to use them on an account linked to MT4.",
        "description": "Read on OANDA's own trade endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields.",
        "tags": [
          "Trades"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/trade-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on every request with a body.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tradeSpecifier",
            "in": "path",
            "required": true,
            "description": "Trade ID, or @ followed by your client trade ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clientExtensions": {
                    "type": "object",
                    "description": "The client extensions to set on the trade."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "tradeClientExtensionsModifyTransaction": {
                    "id": "9015",
                    "tradeID": "MOCK-T-001",
                    "accountID": "101-004-MOCK-001"
                  },
                  "relatedTransactionIDs": [
                    "9015"
                  ],
                  "lastTransactionID": "9015"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/trade-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/put-trade-client-extensions"
      }
    },
    "/v3/accounts/{accountID}/trades/{tradeSpecifier}/close": {
      "put": {
        "operationId": "put-trade-close",
        "summary": "Close a trade in full or in part.",
        "description": "Confirmed on the official trade endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. Units must always be positive, even for a short trade.",
        "tags": [
          "Trades"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/trade-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on every request with a body.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tradeSpecifier",
            "in": "path",
            "required": true,
            "description": "Trade ID, or @ followed by your client trade ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "units": {
                    "type": "string",
                    "description": "ALL (default) or a positive number of units to close part of the trade."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "orderCreateTransaction": {
                    "id": "9005",
                    "type": "MARKET_ORDER",
                    "instrument": "EUR_USD",
                    "units": "-1000",
                    "reason": "TRADE_CLOSE",
                    "accountID": "101-004-MOCK-001"
                  },
                  "orderFillTransaction": {
                    "id": "9006",
                    "type": "ORDER_FILL",
                    "instrument": "EUR_USD",
                    "units": "-1000",
                    "price": "1.10120",
                    "pl": "1.0000",
                    "tradesClosed": [
                      {
                        "tradeID": "MOCK-T-001",
                        "units": "-1000",
                        "realizedPL": "1.0000"
                      }
                    ],
                    "accountID": "101-004-MOCK-001"
                  },
                  "relatedTransactionIDs": [
                    "9005",
                    "9006"
                  ],
                  "lastTransactionID": "9006"
                },
                "schema": {
                  "$ref": "#/components/schemas/PutAccountsAccountIDTradesTradeSpecifierCloseResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/OrderRejected400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/OrderRejected404"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/trade-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/put-trade-close"
      }
    },
    "/v3/accounts/{accountID}/trades/{tradeSpecifier}/orders": {
      "put": {
        "operationId": "put-trade-orders",
        "summary": "Create, replace or cancel the orders that hang off a trade: take profit, stop loss, trailing stop loss and guaranteed stop loss. This is how a stop or limit is moved on an open trade.",
        "description": "Read on OANDA's own trade endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields. Each kind of dependent order has its own set of transactions in the reply, for example takeProfitOrderTransaction, stopLossOrderCancelTransaction and trailingStopLossOrderTransaction. A field left out of one of the body objects takes a default on create and is carried over on change.",
        "tags": [
          "Trades"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/trade-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on every request with a body.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tradeSpecifier",
            "in": "path",
            "required": true,
            "description": "Trade ID, or @ followed by your client trade ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "takeProfit": {
                    "type": "object",
                    "description": "The take profit to create or change. Send null to cancel the existing one. Leave it out to keep it as it is."
                  },
                  "stopLoss": {
                    "type": "object",
                    "description": "The stop loss to create or change. Send null to cancel the existing one. Leave it out to keep it as it is."
                  },
                  "trailingStopLoss": {
                    "type": "object",
                    "description": "The trailing stop loss to create or change. Send null to cancel the existing one. Leave it out to keep it as it is."
                  },
                  "guaranteedStopLoss": {
                    "type": "object",
                    "description": "The guaranteed stop loss to create or change. Send null to cancel the existing one. Leave it out to keep it as it is."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "stopLossOrderTransaction": {
                    "id": "9016",
                    "tradeID": "MOCK-T-001",
                    "price": "1.09500",
                    "accountID": "101-004-MOCK-001"
                  },
                  "relatedTransactionIDs": [
                    "9016"
                  ],
                  "lastTransactionID": "9016"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/trade-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/put-trade-orders"
      }
    },
    "/v3/accounts/{accountID}/transactions": {
      "get": {
        "operationId": "transactions",
        "summary": "Transaction history for a time range, returned as page URLs to fetch next.",
        "description": "Confirmed on the official transaction endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. This returns page URLs, not transactions; fetch each with /transactions/idrange, or use /transactions/sinceid to catch up.",
        "tags": [
          "Transactions"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/transaction-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start time, inclusive. Defaults to account creation. Range is capped at 365 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End time, inclusive. Defaults to now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Transactions per page. Default 100, maximum 1000.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Comma separated transaction type filter, for example ORDER,FUNDING.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "from": "2026-09-01T00:00:00.000000000Z",
                  "to": "2026-09-18T08:00:00.000000000Z",
                  "pageSize": 100,
                  "count": 2,
                  "pages": [
                    "https://api-fxpractice.oanda.com/v3/accounts/101-004-MOCK-001/transactions/idrange?from=9000&to=9001"
                  ],
                  "lastTransactionID": "9001"
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDTransactionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/transaction-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/transactions"
      }
    },
    "/v3/accounts/{accountID}/transactions/{transactionID}": {
      "get": {
        "operationId": "transaction",
        "summary": "The details of one transaction on the account, by its ID.",
        "description": "Read on OANDA's own transaction endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields.",
        "tags": [
          "Transactions"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/transaction-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "transactionID",
            "in": "path",
            "required": true,
            "description": "ID of the transaction.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "transaction": {
                    "id": "9003",
                    "type": "ORDER_FILL",
                    "accountID": "101-004-MOCK-001",
                    "time": "2026-09-18T08:00:02.000000000Z"
                  },
                  "lastTransactionID": "9016"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/transaction-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/transaction"
      }
    },
    "/v3/accounts/{accountID}/transactions/idrange": {
      "get": {
        "operationId": "transactions-idrange",
        "summary": "The transactions between two transaction IDs, both included, returned in full.",
        "description": "Read on OANDA's own transaction endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields.",
        "tags": [
          "Transactions"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/transaction-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "First transaction ID to fetch, included.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "Last transaction ID to fetch, included.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Transaction types to keep, separated by commas.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "transactions": [
                    {
                      "id": "9003",
                      "type": "ORDER_FILL",
                      "accountID": "101-004-MOCK-001",
                      "time": "2026-09-18T08:00:02.000000000Z"
                    }
                  ],
                  "lastTransactionID": "9016"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/transaction-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/transactions-idrange"
      }
    },
    "/v3/accounts/{accountID}/transactions/sinceid": {
      "get": {
        "operationId": "transactions-sinceid",
        "summary": "Every transaction newer than the one you name, returned in full. Useful for catching up after a gap.",
        "description": "Read on OANDA's own transaction endpoints page on 12 Oct 2026: method, path, parameters and the top level response fields.",
        "tags": [
          "Transactions"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/transaction-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "ID of the last transaction you already hold. The reply starts after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Transaction types to keep, separated by commas.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "transactions": [
                    {
                      "id": "9004",
                      "type": "MARKET_ORDER",
                      "accountID": "101-004-MOCK-001",
                      "time": "2026-09-18T08:05:00.000000000Z"
                    }
                  ],
                  "lastTransactionID": "9016"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/transaction-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/transactions-sinceid"
      }
    },
    "/v3/accounts/{accountID}/transactions/stream": {
      "servers": [
        {
          "url": "https://stream-fxpractice.oanda.com",
          "description": "Recorded on the OANDA record as \"stream_demo\"."
        },
        {
          "url": "https://stream-fxtrade.oanda.com",
          "description": "Recorded on the OANDA record as \"stream_live\"."
        }
      ],
      "get": {
        "operationId": "transactions-stream",
        "summary": "Streaming account activity (fills, cancels, funding) from the moment you connect. Newline delimited JSON.",
        "description": "Confirmed on the official transaction endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. Served by the stream host, chunked transfer encoding, heartbeats every 5 seconds. Mock shows stream lines as an array for display only.",
        "tags": [
          "Transactions"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/transaction-ep/"
        },
        "parameters": [
          {
            "name": "accountID",
            "in": "path",
            "required": true,
            "description": "Account ID from GET /v3/accounts. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "stream_lines": [
                    {
                      "type": "ORDER_FILL",
                      "id": "9003",
                      "instrument": "EUR_USD",
                      "units": "1000",
                      "price": "1.10020",
                      "accountID": "101-004-MOCK-001",
                      "time": "2026-09-18T08:00:02.000000000Z"
                    },
                    {
                      "type": "HEARTBEAT",
                      "lastTransactionID": "9003",
                      "time": "2026-09-18T08:00:05.000000000Z"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/GetAccountsAccountIDTransactionsStreamResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://developer.oanda.com/rest-live-v20/transaction-ep/",
        "x-checked": "2026-10-12",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/transactions-stream"
      }
    },
    "/v3/instruments/{instrument}/candles": {
      "get": {
        "operationId": "candles",
        "summary": "Historical candlesticks (OHLC) for one instrument. Up to 5000 candles per request.",
        "description": "Not verified on OANDA's own site today. The instrument endpoints page this record was read on (developer.oanda.com/rest-live-v20/instrument-ep/) answered 404 on 12 Oct 2026 and the site's menu no longer lists it. That is not evidence that the call has gone. OANDA's own OpenAPI file on GitHub (oanda/v20-openapi, version 3.0.25), opened the same day, still defines GET /instruments/{instrument}/candles under the base path /v3 with the parameters listed here, and is the source linked on this record. What OANDA's site documents today is the account scoped call, GET /v3/accounts/{accountID}/instruments/{instrument}/candles, on its pricing endpoints page: the same query parameters plus units, with count defaulting to 500 and capped at 5000.",
        "tags": [
          "Instruments"
        ],
        "externalDocs": {
          "description": "OANDA's own reference for this operation",
          "url": "https://developer.oanda.com/rest-live-v20/pricing-ep/"
        },
        "parameters": [
          {
            "name": "Accept-Datetime-Format",
            "in": "header",
            "required": false,
            "description": "Optional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instrument",
            "in": "path",
            "required": true,
            "description": "Instrument name with an underscore.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "price",
            "in": "query",
            "required": false,
            "description": "Price component: M (mid, default), B (bid), A (ask), or a combination such as BA.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "Candle size, for example S5 (default), M1, H1, D.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "description": "Number of candles. Default 500, maximum 5000. Do not combine with both from and to.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of the range, RFC3339 or UNIX per Accept-Datetime-Format.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "smooth",
            "in": "query",
            "required": false,
            "description": "Use the previous close as the open. Default false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeFirst",
            "in": "query",
            "required": false,
            "description": "Include the candle covered by the from time. Default true.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "dailyAlignment",
            "in": "query",
            "required": false,
            "description": "Hour (0 to 23) daily candles align to. Default 17.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "alignmentTimezone",
            "in": "query",
            "required": false,
            "description": "Timezone for dailyAlignment. Default America/New_York.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "weeklyAlignment",
            "in": "query",
            "required": false,
            "description": "Day weekly candles start on. Default Friday.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "example": {
                  "instrument": "EUR_USD",
                  "granularity": "H1",
                  "candles": [
                    {
                      "complete": true,
                      "volume": 1234,
                      "time": "2026-09-18T08:00:00.000000000Z",
                      "mid": {
                        "o": "1.10000",
                        "h": "1.10250",
                        "l": "1.09900",
                        "c": "1.10120"
                      }
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/GetInstrumentsInstrumentCandlesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "x-source": "https://raw.githubusercontent.com/oanda/v20-openapi/master/json/v20.json",
        "x-checked": "2026-10-12",
        "x-status": "unverified",
        "x-version": "v3",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/oanda/endpoints/candles"
      }
    }
  },
  "components": {
    "schemas": {
      "GetAccountsResponse": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "tags": {
                  "type": "array",
                  "items": {}
                }
              }
            }
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "ErrorResponse": {
        "type": "object",
        "description": "OANDA error body: errorMessage is always present, errorCode may be missing for some errors. Documented on the order and trade endpoint pages.",
        "properties": {
          "errorCode": {
            "type": "string",
            "description": "The code of the error. May not be returned for some errors."
          },
          "errorMessage": {
            "type": "string",
            "description": "Human readable description of the error."
          }
        },
        "required": [
          "errorMessage"
        ],
        "x-verified": true,
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/"
      },
      "GetAccountsAccountIDResponse": {
        "type": "object",
        "properties": {
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "alias": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "balance": {
                "type": "string"
              },
              "NAV": {
                "type": "string"
              },
              "unrealizedPL": {
                "type": "string"
              },
              "pl": {
                "type": "string"
              },
              "marginUsed": {
                "type": "string"
              },
              "marginAvailable": {
                "type": "string"
              },
              "marginRate": {
                "type": "string"
              },
              "openTradeCount": {
                "type": "number"
              },
              "openPositionCount": {
                "type": "number"
              },
              "pendingOrderCount": {
                "type": "number"
              },
              "hedgingEnabled": {
                "type": "boolean"
              },
              "lastTransactionID": {
                "type": "string"
              },
              "trades": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "instrument": {
                      "type": "string"
                    },
                    "price": {
                      "type": "string"
                    },
                    "openTime": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "initialUnits": {
                      "type": "string"
                    },
                    "currentUnits": {
                      "type": "string"
                    },
                    "realizedPL": {
                      "type": "string"
                    },
                    "unrealizedPL": {
                      "type": "string"
                    },
                    "marginUsed": {
                      "type": "string"
                    }
                  }
                }
              },
              "positions": {
                "type": "array",
                "items": {}
              },
              "orders": {
                "type": "array",
                "items": {}
              }
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetAccountsAccountIDInstrumentsResponse": {
        "type": "object",
        "properties": {
          "instruments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "displayName": {
                  "type": "string"
                },
                "pipLocation": {
                  "type": "number"
                },
                "displayPrecision": {
                  "type": "number"
                },
                "tradeUnitsPrecision": {
                  "type": "number"
                },
                "minimumTradeSize": {
                  "type": "string"
                },
                "marginRate": {
                  "type": "string"
                }
              }
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetAccountsAccountIDOpenPositionsResponse": {
        "type": "object",
        "properties": {
          "positions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "instrument": {
                  "type": "string"
                },
                "pl": {
                  "type": "string"
                },
                "unrealizedPL": {
                  "type": "string"
                },
                "long": {
                  "type": "object",
                  "properties": {
                    "units": {
                      "type": "string"
                    },
                    "averagePrice": {
                      "type": "string"
                    },
                    "tradeIDs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "unrealizedPL": {
                      "type": "string"
                    }
                  }
                },
                "short": {
                  "type": "object",
                  "properties": {
                    "units": {
                      "type": "string"
                    },
                    "unrealizedPL": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetAccountsAccountIDOpenTradesResponse": {
        "type": "object",
        "properties": {
          "trades": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "instrument": {
                  "type": "string"
                },
                "price": {
                  "type": "string"
                },
                "openTime": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "initialUnits": {
                  "type": "string"
                },
                "currentUnits": {
                  "type": "string"
                },
                "realizedPL": {
                  "type": "string"
                },
                "unrealizedPL": {
                  "type": "string"
                },
                "marginUsed": {
                  "type": "string"
                }
              }
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetAccountsAccountIDOrdersResponse": {
        "type": "object",
        "properties": {
          "orders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "instrument": {
                  "type": "string"
                },
                "units": {
                  "type": "string"
                },
                "price": {
                  "type": "string"
                },
                "timeInForce": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "createTime": {
                  "type": "string"
                }
              }
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "PostAccountsAccountIDOrdersResponse": {
        "type": "object",
        "properties": {
          "orderCreateTransaction": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "instrument": {
                "type": "string"
              },
              "units": {
                "type": "string"
              },
              "timeInForce": {
                "type": "string"
              },
              "positionFill": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "accountID": {
                "type": "string"
              },
              "time": {
                "type": "string"
              }
            }
          },
          "orderFillTransaction": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "orderID": {
                "type": "string"
              },
              "instrument": {
                "type": "string"
              },
              "units": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "tradeOpened": {
                "type": "object",
                "properties": {
                  "tradeID": {
                    "type": "string"
                  },
                  "units": {
                    "type": "string"
                  }
                }
              },
              "accountID": {
                "type": "string"
              },
              "time": {
                "type": "string"
              }
            }
          },
          "relatedTransactionIDs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "OrderRejectError": {
        "type": "object",
        "description": "Error body for order and trade changes that were rejected, as documented for POST orders and PUT trade close (400 and 404).",
        "properties": {
          "orderRejectTransaction": {
            "type": "object",
            "description": "The transaction that rejected the request."
          },
          "relatedTransactionIDs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lastTransactionID": {
            "type": "string"
          },
          "errorCode": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          }
        },
        "required": [
          "errorMessage"
        ],
        "x-verified": true,
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/"
      },
      "PutAccountsAccountIDOrdersOrderSpecifierCancelResponse": {
        "type": "object",
        "properties": {
          "orderCancelTransaction": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "orderID": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "accountID": {
                "type": "string"
              },
              "time": {
                "type": "string"
              }
            }
          },
          "relatedTransactionIDs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "PutAccountsAccountIDPositionsInstrumentCloseResponse": {
        "type": "object",
        "properties": {
          "longOrderCreateTransaction": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "instrument": {
                "type": "string"
              },
              "units": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "accountID": {
                "type": "string"
              }
            }
          },
          "longOrderFillTransaction": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "instrument": {
                "type": "string"
              },
              "units": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "pl": {
                "type": "string"
              },
              "accountID": {
                "type": "string"
              }
            }
          },
          "relatedTransactionIDs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetAccountsAccountIDPricingResponse": {
        "type": "object",
        "properties": {
          "time": {
            "type": "string"
          },
          "prices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "instrument": {
                  "type": "string"
                },
                "time": {
                  "type": "string"
                },
                "tradeable": {
                  "type": "boolean"
                },
                "bids": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "price": {
                        "type": "string"
                      },
                      "liquidity": {
                        "type": "number"
                      }
                    }
                  }
                },
                "asks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "price": {
                        "type": "string"
                      },
                      "liquidity": {
                        "type": "number"
                      }
                    }
                  }
                },
                "closeoutBid": {
                  "type": "string"
                },
                "closeoutAsk": {
                  "type": "string"
                }
              }
            }
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetAccountsAccountIDPricingStreamResponse": {
        "type": "object",
        "properties": {
          "stream_lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "instrument": {
                  "type": "string"
                },
                "time": {
                  "type": "string"
                },
                "tradeable": {
                  "type": "boolean"
                },
                "bids": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "price": {
                        "type": "string"
                      },
                      "liquidity": {
                        "type": "number"
                      }
                    }
                  }
                },
                "asks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "price": {
                        "type": "string"
                      },
                      "liquidity": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetAccountsAccountIDSummaryResponse": {
        "type": "object",
        "properties": {
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "alias": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "balance": {
                "type": "string"
              },
              "NAV": {
                "type": "string"
              },
              "unrealizedPL": {
                "type": "string"
              },
              "pl": {
                "type": "string"
              },
              "marginUsed": {
                "type": "string"
              },
              "marginAvailable": {
                "type": "string"
              },
              "marginRate": {
                "type": "string"
              },
              "openTradeCount": {
                "type": "number"
              },
              "openPositionCount": {
                "type": "number"
              },
              "pendingOrderCount": {
                "type": "number"
              },
              "hedgingEnabled": {
                "type": "boolean"
              },
              "lastTransactionID": {
                "type": "string"
              }
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "PutAccountsAccountIDTradesTradeSpecifierCloseResponse": {
        "type": "object",
        "properties": {
          "orderCreateTransaction": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "instrument": {
                "type": "string"
              },
              "units": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "accountID": {
                "type": "string"
              }
            }
          },
          "orderFillTransaction": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "instrument": {
                "type": "string"
              },
              "units": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "pl": {
                "type": "string"
              },
              "tradesClosed": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "tradeID": {
                      "type": "string"
                    },
                    "units": {
                      "type": "string"
                    },
                    "realizedPL": {
                      "type": "string"
                    }
                  }
                }
              },
              "accountID": {
                "type": "string"
              }
            }
          },
          "relatedTransactionIDs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetAccountsAccountIDTransactionsResponse": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "pageSize": {
            "type": "number"
          },
          "count": {
            "type": "number"
          },
          "pages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lastTransactionID": {
            "type": "string"
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetAccountsAccountIDTransactionsStreamResponse": {
        "type": "object",
        "properties": {
          "stream_lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "instrument": {
                  "type": "string"
                },
                "units": {
                  "type": "string"
                },
                "price": {
                  "type": "string"
                },
                "accountID": {
                  "type": "string"
                },
                "time": {
                  "type": "string"
                }
              }
            }
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      },
      "GetInstrumentsInstrumentCandlesResponse": {
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string"
          },
          "granularity": {
            "type": "string"
          },
          "candles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "complete": {
                  "type": "boolean"
                },
                "volume": {
                  "type": "number"
                },
                "time": {
                  "type": "string"
                },
                "mid": {
                  "type": "object",
                  "properties": {
                    "o": {
                      "type": "string"
                    },
                    "h": {
                      "type": "string"
                    },
                    "l": {
                      "type": "string"
                    },
                    "c": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Fields as documented; types inferred from our mock example."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Unverified body shape. Unauthorised: token missing or invalid, or the account ID is not valid for this token. OANDA lists this status but does not show the body on this page; shape taken from the order endpoint error definitions.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": false,
        "x-source": "https://developer.oanda.com/rest-live-v20/troubleshooting-errors/"
      },
      "MethodNotAllowed": {
        "description": "Unverified body shape. Method not allowed for this path. Body shape not shown by OANDA; taken from the order endpoint error definitions.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": false,
        "x-source": "https://developer.oanda.com/rest-live-v20/troubleshooting-errors/"
      },
      "TooManyRequests": {
        "description": "Unverified body shape. Returned when OANDA rate limits a client. No requests per second ceiling is published; pace to Best Practices. OANDA does not document the 429 body.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": false,
        "x-source": "https://developer.oanda.com/rest-live-v20/development-guide/"
      },
      "BadRequest": {
        "description": "Unverified body shape. Bad request: invalid parameters or malformed data. OANDA lists this status on the endpoint page but does not show the body there; shape taken from the order endpoint error definitions.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": false,
        "x-source": "https://developer.oanda.com/rest-live-v20/troubleshooting-errors/"
      },
      "NotFound": {
        "description": "Unverified body shape. Not found: the referenced account, instrument, order, trade or transaction does not exist. Body shape not shown on this page; taken from the order endpoint error definitions.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": false,
        "x-source": "https://developer.oanda.com/rest-live-v20/troubleshooting-errors/"
      },
      "OrderRejected400": {
        "description": "Bad request: the order or trade change was rejected. Body documented on the endpoint page.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OrderRejectError"
            }
          }
        },
        "x-verified": true,
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/"
      },
      "OrderRejected404": {
        "description": "Not found: the account, order or trade does not exist. Body documented on the endpoint page.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OrderRejectError"
            }
          }
        },
        "x-verified": true,
        "x-source": "https://developer.oanda.com/rest-live-v20/order-ep/"
      }
    },
    "securitySchemes": {
      "Authorization": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "A header the OANDA endpoint records list on requests. Read its value from your own environment. Never paste it into a web page or a chat."
      }
    }
  }
}