{
  "components": {
    "schemas": {
      "AccountBucketDetailedResponse": {
        "properties": {
          "creationDate": {
            "format": "date-time",
            "type": "string"
          },
          "dividendCashAction": {
            "enum": [
              "REINVEST",
              "TO_ACCOUNT_CASH"
            ],
            "type": "string"
          },
          "endDate": {
            "format": "date-time",
            "type": "string"
          },
          "goal": {
            "type": "number"
          },
          "icon": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "initialInvestment": {
            "type": "number"
          },
          "instrumentShares": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "publicUrl": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AccountBucketInstrumentResult": {
        "properties": {
          "currentShare": {
            "type": "number"
          },
          "expectedShare": {
            "type": "number"
          },
          "issues": {
            "items": {
              "$ref": "#/components/schemas/InstrumentIssue"
            },
            "type": "array",
            "uniqueItems": true
          },
          "ownedQuantity": {
            "type": "number"
          },
          "result": {
            "$ref": "#/components/schemas/InvestmentResult"
          },
          "ticker": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AccountBucketInstrumentsDetailedResponse": {
        "properties": {
          "instruments": {
            "items": {
              "$ref": "#/components/schemas/AccountBucketInstrumentResult"
            },
            "type": "array"
          },
          "settings": {
            "$ref": "#/components/schemas/AccountBucketDetailedResponse"
          }
        },
        "type": "object"
      },
      "AccountBucketResultResponse": {
        "properties": {
          "cash": {
            "description": "Amount of money put into the pie in account currency",
            "type": "number"
          },
          "dividendDetails": {
            "$ref": "#/components/schemas/DividendDetails"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "progress": {
            "description": "Progress of the pie based on the set goal",
            "example": 0.5,
            "type": "number"
          },
          "result": {
            "$ref": "#/components/schemas/InvestmentResult"
          },
          "status": {
            "description": "Status of the pie based on the set goal",
            "enum": [
              "AHEAD",
              "ON_TRACK",
              "BEHIND"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "AccountSummary": {
        "properties": {
          "cash": {
            "$ref": "#/components/schemas/Cash"
          },
          "currency": {
            "description": "Primary account currency in ISO 4217 format.",
            "type": "string"
          },
          "id": {
            "description": "Primary trading account number. This is the same account ID you would see in the Trading 212 web or mobile application.",
            "format": "int64",
            "type": "integer"
          },
          "investments": {
            "$ref": "#/components/schemas/Investments"
          },
          "totalValue": {
            "description": "Investments value in your account's primary currency.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Cash": {
        "properties": {
          "availableToTrade": {
            "description": "Funds available for investing.",
            "type": "number"
          },
          "inPies": {
            "description": "It’s the sum of the cash inside of all pies that is not yet invested.",
            "type": "number"
          },
          "reservedForOrders": {
            "description": "The amount of cash reserved for pending orders. This cash is not available for placing new trades.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "DividendDetails": {
        "properties": {
          "gained": {
            "type": "number"
          },
          "inCash": {
            "type": "number"
          },
          "reinvested": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "DuplicateBucketRequest": {
        "properties": {
          "icon": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EnqueuedReportResponse": {
        "properties": {
          "reportId": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Exchange": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "workingSchedules": {
            "items": {
              "$ref": "#/components/schemas/WorkingSchedule"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Fill": {
        "properties": {
          "filledAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "price": {
            "type": "number"
          },
          "quantity": {
            "type": "number"
          },
          "tradingMethod": {
            "enum": [
              "TOTV",
              "OTC"
            ],
            "type": "string"
          },
          "type": {
            "enum": [
              "TRADE",
              "STOCK_SPLIT",
              "STOCK_DISTRIBUTION",
              "FOP",
              "FOP_CORRECTION",
              "CUSTOM_STOCK_DISTRIBUTION",
              "EQUITY_RIGHTS",
              "SCRIP_STOCK_DIVIDENDS",
              "STOCK_DIVIDENDS",
              "STOCK_ACQUISITION",
              "CASH_AND_STOCK_ACQUISITION",
              "SPIN_OFF"
            ],
            "type": "string"
          },
          "walletImpact": {
            "$ref": "#/components/schemas/FillWalletImpact"
          }
        },
        "type": "object"
      },
      "FillWalletImpact": {
        "properties": {
          "currency": {
            "type": "string"
          },
          "fxRate": {
            "type": "number"
          },
          "netValue": {
            "type": "number"
          },
          "realisedProfitLoss": {
            "type": "number"
          },
          "taxes": {
            "items": {
              "$ref": "#/components/schemas/Tax"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "HistoricalOrder": {
        "properties": {
          "fill": {
            "$ref": "#/components/schemas/Fill"
          },
          "order": {
            "$ref": "#/components/schemas/Order"
          }
        },
        "type": "object"
      },
      "HistoryDividendItem": {
        "properties": {
          "amount": {
            "description": "In account's primary currency.",
            "type": "number"
          },
          "amountInEuro": {
            "type": "number"
          },
          "currency": {
            "description": "The account's primary currency.",
            "type": "string"
          },
          "grossAmountPerShare": {
            "description": "In instrument currency",
            "type": "number"
          },
          "instrument": {
            "$ref": "#/components/schemas/Instrument"
          },
          "paidOn": {
            "format": "date-time",
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "reference": {
            "type": "string"
          },
          "ticker": {
            "type": "string"
          },
          "tickerCurrency": {
            "type": "string"
          },
          "type": {
            "enum": [
              "ORDINARY",
              "BONUS",
              "PROPERTY_INCOME",
              "RETURN_OF_CAPITAL_NON_US",
              "DEMERGER",
              "INTEREST",
              "CAPITAL_GAINS_DISTRIBUTION_NON_US",
              "INTERIM_LIQUIDATION",
              "ORDINARY_MANUFACTURED_PAYMENT",
              "BONUS_MANUFACTURED_PAYMENT",
              "PROPERTY_INCOME_MANUFACTURED_PAYMENT",
              "RETURN_OF_CAPITAL_NON_US_MANUFACTURED_PAYMENT",
              "DEMERGER_MANUFACTURED_PAYMENT",
              "INTEREST_MANUFACTURED_PAYMENT",
              "CAPITAL_GAINS_DISTRIBUTION_NON_US_MANUFACTURED_PAYMENT",
              "INTERIM_LIQUIDATION_MANUFACTURED_PAYMENT",
              "INTEREST_PAID_BY_US_OBLIGORS",
              "INTEREST_PAID_BY_FOREIGN_CORPORATIONS",
              "DIVIDENDS_PAID_BY_US_CORPORATIONS",
              "DIVIDENDS_PAID_BY_FOREIGN_CORPORATIONS",
              "CAPITAL_GAINS",
              "REAL_PROPERTY_INCOME_AND_NATURAL_RESOURCES_ROYALTIES",
              "OTHER_INCOME",
              "QUALIFIED_INVESTMENT_ENTITY",
              "TRUST_DISTRIBUTION",
              "PUBLICLY_TRADED_PARTNERSHIP_DISTRIBUTION",
              "CAPITAL_GAINS_DISTRIBUTION",
              "RETURN_OF_CAPITAL",
              "OTHER_DIVIDEND_EQUIVALENT",
              "TAX_EVENT_1446F_FOR_PUBLICLY_TRADED_SECURITIES",
              "PTP_UNCHARACTERISED_INCOME",
              "MULTIPLE_1042S_TAX_COMPONENTS",
              "DIVIDEND",
              "SHORT_TERM_CAPITAL_GAINS",
              "LONG_TERM_CAPITAL_GAINS",
              "PROPERTY_INCOME_DISTRIBUTION",
              "TAX_EXEMPTED",
              "INTEREST_PAID_BY_US_OBLIGORS_MANUFACTURED_PAYMENT",
              "INTEREST_PAID_BY_FOREIGN_CORPORATIONS_MANUFACTURED_PAYMENT",
              "DIVIDENDS_PAID_BY_US_CORPORATIONS_MANUFACTURED_PAYMENT",
              "DIVIDENDS_PAID_BY_FOREIGN_CORPORATIONS_MANUFACTURED_PAYMENT",
              "CAPITAL_GAINS_MANUFACTURED_PAYMENT",
              "REAL_PROPERTY_INCOME_AND_NATURAL_RESOURCES_ROYALTIES_MANUFACTURED_PAYMENT",
              "OTHER_INCOME_MANUFACTURED_PAYMENT",
              "QUALIFIED_INVESTMENT_ENTITY_MANUFACTURED_PAYMENT",
              "TRUST_DISTRIBUTION_MANUFACTURED_PAYMENT",
              "PUBLICLY_TRADED_PARTNERSHIP_DISTRIBUTION_MANUFACTURED_PAYMENT",
              "CAPITAL_GAINS_DISTRIBUTION_MANUFACTURED_PAYMENT",
              "RETURN_OF_CAPITAL_MANUFACTURED_PAYMENT",
              "OTHER_DIVIDEND_EQUIVALENT_MANUFACTURED_PAYMENT",
              "TAX_EVENT_1446F_FOR_PUBLICLY_TRADED_SECURITIES_MANUFACTURED_PAYMENT",
              "PTP_UNCHARACTERISED_INCOME_MANUFACTURED_PAYMENT",
              "MULTIPLE_1042S_TAX_COMPONENTS_MANUFACTURED_PAYMENT",
              "DIVIDEND_MANUFACTURED_PAYMENT",
              "SHORT_TERM_CAPITAL_GAINS_MANUFACTURED_PAYMENT",
              "LONG_TERM_CAPITAL_GAINS_MANUFACTURED_PAYMENT",
              "PROPERTY_INCOME_DISTRIBUTION_MANUFACTURED_PAYMENT",
              "TAX_EXEMPTED_MANUFACTURED_PAYMENT"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "HistoryTransactionItem": {
        "properties": {
          "amount": {
            "description": "Amount in the currency of the transaction",
            "type": "number"
          },
          "currency": {
            "description": "Currency of the transaction",
            "type": "string"
          },
          "dateTime": {
            "format": "date-time",
            "type": "string"
          },
          "reference": {
            "description": "ID",
            "type": "string"
          },
          "type": {
            "enum": [
              "WITHDRAW",
              "DEPOSIT",
              "FEE",
              "TRANSFER"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Instrument": {
        "description": "Instrument information as given by /instruments endpoint.",
        "properties": {
          "currency": {
            "description": "Instrument currency in ISO 4217 format.",
            "type": "string"
          },
          "isin": {
            "description": "ISIN of the instrument.",
            "type": "string"
          },
          "name": {
            "description": "Name of the instrument.",
            "type": "string"
          },
          "ticker": {
            "description": "Unique instrument identifier.",
            "example": "AAPL_US_EQ",
            "type": "string"
          }
        },
        "type": "object"
      },
      "InstrumentIssue": {
        "properties": {
          "name": {
            "enum": [
              "DELISTED",
              "SUSPENDED",
              "NO_LONGER_TRADABLE",
              "MAX_POSITION_SIZE_REACHED",
              "APPROACHING_MAX_POSITION_SIZE",
              "COMPLEX_INSTRUMENT_APP_TEST_REQUIRED",
              "PRICE_TOO_LOW"
            ],
            "type": "string"
          },
          "severity": {
            "enum": [
              "IRREVERSIBLE",
              "REVERSIBLE",
              "INFORMATIVE"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "InvestmentResult": {
        "properties": {
          "priceAvgInvestedValue": {
            "type": "number"
          },
          "priceAvgResult": {
            "type": "number"
          },
          "priceAvgResultCoef": {
            "type": "number"
          },
          "priceAvgValue": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "Investments": {
        "properties": {
          "currentValue": {
            "description": "Current value of all the investments.",
            "type": "number"
          },
          "realizedProfitLoss": {
            "description": "The all-time realised profit loss from all of the trades executed.",
            "type": "number"
          },
          "totalCost": {
            "description": "The cost basis of your current investments. The total amount of funds you've invested in the shares you currently own.",
            "type": "number"
          },
          "unrealizedProfitLoss": {
            "description": "The potential profit/loss of your current investments, showing how much you could gain or lose if you were to sell them now.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "LimitRequest": {
        "properties": {
          "limitPrice": {
            "example": 100.23,
            "type": "number"
          },
          "quantity": {
            "example": 0.1,
            "type": "number"
          },
          "ticker": {
            "example": "AAPL_US_EQ",
            "type": "string"
          },
          "timeValidity": {
            "$ref": "#/components/schemas/TimeValidity",
            "description": "Expiration",
            "example": "DAY"
          }
        },
        "type": "object"
      },
      "MarketRequest": {
        "properties": {
          "extendedHours": {
            "default": false,
            "example": true,
            "type": "boolean"
          },
          "quantity": {
            "example": 0.1,
            "type": "number"
          },
          "ticker": {
            "example": "AAPL_US_EQ",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Order": {
        "properties": {
          "createdAt": {
            "description": "The ISO 8601 formatted date of when the order was created.",
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "description": "The currency used for the order in ISO 4217 format.",
            "type": "string"
          },
          "extendedHours": {
            "description": "If true, the order is eligible for execution outside regular trading hours.",
            "type": "boolean"
          },
          "filledQuantity": {
            "description": "The number of shares that have been successfully executed. Applicable to quantity orders.",
            "type": "number"
          },
          "filledValue": {
            "description": "The total monetary value of the executed portion of the order. Applicable  to orders placed by value.Note: Placing orders by value is not currently supported via the API but can be done through other Trading 212 platforms.",
            "type": "number"
          },
          "id": {
            "description": "A unique, system-generated identifier for the order.",
            "format": "int64",
            "type": "integer"
          },
          "initiatedFrom": {
            "description": "How the order was initiated.",
            "enum": [
              "API",
              "IOS",
              "ANDROID",
              "WEB",
              "SYSTEM",
              "AUTOINVEST"
            ],
            "type": "string"
          },
          "instrument": {
            "$ref": "#/components/schemas/Instrument"
          },
          "limitPrice": {
            "description": "Applicable to LIMIT and STOP_LIMIT orders.",
            "type": "number"
          },
          "quantity": {
            "description": "The total number of shares requested. Applicable to quantity orders.",
            "type": "number"
          },
          "side": {
            "description": "Indicates whether the order is BUY or SELL.",
            "enum": [
              "BUY",
              "SELL"
            ],
            "type": "string"
          },
          "status": {
            "description": "The current state of the order in its lifecycle.",
            "enum": [
              "LOCAL",
              "UNCONFIRMED",
              "CONFIRMED",
              "NEW",
              "CANCELLING",
              "CANCELLED",
              "PARTIALLY_FILLED",
              "FILLED",
              "REJECTED",
              "REPLACING",
              "REPLACED"
            ],
            "type": "string"
          },
          "stopPrice": {
            "description": "Applicable to STOP and STOP_LIMIT orders.",
            "type": "number"
          },
          "strategy": {
            "description": "The strategy used to place the order, either by QUANTITY or VALUE. The API currently only supports placing orders by QUANTITY.",
            "enum": [
              "QUANTITY",
              "VALUE"
            ],
            "type": "string"
          },
          "ticker": {
            "description": "Unique instrument identifier. Get from the /instruments endpoint",
            "example": "AAPL_US_EQ",
            "type": "string"
          },
          "timeInForce": {
            "$ref": "#/components/schemas/TimeValidity"
          },
          "type": {
            "enum": [
              "LIMIT",
              "STOP",
              "MARKET",
              "STOP_LIMIT"
            ],
            "type": "string"
          },
          "value": {
            "description": "The total monetary value of the order. Applicable to value orders.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "PaginatedResponseHistoricalOrder": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/HistoricalOrder"
            },
            "type": "array"
          },
          "nextPagePath": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaginatedResponseHistoryDividendItem": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/HistoryDividendItem"
            },
            "type": "array"
          },
          "nextPagePath": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaginatedResponseHistoryTransactionItem": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/HistoryTransactionItem"
            },
            "type": "array"
          },
          "nextPagePath": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PieRequest": {
        "properties": {
          "dividendCashAction": {
            "enum": [
              "REINVEST",
              "TO_ACCOUNT_CASH"
            ],
            "type": "string"
          },
          "endDate": {
            "format": "date-time",
            "type": "string"
          },
          "goal": {
            "description": "Total desired value of the pie in account currency",
            "type": "number"
          },
          "icon": {
            "type": "string"
          },
          "instrumentShares": {
            "additionalProperties": {
              "type": "number"
            },
            "example": {
              "AAPL_US_EQ": 0.5,
              "MSFT_US_EQ": 0.5
            },
            "type": "object"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Position": {
        "properties": {
          "averagePricePaid": {
            "description": "Average price paid, in instrument currency, per share.",
            "type": "number"
          },
          "createdAt": {
            "description": "The ISO 8601 formatted date of when the position was opened.",
            "format": "date-time",
            "type": "string"
          },
          "currentPrice": {
            "description": "Current price, in instrument currency, of a single share.",
            "type": "number"
          },
          "instrument": {
            "$ref": "#/components/schemas/Instrument"
          },
          "quantity": {
            "description": "Total quantity of shares owned.",
            "type": "number"
          },
          "quantityAvailableForTrading": {
            "description": "Quantity of shares available for trading.",
            "type": "number"
          },
          "quantityInPies": {
            "description": "Quantity of shares currently used in pie.",
            "type": "number"
          },
          "walletImpact": {
            "$ref": "#/components/schemas/PositionWalletImpact",
            "description": "Collects the financial impact of the position on the user's wallet."
          }
        },
        "type": "object"
      },
      "PositionWalletImpact": {
        "properties": {
          "currency": {
            "description": "The currency code used to represent all the wallet impact information.",
            "type": "string"
          },
          "currentValue": {
            "description": "The current market value of the position.",
            "type": "number"
          },
          "fxImpact": {
            "description": "The positive or negative impact on the position's value due to currency rate changes.",
            "type": "number"
          },
          "totalCost": {
            "description": "The total cost paid for the position.",
            "type": "number"
          },
          "unrealizedProfitLoss": {
            "description": "The unrealized profit & loss for the position. Calculated as currentValue - totalCost.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "PublicReportRequest": {
        "properties": {
          "dataIncluded": {
            "$ref": "#/components/schemas/ReportDataIncluded"
          },
          "timeFrom": {
            "format": "date-time",
            "type": "string"
          },
          "timeTo": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReportDataIncluded": {
        "properties": {
          "includeDividends": {
            "type": "boolean"
          },
          "includeInterest": {
            "type": "boolean"
          },
          "includeOrders": {
            "type": "boolean"
          },
          "includeTransactions": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ReportResponse": {
        "properties": {
          "dataIncluded": {
            "$ref": "#/components/schemas/ReportDataIncluded"
          },
          "downloadLink": {
            "type": "string"
          },
          "reportId": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "Queued",
              "Processing",
              "Running",
              "Canceled",
              "Failed",
              "Finished"
            ],
            "type": "string"
          },
          "timeFrom": {
            "format": "date-time",
            "type": "string"
          },
          "timeTo": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StopLimitRequest": {
        "properties": {
          "limitPrice": {
            "example": 100.23,
            "type": "number"
          },
          "quantity": {
            "example": 0.1,
            "type": "number"
          },
          "stopPrice": {
            "example": 100.23,
            "type": "number"
          },
          "ticker": {
            "example": "AAPL_US_EQ",
            "type": "string"
          },
          "timeValidity": {
            "$ref": "#/components/schemas/TimeValidity",
            "description": "Expiration",
            "example": "DAY"
          }
        },
        "type": "object"
      },
      "StopRequest": {
        "properties": {
          "quantity": {
            "example": 0.1,
            "type": "number"
          },
          "stopPrice": {
            "example": 100.23,
            "type": "number"
          },
          "ticker": {
            "example": "AAPL_US_EQ",
            "type": "string"
          },
          "timeValidity": {
            "$ref": "#/components/schemas/TimeValidity",
            "description": "Expiration",
            "example": "DAY"
          }
        },
        "type": "object"
      },
      "Tax": {
        "properties": {
          "chargedAt": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "name": {
            "enum": [
              "COMMISSION_TURNOVER",
              "CURRENCY_CONVERSION_FEE",
              "FINRA_FEE",
              "FRENCH_TRANSACTION_TAX",
              "PTM_LEVY",
              "STAMP_DUTY",
              "STAMP_DUTY_RESERVE_TAX",
              "TRANSACTION_FEE"
            ],
            "type": "string"
          },
          "quantity": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "TimeEvent": {
        "properties": {
          "date": {
            "format": "date-time",
            "type": "string"
          },
          "type": {
            "enum": [
              "OPEN",
              "CLOSE",
              "BREAK_START",
              "BREAK_END",
              "PRE_MARKET_OPEN",
              "AFTER_HOURS_OPEN",
              "AFTER_HOURS_CLOSE",
              "OVERNIGHT_OPEN"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "TimeValidity": {
        "description": "Specifies how long the order remains active: \n* DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange.\n* GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.",
        "enum": [
          "DAY",
          "GOOD_TILL_CANCEL"
        ],
        "type": "string"
      },
      "TradableInstrument": {
        "properties": {
          "addedOn": {
            "description": "On the platform since",
            "format": "date-time",
            "type": "string"
          },
          "currencyCode": {
            "description": "ISO 4217",
            "example": "USD",
            "maxLength": 3,
            "minLength": 3,
            "type": "string"
          },
          "extendedHours": {
            "type": "boolean"
          },
          "isin": {
            "type": "string"
          },
          "maxOpenQuantity": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "shortName": {
            "type": "string"
          },
          "ticker": {
            "description": "Unique identifier",
            "example": "AAPL_US_EQ",
            "type": "string"
          },
          "type": {
            "enum": [
              "CRYPTOCURRENCY",
              "ETF",
              "FOREX",
              "FUTURES",
              "INDEX",
              "STOCK",
              "WARRANT",
              "CRYPTO",
              "CVR",
              "CORPACT"
            ],
            "example": "ETF",
            "type": "string"
          },
          "workingScheduleId": {
            "description": "Get items in the /exchanges endpoint",
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WorkingSchedule": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "timeEvents": {
            "items": {
              "$ref": "#/components/schemas/TimeEvent"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "authWithSecretKey": {
        "description": "Use your API Key as the username and your API Secret as the password",
        "scheme": "basic",
        "type": "http"
      },
      "legacyApiKeyHeader": {
        "in": "header",
        "name": "Authorization",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "Welcome to the official API reference for the Trading 212 Public API! This\nguide provides all the information you need to start building your own\ntrading applications and integrations.\n\n\n---\n\n# General Information\n\nThis API is currently in **beta** and is under active development. We're\ncontinuously adding new features and improvements, and we welcome your\nfeedback.\n\n\n### Only for Invest and Stocks ISA\n\nThe API described here is enabled and usable only for **Invest and Stocks ISA** account types.\n\n\n\n### API Environments\n\nWe provide two distinct environments for development and trading:\n\n* **Paper Trading (Demo):** `https://demo.trading212.com/api/v0`\n\n* **Live Trading (Real Money):** `https://live.trading212.com/api/v0`\n\nYou can test your applications extensively in the paper trading environment\nwithout risking real funds before moving to live trading.\n\n### ⚠️ API Limitations\n\nPlease be aware of the following limitations for any order placement:\n\n* **Supported account types:**  The Trading 212 Public API is enabled and\n  usable only for **Invest and Stocks ISA** account types.\n\n* **Order execution:** Orders can be executed only in the **primary account\n  currency**\n\n* **Multi-currency:** Multi-currency accounts are not currently supported\n  through the API. Meaning your account, position and result values in the\n  responses will be in the primary account currency.\n\n### Key Concepts\n\n* **Authentication:** Every request to the API must be authenticated using a\n  secure key pair. See the **Authentication** section below for details.\n\n* **Rate Limiting:** All API calls are subject to rate limits to ensure fair\n  usage and stability. See the **Rate Limiting** section for a full\n  explanation.\n\n* **IP Restrictions:** For enhanced security, you can optionally restrict\n  your API keys to a specific set of IP addresses from within your Trading 212\n  account settings.\n\n* **Selling Orders:** To execute a sell order, you must provide a\n  **negative** value for the `quantity` parameter (e.g., `-10.5`). This is a\n  core convention of the API.\n\n---\n\n## Quickstart\n\nThis simple example shows you how to retrieve your account's cash balance.\n\nFirst, you must generate your API keys from within the Trading 212 app. For\ndetailed instructions, please visit our Help Centre:\n\n* [**How to get your Trading 212 API\n  key**](https://helpcentre.trading212.com/hc/en-us/articles/14584770928157-Trading-212-API-key)\n\nOnce you have your **API Key** and **API Secret**, you can make your first\ncall using `cURL`:\n\n```bash\n\n# Step 1: Replace with your actual credentials and Base64-encode them.\n\n# The `-n` is important as it prevents adding a newline character.\n\nCREDENTIALS=$(echo -n \"<YOUR_API_KEY>:<YOUR_API_SECRET>\" | base64)\n\n\n# Step 2: Make the API call to the live environment using the encoded\ncredentials.\n\ncurl -X GET \"https://live.trading212.com/api/v0/equity/account/cash\" \\\n -H \"Authorization: Basic $CREDENTIALS\"\n```\n\n---\n\n# Authentication\n\nThe API uses a secure key pair for authentication on every request. You must\nprovide your **API Key** as the username and your **API Secret** as the\npassword, formatted as an HTTP Basic Authentication header.\n\nThe `Authorization` header is constructed by Base64-encoding your\n`API_KEY:API_SECRET` string and prepending it with `Basic `.\n\n### Building the Authorization Header\n\nHere are examples of how to generate the required value in different\nenvironments.\n\n**Linux or macOS (Terminal)**\n\nYou can use the `echo` and `base64` commands. Remember to use the `-n` flag\nwith `echo` to prevent it from adding a trailing newline, which would\ninvalidate the credential string.\n\n```bash\n\n# This command outputs the required Base64-encoded string for your header.\n\necho -n \"<YOUR_API_KEY>:<YOUR_API_SECRET>\" | base64\n\n```\n\n**Python**\n\nThis simple snippet shows how to generate the full header value.\n\n```python\n\nimport base64\n\n\n# 1. Your credentials\n\napi_key = \"<YOUR_API_KEY>\"\n\napi_secret = \"<YOUR_API_SECRET>\"\n\n\n# 2. Combine them into a single string\n\ncredentials_string = f\"{api_key}:{api_secret}\"\n\n\n# 3. Encode the string to bytes, then Base64 encode it\n\nencoded_credentials =\nbase64.b64encode(credentials_string.encode('utf-8')).decode('utf-8')\n\n\n# 4. The final header value\n\nauth_header = f\"Basic {encoded_credentials}\"\n\n\nprint(auth_header)\n\n```\n\n---\n\n# Rate Limiting\n\nTo ensure high performance and fair access for all users, all API endpoints\nare subject to rate limiting.\n\n\n> **IMPORTANT NOTE:** All rate limits are applied on a per-account basis,\n> regardless of which API key is used or which IP address the request\n> originates from.\n\n\nSpecific rate limits are detailed in the reference for each endpoint.\n\n### Response Headers\n\nEvery API response includes the following headers to help you manage your\nrequest frequency and avoid hitting limits.\n\n* `x-ratelimit-limit`: The total number of requests allowed in the current\n  time period.\n\n* `x-ratelimit-period`: The duration of the time period in seconds.\n\n* `x-ratelimit-remaining`: The number of requests you have left in the\n  current period.\n\n* `x-ratelimit-reset`: A Unix timestamp indicating the exact time when the\n  limit will be fully reset.\n\n* `x-ratelimit-used`: The number of requests you have already made in the\n  current period.\n\n### How It Works\n\nThe rate limiter allows for requests to be made in bursts. For example, an\nendpoint with a limit of `50 requests per 1 minute` does **not** strictly\nmean you can only make one request every 1.2 seconds. Instead, you could:\n\n* Make a burst of all 50 requests in the first 5 seconds of a minute. You\n  would then need to wait for the reset time indicated by the\n  `x-ratelimit-reset` header before making more requests.\n\n* Pace your requests evenly, for example, by making one call every 1.2\n  seconds, ensuring you always stay within the limit.\n\n### Function-Specific Limits\n\nIn addition to the general rate limits on HTTP calls, some actions have\ntheir own functional limits. For example, there is a maximum of **50 pending\norders** allowed per ticker, per account.\n\n# Pagination\n\nAll list endpoints in the API that return a collection of items (such as historical orders, dividends, and transactions) use **cursor-based pagination** to handle large data sets.\n\n### Parameters\n\n* **`limit`** (integer): Specifies the maximum number of items to return in a single request.\n  * **Default:** 20\n  * **Maximum:** 50\n* **`cursor`** (string | number): A pointer to a specific item in the dataset. This tells the API where to start the next page of results.\n\n### How to Paginate\n\nThe easiest way to paginate is by using the `nextPagePath` field returned in the response.\n\n1.  Make your initial request to a list endpoint (e.g., `/api/v0/equity/history/orders`) with an optional `limit` parameter. Do not include a `cursor`.\n2.  The API will return a response object. This object will contain a list of `items` and a `nextPagePath` field.\n3.  If the `nextPagePath` field is `null`, you have reached the end of the data, and there are no more pages.\n4.  If `nextPagePath` is not `null`, **use the entire string value of `nextPagePath`** as the path for your next request. This string contains all the necessary parameters (like `limit` and `cursor`) to get the next page.\n5.  Repeat this process until `nextPagePath` is `null`.\n\n### Example\n\nHere is a step-by-step example of fetching all transactions, 2 at a time.\n\n**Request 1: Get the first page**\n```bash\ncurl -X GET \"https://demo.trading212.com/api/v0/equity/history/orders?limit=2\" \\\n     -u \"API_KEY:API_SECRET\"\n```\n**Response 1: Note the nextPagePath**\n```json\n{\n  \"items\": [\n    { \"id\": 987654321, \"ticker\": \"AAPL_US_EQ\", ... },\n    { \"id\": 987654320, \"ticker\": \"MSFT_US_EQ\", ... }\n  ],\n  \"nextPagePath\": \"/api/v0/equity/history/orders?limit=2&cursor=1760346100000\"\n}\n```\n**Request 2: Use the full nextPagePath for the next request**\n```bash\ncurl -X GET \"https://demo.trading212.com/api/v0/equity/history/orders?limit=2&cursor=1760346100000\" \\\n     -u \"API_KEY:API_SECRET\"\n```\n**Response 2: Get the next page (and a new nextPagePath)**\n```json\n{\n  \"items\": [\n    { \"id\": 987654319, \"ticker\": \"AAPL_US_EQ\", ... },\n    { \"id\": 987654320, \"987654318\": \"MSFT_US_EQ\", ... }\n  ],\n  \"nextPagePath\": \"/api/v0/equity/history/orders?limit=2&cursor=1660015723000\"\n}\n```\n**Request 3: Get the final page**\n```bash\ncurl -X GET \"https://demo.trading212.com/api/v0/equity/history/orders?limit=2&cursor=1660015723000\" \\\n     -u \"API_KEY:API_SECRET\"\n```\nResponse 3: nextPagePath is null, indicating the end\n```json\n{\n  \"items\": [\n    { \"id\": 987654317, \"ticker\": \"AMZN_US_EQ\", ... }\n  ],\n  \"nextPagePath\": null\n}\n```\n\n---\n\n# Useful Links\n\nHere are some additional resources that you may find helpful.\n\n* [**Trading 212 API\n  Terms**](https://www.trading212.com/legal-documentation/API-Terms_EN.pdf)\n\n* [**Trading 212 Community Forum**](https://community.trading212.com/) - A\n  great place to ask questions and share what you've built.\n",
    "title": "Trading 212 Public API",
    "version": "v0"
  },
  "openapi": "3.0.1",
  "paths": {
    "/api/v0/equity/account/summary": {
      "get": {
        "description": "Provides a breakdown of your account's cash and investment metrics,\nincluding available funds, invested capital, and total account value.\n\n**Rate limit:** 1 req / 5s",
        "operationId": "getAccountSummary",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSummary"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( account ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 5s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Get account summary",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/equity/history/dividends": {
      "get": {
        "description": "\n\n**Rate limit:** 6 req / 1m0s",
        "operationId": "dividends",
        "parameters": [
          {
            "description": "Pagination cursor",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Ticker filter",
            "in": "query",
            "name": "ticker",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items: 50",
            "example": 21,
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponseHistoryDividendItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Bad filtering arguments"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( history:dividends ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 6 / 1m0s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Get paid out dividends",
        "tags": [
          "Historical events"
        ]
      }
    },
    "/api/v0/equity/history/exports": {
      "get": {
        "description": "Retrieves a list of all requested CSV reports and their current status. \n\n\n**Asynchronous Workflow:**\n\n1. Call `POST /history/exports` to request a report. You will receive a\n`reportId`.\n\n2. Periodically call this endpoint (`GET /history/exports`) to check the\n`status` of the report corresponding to your `reportId`.\n\n3. Once the status is `Finished`, the `downloadLink` field will contain\na URL to download the CSV file.\n\n**Rate limit:** 1 req / 1m0s",
        "operationId": "getReports",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ReportResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Bad filtering arguments"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Missing Permissions"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 1m0s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "List generated reports",
        "tags": [
          "Historical events"
        ]
      },
      "post": {
        "description": "Initiates the generation of a CSV report containing historical account\ndata. This is an asynchronous operation. The response will include a\n`reportId` which you can use to track the status of the generation\nprocess using the `GET /history/exports` endpoint.\n\n**Rate limit:** 1 req / 30s",
        "operationId": "requestReport",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicReportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnqueuedReportResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Bad filtering arguments"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Missing Permissions"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 30s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Request a CSV report",
        "tags": [
          "Historical events"
        ]
      }
    },
    "/api/v0/equity/history/orders": {
      "get": {
        "description": "\n\n**Rate limit:** 6 req / 1m0s",
        "operationId": "orders_1",
        "parameters": [
          {
            "description": "Pagination cursor",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Ticker filter",
            "in": "query",
            "name": "ticker",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items: 50",
            "example": 21,
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponseHistoricalOrder"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Bad filtering arguments"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( history:orders ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 6 / 1m0s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Get historical orders data",
        "tags": [
          "Historical events"
        ]
      }
    },
    "/api/v0/equity/history/transactions": {
      "get": {
        "description": "Fetch superficial information about movements to and from your account\n\n**Rate limit:** 6 req / 1m0s",
        "operationId": "transactions",
        "parameters": [
          {
            "description": "Pagination cursor",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Retrieve transactions starting from the specified time",
            "in": "query",
            "name": "time",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Max items: 50",
            "example": 21,
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponseHistoryTransactionItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Bad filtering arguments"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( history:transactions ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 6 / 1m0s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Get transactions",
        "tags": [
          "Historical events"
        ]
      }
    },
    "/api/v0/equity/metadata/exchanges": {
      "get": {
        "description": "Retrieves all accessible exchanges and their corresponding working schedules.\nData is refreshed every 10 minutes.\n\n**Rate limit:** 1 req / 30s",
        "operationId": "exchanges",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Exchange"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( metadata ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 30s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Get exchanges metadata",
        "tags": [
          "Instruments"
        ]
      }
    },
    "/api/v0/equity/metadata/instruments": {
      "get": {
        "description": "Retrieves all accessible instruments.\nData is refreshed every 10 minutes.\n\n**Rate limit:** 1 req / 50s",
        "operationId": "instruments",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TradableInstrument"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( metadata ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 50s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Get all available instruments",
        "tags": [
          "Instruments"
        ]
      }
    },
    "/api/v0/equity/orders": {
      "get": {
        "description": "Retrieves a list of all orders that are currently active (i.e., not yet\nfilled, cancelled, or expired). This is useful for monitoring the status\nof your open positions and managing your trading strategy.\n\n**Rate limit:** 1 req / 5s",
        "operationId": "orders",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Order"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( orders:read ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 5s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Get all pending orders",
        "tags": [
          "Orders"
        ]
      }
    },
    "/api/v0/equity/orders/limit": {
      "post": {
        "description": "Creates a new Limit order, which executes at a specified price or\nbetter.\n\n- To place a **buy** order, use a positive `quantity`. The order will\nfill at the `limitPrice` or lower.\n\n- To place a **sell** order, use a negative `quantity`. The order will\nfill at the `limitPrice` or higher.\n\n\n\n**Order Limitations**\n\n* Orders can be executed only in the **main account currency**\n\n\n**Important:** In this beta version, this endpoint is **not\nidempotent**. Sending the same request multiple times may result in\nduplicate orders.\n\n**Rate limit:** 1 req / 2s",
        "operationId": "placeLimitOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LimitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Failed validation"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( orders:execute ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 2s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Place a Limit order",
        "tags": [
          "Orders"
        ]
      }
    },
    "/api/v0/equity/orders/market": {
      "post": {
        "description": "Creates a new Market order, which is an instruction to trade a security\nimmediately at the next available price. \n\n- To place a **buy** order, use a positive `quantity`. \n\n- To place a **sell** order, use a negative `quantity`.\n\n\n- **`extendedHours`**: Set to `true` to allow the order to be filled\noutside of the standard trading session.\n\n- If placed when the market is closed, the order will be queued to\nexecute when the market next opens.\n\nx\n**Order Limitations**\n\n* Orders can be executed only in the **main account currency**\n\n\n**Warning:** Market orders can be subject to price slippage, where the\nfinal execution price may differ from the price at the time of order\nplacement.\n\n\n**Important:** In this beta version, this endpoint is **not\nidempotent**. Sending the same request multiple times may result in\nduplicate orders.\n\n**Rate limit:** 50 req / 1m0s",
        "operationId": "placeMarketOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Failed validation"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( orders:execute ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 50 / 1m0s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Place a Market order",
        "tags": [
          "Orders"
        ]
      }
    },
    "/api/v0/equity/orders/stop": {
      "post": {
        "description": "Creates a new Stop order, which places a Market order once the\n`stopPrice` is reached.\n\n- To place a **buy** stop order, use a positive `quantity`.\n\n- To place a **sell** stop order (commonly a 'stop-loss'), use a\nnegative `quantity`.\n\n\n- The `stopPrice` is triggered by the instrument's **Last Traded Price\n(LTP)**.\n\n\n\n\n**Order Limitations**\n\n* Orders can be executed only in the **main account currency**\n\n**Important:** In this beta version, this endpoint is **not\nidempotent**. Sending the same request multiple times may result in\nduplicate orders.\n\n**Rate limit:** 1 req / 2s",
        "operationId": "placeStopOrder_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StopRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Failed validation"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( orders:execute ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 2s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Place a Stop order",
        "tags": [
          "Orders"
        ]
      }
    },
    "/api/v0/equity/orders/stop_limit": {
      "post": {
        "description": "Creates a new Stop-Limit order, combining features of a Stop and a Limit\norder. The direction of the trade (buy/sell) is determined by the sign\nof the `quantity` field.\n\n\n**Execution Logic:**\n\n1.  When the instrument's **Last Traded Price (LTP)** reaches the\nspecified `stopPrice`, the order is triggered.\n\n2.  A Limit order is then automatically placed at the specified\n`limitPrice`.\n\n\nThis two-step process helps protect against price slippage that can\noccur with a standard Stop order.\n\n\n**Order Limitations**\n\n* Orders can be executed only in the **main account currency**\n\n\n**Important:** In this beta version, this endpoint is **not\nidempotent**. Sending the same request multiple times may result in\nduplicate orders.\n\n**Rate limit:** 1 req / 2s",
        "operationId": "placeStopOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StopLimitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Failed validation"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( orders:execute ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 2s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Place a StopLimit order",
        "tags": [
          "Orders"
        ]
      }
    },
    "/api/v0/equity/orders/{id}": {
      "delete": {
        "description": "Attempts to cancel an active, unfilled order by its unique ID.\nCancellation is not guaranteed if the order is already in the process of\nbeing filled. A successful response indicates the cancellation request\nwas accepted.\n\n**Rate limit:** 50 req / 1m0s",
        "operationId": "cancelOrder",
        "parameters": [
          {
            "description": "The unique identifier of the order you want to cancel.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Failed validation"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( orders:execute ) missing for API key"
          },
          "404": {
            "description": "Order not found"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 50 / 1m0s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Cancel a pending order",
        "tags": [
          "Orders"
        ]
      },
      "get": {
        "description": "Retrieves a single pending order using its unique numerical ID. This is\nuseful for checking the status of a specific order you have previously\nplaced.\n\n**Rate limit:** 1 req / 1s",
        "operationId": "orderById",
        "parameters": [
          {
            "description": "The unique identifier of the order you want to retrieve.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "Order found"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( orders:read ) missing for API key"
          },
          "404": {
            "description": "Order not found"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 1s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Get a pending order by ID",
        "tags": [
          "Orders"
        ]
      }
    },
    "/api/v0/equity/pies": {
      "get": {
        "deprecated": true,
        "description": "Fetches all pies for the account\n\n**Rate limit:** 1 req / 30s",
        "operationId": "getAll",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AccountBucketResultResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( pies:read ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 30s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Fetch all pies",
        "tags": [
          "Pies (Deprecated)"
        ]
      },
      "post": {
        "deprecated": true,
        "description": "Creates a pie for the account by given params\n\n**Rate limit:** 1 req / 5s",
        "operationId": "create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PieRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBucketInstrumentsDetailedResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Bad create request"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( pies:write ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 5s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Create pie",
        "tags": [
          "Pies (Deprecated)"
        ]
      }
    },
    "/api/v0/equity/pies/{id}": {
      "delete": {
        "deprecated": true,
        "description": "Deletes a pie by given id\n\n**Rate limit:** 1 req / 5s",
        "operationId": "delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( pies:write ) missing for API key"
          },
          "404": {
            "description": "Pie not found"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 5s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Delete pie",
        "tags": [
          "Pies (Deprecated)"
        ]
      },
      "get": {
        "deprecated": true,
        "description": "Fetches a pies for the account with detailed information\n\n**Rate limit:** 1 req / 5s",
        "operationId": "getDetailed",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBucketInstrumentsDetailedResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( pies:read ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 5s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Fetch a pie",
        "tags": [
          "Pies (Deprecated)"
        ]
      },
      "post": {
        "deprecated": true,
        "description": "Updates a pie for the account by given params\n\n**Rate limit:** 1 req / 5s",
        "operationId": "update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PieRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBucketInstrumentsDetailedResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Bad update request"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( pies:write ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 5s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Update pie",
        "tags": [
          "Pies (Deprecated)"
        ]
      }
    },
    "/api/v0/equity/pies/{id}/duplicate": {
      "post": {
        "deprecated": true,
        "description": "Duplicates a pie for the account \n\n**Rate limit:** 1 req / 5s",
        "operationId": "duplicatePie",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DuplicateBucketRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBucketInstrumentsDetailedResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Bad update request"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( pies:write ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 5s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Duplicate pie",
        "tags": [
          "Pies (Deprecated)"
        ]
      }
    },
    "/api/v0/equity/positions": {
      "get": {
        "description": "Fetch all open positions for your account\n\n**Rate limit:** 1 req / 1s",
        "operationId": "getPositions",
        "parameters": [
          {
            "example": "AAPL_US_EQ",
            "in": "query",
            "name": "ticker",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Position"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "description": "Bad API key"
          },
          "403": {
            "description": "Scope( portfolio ) missing for API key"
          },
          "408": {
            "description": "Timed-out"
          },
          "429": {
            "description": "Limited: 1 / 1s"
          }
        },
        "security": [
          {
            "authWithSecretKey": [],
            "legacyApiKeyHeader": []
          }
        ],
        "summary": "Fetch all open positions",
        "tags": [
          "Positions"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://demo.trading212.com"
    },
    {
      "url": "https://live.trading212.com"
    }
  ],
  "tags": [
    {
      "description": "Access fundamental information about your trading account. Retrieve details such as your account ID, currency, and current cash balance.",
      "name": "Accounts"
    },
    {
      "description": "Discover what you can trade. These endpoints provide comprehensive lists\nof all tradable instruments and the exchanges they belong to, including\ndetails like tickers and trading hours.",
      "name": "Instruments"
    },
    {
      "description": "**⚠️ Order Limitations**\n\n* Orders can be executed only in the **main account currency**\n\n\nPlace, monitor, and cancel equity trade orders. This section provides the\ncore functionality for programmatically executing your trading strategies\nfor stocks and ETFs.",
      "name": "Orders"
    },
    {
      "description": "Get a real-time overview of all your open positions, including quantity, average price, and current profit or loss.",
      "name": "Positions"
    },
    {
      "description": "Review your account's trading history. Access detailed records of past\norders, dividend payments, and cash transactions, or generate downloadable\nCSV reports for analysis and record-keeping.",
      "name": "Historical events"
    },
    {
      "description": "Manage your investment Pies. Use these endpoints to create, view, update, and delete your custom portfolios, making automated and diversified investing simple.\n\n**Deprecation notice:** The current state of the Pies API, while still operational, won't be further supported and updated.",
      "name": "Pies (Deprecated)"
    }
  ]
}