{"items":[{"type":"link","label":"Trading 212 Public API","link":"/api","routeSlug":"/api","content":{"contentType":"overview","meta":{"name":"Trading 212 Public API"},"children":[{"nodeType":"container","panels":[{"title":"Download OpenAPI description","titleTranslationKey":"download.description.title","children":[{"kind":"download","label":"api.json","url":"/_bundle/api.json?download"},{"kind":"download","label":"api.yaml","url":"/_bundle/api.yaml?download"}]},{"title":"Overview","titleTranslationKey":"info.title","children":[]},{"title":"Languages","titleTranslationKey":"languages.title","children":[{"kind":"languages","options":[{"key":"curl","title":"curl","lang":"curl"},{"key":"javascript","title":"JavaScript","lang":"JavaScript"},{"key":"node","title":"Node.js","lang":"Node.js"},{"key":"python","title":"Python","lang":"Python"},{"key":"java","title":"Java","lang":"Java"},{"key":"csharp","title":"C#","lang":"C#"},{"key":"php","title":"PHP","lang":"PHP"},{"key":"go","title":"Go","lang":"Go"},{"key":"ruby","title":"Ruby","lang":"Ruby"},{"key":"r","title":"R","lang":"R"},{"key":"payload","title":"Payload","lang":"Payload"}]}]},{"title":"Servers","titleTranslationKey":"servers.title","children":[{"kind":"servers","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"mode":"default"}]}],"children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"header","level":1,"label":"Trading 212 Public API (v0)","showPageActions":true},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":"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---"}],"sectionId":"/api"}],"sectionId":"/api"},{"nodeType":"info-metadata","rows":[{"key":"status","value":"Beta"}]},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":1,"id":"section/general-information"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"General Information"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"This API is currently in "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"beta"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and is under active development. We're"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"continuously adding new features and improvements, and we welcome your"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"feedback."},"children":[]}]}]}]}],"sectionId":"/api/section/general-information"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/general-information/only-for-invest-and-stocks-isa"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Only for Invest and Stocks ISA"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The API described here is enabled and usable only for "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Invest and Stocks ISA"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" account types."},"children":[]}]}]}]}],"sectionId":"/api/section/general-information/only-for-invest-and-stocks-isa"}],"sectionId":"/api/section/general-information/only-for-invest-and-stocks-isa"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/general-information/api-environments"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"API Environments"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"We provide two distinct environments for development and trading:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Paper Trading (Demo):"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"https://demo.trading212.com/api/v0"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Live Trading (Real Money):"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"https://live.trading212.com/api/v0"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"You can test your applications extensively in the paper trading environment"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"without risking real funds before moving to live trading."},"children":[]}]}]}]}],"sectionId":"/api/section/general-information/api-environments"}],"sectionId":"/api/section/general-information/api-environments"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/general-information/api-limitations"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"⚠️ API Limitations"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Please be aware of the following limitations for any order placement:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Supported account types:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"  The Trading 212 Public API is enabled and"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"usable only for "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Invest and Stocks ISA"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" account types."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Order execution:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" Orders can be executed only in the "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"primary account"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"currency"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Multi-currency:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" Multi-currency accounts are not currently supported"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"through the API. Meaning your account, position and result values in the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"responses will be in the primary account currency."},"children":[]}]}]}]}]}]}],"sectionId":"/api/section/general-information/api-limitations"}],"sectionId":"/api/section/general-information/api-limitations"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/general-information/key-concepts"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Key Concepts"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Authentication:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" Every request to the API must be authenticated using a"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"secure key pair. See the "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Authentication"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" section below for details."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate Limiting:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" All API calls are subject to rate limits to ensure fair"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"usage and stability. See the "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate Limiting"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" section for a full"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"explanation."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"IP Restrictions:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" For enhanced security, you can optionally restrict"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"your API keys to a specific set of IP addresses from within your Trading 212"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"account settings."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Selling Orders:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" To execute a sell order, you must provide a"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"negative"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" value for the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"quantity"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" parameter (e.g., "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"-10.5"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"). This is a"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"core convention of the API."},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"hr","attributes":{},"children":[]}]}],"sectionId":"/api/section/general-information/key-concepts"}],"sectionId":"/api/section/general-information/key-concepts"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":2,"id":"section/general-information/quickstart"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Quickstart"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"This simple example shows you how to retrieve your account summary."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"First, you must generate your API keys from within the Trading 212 app. For"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"detailed instructions, please visit our Help Centre:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"https://helpcentre.trading212.com/hc/en-us/articles/14584770928157-Trading-212-API-key"},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"How to get your Trading 212 API"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"key"},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Once you have your "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"API Key"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"API Secret"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", you can make your first"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"call using "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"cURL"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":":"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"\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# `tr -d '\\n'` strips any line wraps added by GNU base64 on Linux.\n\nCREDENTIALS=$(echo -n \"<YOUR_API_KEY>:<YOUR_API_SECRET>\" | base64 | tr -d '\\n')\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/summary\" \\\n -H \"Authorization: Basic $CREDENTIALS\"\n","language":"bash"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"\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# `tr -d '\\n'` strips any line wraps added by GNU base64 on Linux.\n\nCREDENTIALS=$(echo -n \"<YOUR_API_KEY>:<YOUR_API_SECRET>\" | base64 | tr -d '\\n')\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/summary\" \\\n -H \"Authorization: Basic $CREDENTIALS\"\n"},"children":[]}]},{"$$mdtype":"Node","type":"hr","attributes":{},"children":[]}]}],"sectionId":"/api/section/general-information/quickstart"}],"sectionId":"/api/section/general-information/quickstart"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":1,"id":"section/authentication"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Authentication"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The API uses a secure key pair for authentication on every request. You must"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"provide your "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"API Key"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" as the username and your "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"API Secret"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" as the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"password, formatted as an HTTP Basic Authentication header."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"Authorization"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" header is constructed by Base64-encoding your"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"API_KEY:API_SECRET"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" string and prepending it with "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"Basic "},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}],"sectionId":"/api/section/authentication"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/authentication/building-the-authorization-header"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Building the Authorization Header"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Here are examples of how to generate the required value in different"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"environments."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Linux or macOS (Terminal)"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"You can use the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"echo"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"base64"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" commands. Remember to use the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"-n"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" flag"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"with "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"echo"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" to prevent it from adding a trailing newline, which would"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"invalidate the credential string. On Linux, GNU "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"base64"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" wraps output at 76"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"characters by default — pipe through "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"tr -d '\\n'"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" to strip those line breaks."},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"\n# This command outputs the required Base64-encoded string for your header.\n\necho -n \"<YOUR_API_KEY>:<YOUR_API_SECRET>\" | base64 | tr -d '\\n'\n\n","language":"bash"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"\n# This command outputs the required Base64-encoded string for your header.\n\necho -n \"<YOUR_API_KEY>:<YOUR_API_SECRET>\" | base64 | tr -d '\\n'\n\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Python"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"This simple snippet shows how to generate the full header value."},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"\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","language":"python"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"\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"},"children":[]}]},{"$$mdtype":"Node","type":"hr","attributes":{},"children":[]}]}],"sectionId":"/api/section/authentication/building-the-authorization-header"}],"sectionId":"/api/section/authentication/building-the-authorization-header"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":1,"id":"section/rate-limiting"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate Limiting"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"To ensure high performance and fair access for all users, all API endpoints"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"are subject to rate limiting."},"children":[]}]}]},{"$$mdtype":"Node","type":"blockquote","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"IMPORTANT NOTE:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" All rate limits are applied on a per-account basis,"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"regardless of which API key is used or which IP address the request"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"originates from."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Specific rate limits are detailed in the reference for each endpoint."},"children":[]}]}]}]}],"sectionId":"/api/section/rate-limiting"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/rate-limiting/response-headers"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Response Headers"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Every API response includes the following headers to help you manage your"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"request frequency and avoid hitting limits."},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"x-ratelimit-limit"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": The total number of requests allowed in the current"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"time period."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"x-ratelimit-period"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": The duration of the time period in seconds."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"x-ratelimit-remaining"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": The number of requests you have left in the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"current period."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"x-ratelimit-reset"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": A Unix timestamp indicating the exact time when the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"limit will be fully reset."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"x-ratelimit-used"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": The number of requests you have already made in the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"current period."},"children":[]}]}]}]}]}]}],"sectionId":"/api/section/rate-limiting/response-headers"}],"sectionId":"/api/section/rate-limiting/response-headers"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/rate-limiting/how-it-works"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"How It Works"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The rate limiter allows for requests to be made in bursts. For example, an"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"endpoint with a limit of "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"50 requests per 1 minute"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" does "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"not"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" strictly"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"mean you can only make one request every 1.2 seconds. Instead, you could:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Make a burst of all 50 requests in the first 5 seconds of a minute. You"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"would then need to wait for the reset time indicated by the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"x-ratelimit-reset"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" header before making more requests."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Pace your requests evenly, for example, by making one call every 1.2"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"seconds, ensuring you always stay within the limit."},"children":[]}]}]}]}]}]}],"sectionId":"/api/section/rate-limiting/how-it-works"}],"sectionId":"/api/section/rate-limiting/how-it-works"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/rate-limiting/function-specific-limits"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Function-Specific Limits"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"In addition to the general rate limits on HTTP calls, some actions have"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"their own functional limits. For example, there is a maximum of "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"50 pending"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"orders"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" allowed per ticker, per account."},"children":[]}]}]}]}],"sectionId":"/api/section/rate-limiting/function-specific-limits"}],"sectionId":"/api/section/rate-limiting/function-specific-limits"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":1,"id":"section/pagination"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Pagination"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"All list endpoints in the API that return a collection of items (such as historical orders, dividends, and transactions) use "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"cursor-based pagination"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" to handle large data sets."},"children":[]}]}]}]}],"sectionId":"/api/section/pagination"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/pagination/parameters"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Parameters"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"limit"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" (integer): Specifies the maximum number of items to return in a single request."},"children":[]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Default:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 20"},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Maximum:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 50"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"cursor"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" (string | number): A pointer to a specific item in the dataset. This tells the API where to start the next page of results."},"children":[]}]}]}]}]}],"sectionId":"/api/section/pagination/parameters"}],"sectionId":"/api/section/pagination/parameters"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/pagination/how-to-paginate"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"How to Paginate"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The easiest way to paginate is by using the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"nextPagePath"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" field returned in the response."},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Make your initial request to a list endpoint (e.g., "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"/api/v0/equity/history/orders"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":") with an optional "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"limit"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" parameter. Do not include a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"cursor"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The API will return a response object. This object will contain a list of "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"items"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"nextPagePath"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" field."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"If the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"nextPagePath"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" field is "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"null"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", you have reached the end of the data, and there are no more pages."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"If "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"nextPagePath"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is not "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"null"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"use the entire string value of "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"nextPagePath"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" as the path for your next request. This string contains all the necessary parameters (like "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"limit"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"cursor"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":") to get the next page."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Repeat this process until "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"nextPagePath"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"null"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}]}],"sectionId":"/api/section/pagination/how-to-paginate"}],"sectionId":"/api/section/pagination/how-to-paginate"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/pagination/example"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Example"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Here is a step-by-step example of fetching all transactions, 2 at a time."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Request 1: Get the first page"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"curl -X GET \"https://demo.trading212.com/api/v0/equity/history/orders?limit=2\" \\\n     -u \"API_KEY:API_SECRET\"\n","language":"bash"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"curl -X GET \"https://demo.trading212.com/api/v0/equity/history/orders?limit=2\" \\\n     -u \"API_KEY:API_SECRET\"\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Response 1: Note the nextPagePath"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\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","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\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"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Request 2: Use the full nextPagePath for the next request"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"curl -X GET \"https://demo.trading212.com/api/v0/equity/history/orders?limit=2&cursor=1760346100000\" \\\n     -u \"API_KEY:API_SECRET\"\n","language":"bash"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"curl -X GET \"https://demo.trading212.com/api/v0/equity/history/orders?limit=2&cursor=1760346100000\" \\\n     -u \"API_KEY:API_SECRET\"\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Response 2: Get the next page (and a new nextPagePath)"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\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","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\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"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Request 3: Get the final page"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"curl -X GET \"https://demo.trading212.com/api/v0/equity/history/orders?limit=2&cursor=1660015723000\" \\\n     -u \"API_KEY:API_SECRET\"\n","language":"bash"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"curl -X GET \"https://demo.trading212.com/api/v0/equity/history/orders?limit=2&cursor=1660015723000\" \\\n     -u \"API_KEY:API_SECRET\"\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Response 3: nextPagePath is null, indicating the end"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\n  \"items\": [\n    { \"id\": 987654317, \"ticker\": \"AMZN_US_EQ\", ... }\n  ],\n  \"nextPagePath\": null\n}\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\n  \"items\": [\n    { \"id\": 987654317, \"ticker\": \"AMZN_US_EQ\", ... }\n  ],\n  \"nextPagePath\": null\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"hr","attributes":{},"children":[]}]}],"sectionId":"/api/section/pagination/example"}],"sectionId":"/api/section/pagination/example"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":1,"id":"section/useful-links"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Useful Links"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Here are some additional resources that you may find helpful."},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"https://www.trading212.com/legal-documentation/API-Terms_EN.pdf"},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Trading 212 API"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Terms"},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"https://community.trading212.com/"},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Trading 212 Community Forum"},"children":[]}]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" - A"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"great place to ask questions and share what you've built."},"children":[]}]}]}]}]}]}],"sectionId":"/api/section/useful-links"}]}]}},{"type":"group","label":"General Information","link":"/api/section/general-information","routeSlug":"/api/section/general-information","items":[{"type":"link","label":"Only for Invest and Stocks ISA","link":"/api/section/general-information/only-for-invest-and-stocks-isa","routeSlug":"/api/section/general-information/only-for-invest-and-stocks-isa","content":null},{"type":"link","label":"API Environments","link":"/api/section/general-information/api-environments","routeSlug":"/api/section/general-information/api-environments","content":null},{"type":"link","label":"⚠️ API Limitations","link":"/api/section/general-information/api-limitations","routeSlug":"/api/section/general-information/api-limitations","content":null},{"type":"link","label":"Key Concepts","link":"/api/section/general-information/key-concepts","routeSlug":"/api/section/general-information/key-concepts","content":null},{"type":"link","label":"Quickstart","link":"/api/section/general-information/quickstart","routeSlug":"/api/section/general-information/quickstart","content":null}],"content":null},{"type":"group","label":"Authentication","link":"/api/section/authentication","routeSlug":"/api/section/authentication","items":[{"type":"link","label":"Building the Authorization Header","link":"/api/section/authentication/building-the-authorization-header","routeSlug":"/api/section/authentication/building-the-authorization-header","content":null}],"content":null},{"type":"group","label":"Rate Limiting","link":"/api/section/rate-limiting","routeSlug":"/api/section/rate-limiting","items":[{"type":"link","label":"Response Headers","link":"/api/section/rate-limiting/response-headers","routeSlug":"/api/section/rate-limiting/response-headers","content":null},{"type":"link","label":"How It Works","link":"/api/section/rate-limiting/how-it-works","routeSlug":"/api/section/rate-limiting/how-it-works","content":null},{"type":"link","label":"Function-Specific Limits","link":"/api/section/rate-limiting/function-specific-limits","routeSlug":"/api/section/rate-limiting/function-specific-limits","content":null}],"content":null},{"type":"group","label":"Pagination","link":"/api/section/pagination","routeSlug":"/api/section/pagination","items":[{"type":"link","label":"Parameters","link":"/api/section/pagination/parameters","routeSlug":"/api/section/pagination/parameters","content":null},{"type":"link","label":"How to Paginate","link":"/api/section/pagination/how-to-paginate","routeSlug":"/api/section/pagination/how-to-paginate","content":null},{"type":"link","label":"Example","link":"/api/section/pagination/example","routeSlug":"/api/section/pagination/example","content":null}],"content":null},{"type":"link","label":"Useful Links","link":"/api/section/useful-links","routeSlug":"/api/section/useful-links","content":null},{"type":"group","label":"Accounts","link":"/api/accounts","routeSlug":"/api/accounts","items":[{"label":"Get account summary","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/accounts/getaccountsummary","routeSlug":"/api/accounts/getaccountsummary","metadata":{"seo":{"title":"Get account summary","description":"Provides a breakdown of your account's cash and investment metrics,including available funds, invested capital, and total account value."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getAccountSummary","name":"Get account summary","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1account~1summary/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get account summary","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Provides a breakdown of your account's cash and investment metrics,"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"including available funds, invested capital, and total account value."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 5s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/account/summary","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","408","429"],"pointer":"/api/v0/equity/account/summary","href":"accounts/getaccountsummary","openApiOperationId":"getAccountSummary","summary":"Get account summary"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountSummary"}},"schemaId":"components/schemas/AccountSummary"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( account ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 5s"}],"pointer":"/paths/~1api~1v0~1equity~1account~1summary/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/AccountSummary","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountSummary"}}},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/accounts/getaccountsummary"}],"panels":[]}]},"httpPath":"/api/v0/equity/account/summary"}],"content":{"contentType":"group","meta":{"name":"Accounts"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Accounts","showPageActions":true},{"nodeType":"markdoc","content":"Access fundamental information about your trading account. Retrieve details such as your account ID, currency, and current cash balance."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v0/equity/account/summary","summary":"Get account summary","prefix":{"name":"get","color":"get"},"badges":[],"link":"/accounts/getaccountsummary","deprecated":false}]}]}]}]}},{"type":"group","label":"Instruments","link":"/api/instruments","routeSlug":"/api/instruments","items":[{"label":"Get exchanges metadata","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/instruments/exchanges","routeSlug":"/api/instruments/exchanges","metadata":{"seo":{"title":"Get exchanges metadata","description":"Retrieves all accessible exchanges and their corresponding working schedules.Data is refreshed every 10 minutes."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"exchanges","name":"Get exchanges metadata","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1metadata~1exchanges/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get exchanges metadata","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Retrieves all accessible exchanges and their corresponding working schedules."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Data is refreshed every 10 minutes."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 30s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/metadata/exchanges","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","408","429"],"pointer":"/api/v0/equity/metadata/exchanges","href":"instruments/exchanges","openApiOperationId":"exchanges","summary":"Get exchanges metadata"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}},"schemaId":"schema_10"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( metadata ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 30s"}],"pointer":"/paths/~1api~1v0~1equity~1metadata~1exchanges/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_10","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}}},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/instruments/exchanges"}],"panels":[]}]},"httpPath":"/api/v0/equity/metadata/exchanges"},{"label":"Get all available instruments","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/instruments/instruments","routeSlug":"/api/instruments/instruments","metadata":{"seo":{"title":"Get all available instruments","description":"Retrieves all accessible instruments.Data is refreshed every 10 minutes."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"instruments","name":"Get all available instruments","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1metadata~1instruments/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get all available instruments","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Retrieves all accessible instruments."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Data is refreshed every 10 minutes."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 50s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/metadata/instruments","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","408","429"],"pointer":"/api/v0/equity/metadata/instruments","href":"instruments/instruments","openApiOperationId":"instruments","summary":"Get all available instruments"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_11"}},"schemaId":"schema_11"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( metadata ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 50s"}],"pointer":"/paths/~1api~1v0~1equity~1metadata~1instruments/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_11","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_11"}}},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/instruments/instruments"}],"panels":[]}]},"httpPath":"/api/v0/equity/metadata/instruments"}],"content":{"contentType":"group","meta":{"name":"Instruments"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Instruments","showPageActions":true},{"nodeType":"markdoc","content":"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."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v0/equity/metadata/exchanges","summary":"Get exchanges metadata","prefix":{"name":"get","color":"get"},"badges":[],"link":"/instruments/exchanges","deprecated":false},{"title":"/api/v0/equity/metadata/instruments","summary":"Get all available instruments","prefix":{"name":"get","color":"get"},"badges":[],"link":"/instruments/instruments","deprecated":false}]}]}]}]}},{"type":"group","label":"Orders","link":"/api/orders","routeSlug":"/api/orders","items":[{"label":"Get all pending orders","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/orders/orders","routeSlug":"/api/orders/orders","metadata":{"seo":{"title":"Get all pending orders","description":"Retrieves a list of all orders that are currently active (i.e., not yetfilled, cancelled, or expired). This is useful for monitoring the statusof your open positions and managing your trading strategy."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"orders","name":"Get all pending orders","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1orders/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get all pending orders","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Retrieves a list of all orders that are currently active (i.e., not yet"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"filled, cancelled, or expired). This is useful for monitoring the status"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"of your open positions and managing your trading strategy."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 5s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/orders","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","408","429"],"pointer":"/api/v0/equity/orders","href":"orders/orders","openApiOperationId":"orders","summary":"Get all pending orders"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_12"}},"schemaId":"schema_12"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( orders:read ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 5s"}],"pointer":"/paths/~1api~1v0~1equity~1orders/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_12","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_12"}}},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/orders/orders"}],"panels":[]}]},"httpPath":"/api/v0/equity/orders"},{"label":"Place a Limit order","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/orders/placelimitorder","routeSlug":"/api/orders/placelimitorder","metadata":{"seo":{"title":"Place a Limit order","description":"Creates a new Limit order, which executes at a specified price orbetter."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"placeLimitOrder","name":"Place a Limit order","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1orders~1limit/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Place a Limit order","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Creates a new Limit order, which executes at a specified price or"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"better."},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"To place a "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"buy"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" order, use a positive "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"quantity"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". The order will"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"fill at the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"limitPrice"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or lower."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"To place a "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"sell"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" order, use a negative "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"quantity"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". The order will"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"fill at the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"limitPrice"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or higher."},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Order Limitations"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Orders can be executed only in the "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"main account currency"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Important:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" In this beta version, this endpoint is "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"not"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"idempotent"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Sending the same request multiple times may result in"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"duplicate orders."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 2s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/LimitRequest"}},"schemaId":"components/schemas/LimitRequest","pointer":"/paths/~1api~1v0~1equity~1orders~1limit/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v0/equity/orders/limit","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/LimitRequest"}},"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/orders/limit","href":"orders/placelimitorder","openApiOperationId":"placeLimitOrder","summary":"Place a Limit order"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"schemaId":"components/schemas/LimitRequest","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/LimitRequest"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}},"schemaId":"components/schemas/Order"},{"code":"400","description":"Failed validation"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( orders:execute ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 2s"}],"pointer":"/paths/~1api~1v0~1equity~1orders~1limit/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/Order","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/orders/placelimitorder"}],"panels":[]}]},"httpPath":"/api/v0/equity/orders/limit"},{"label":"Place a Market order","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/orders/placemarketorder","routeSlug":"/api/orders/placemarketorder","metadata":{"seo":{"title":"Place a Market order","description":"Creates a new Market order, which is an instruction to trade a securityimmediately at the next available price."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"placeMarketOrder","name":"Place a Market order","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1orders~1market/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Place a Market order","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Creates a new Market order, which is an instruction to trade a security"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"immediately at the next available price."},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"To place a "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"buy"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" order, use a positive "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"quantity"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"To place a "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"sell"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" order, use a negative "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"quantity"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"extendedHours"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": Set to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" to allow the order to be filled"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"outside of the standard trading session."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"If placed when the market is closed, the order will be queued to"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"execute when the market next opens."},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"x"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Order Limitations"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Orders can be executed only in the "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"main account currency"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Warning:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" Market orders can be subject to price slippage, where the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"final execution price may differ from the price at the time of order"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"placement."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Important:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" In this beta version, this endpoint is "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"not"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"idempotent"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Sending the same request multiple times may result in"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"duplicate orders."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 50 req / 1m0s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/MarketRequest"}},"schemaId":"components/schemas/MarketRequest","pointer":"/paths/~1api~1v0~1equity~1orders~1market/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v0/equity/orders/market","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/MarketRequest"}},"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/orders/market","href":"orders/placemarketorder","openApiOperationId":"placeMarketOrder","summary":"Place a Market order"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"schemaId":"components/schemas/MarketRequest","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/MarketRequest"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}},"schemaId":"components/schemas/Order"},{"code":"400","description":"Failed validation"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( orders:execute ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 50 / 1m0s"}],"pointer":"/paths/~1api~1v0~1equity~1orders~1market/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/Order","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/orders/placemarketorder"}],"panels":[]}]},"httpPath":"/api/v0/equity/orders/market"},{"label":"Place a Stop order","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/orders/placestoporder_1","routeSlug":"/api/orders/placestoporder_1","metadata":{"seo":{"title":"Place a Stop order","description":"Creates a new Stop order, which places a Market order once thestopPrice is reached."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"placeStopOrder_1","name":"Place a Stop order","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1orders~1stop/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Place a Stop order","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Creates a new Stop order, which places a Market order once the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"stopPrice"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is reached."},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"To place a "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"buy"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" stop order, use a positive "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"quantity"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"To place a "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"sell"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" stop order (commonly a 'stop-loss'), use a"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"negative "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"quantity"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"stopPrice"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is triggered by the instrument's "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Last Traded Price"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"(LTP)"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Order Limitations"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Orders can be executed only in the "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"main account currency"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Important:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" In this beta version, this endpoint is "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"not"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"idempotent"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Sending the same request multiple times may result in"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"duplicate orders."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 2s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/StopRequest"}},"schemaId":"components/schemas/StopRequest","pointer":"/paths/~1api~1v0~1equity~1orders~1stop/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v0/equity/orders/stop","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/StopRequest"}},"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/orders/stop","href":"orders/placestoporder_1","openApiOperationId":"placeStopOrder_1","summary":"Place a Stop order"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"schemaId":"components/schemas/StopRequest","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/StopRequest"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}},"schemaId":"components/schemas/Order"},{"code":"400","description":"Failed validation"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( orders:execute ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 2s"}],"pointer":"/paths/~1api~1v0~1equity~1orders~1stop/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/Order","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/orders/placestoporder_1"}],"panels":[]}]},"httpPath":"/api/v0/equity/orders/stop"},{"label":"Place a StopLimit order","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/orders/placestoporder","routeSlug":"/api/orders/placestoporder","metadata":{"seo":{"title":"Place a StopLimit order","description":"Creates a new Stop-Limit order, combining features of a Stop and a Limitorder. The direction of the trade (buy/sell) is determined by the signof the quantity field."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"placeStopOrder","name":"Place a StopLimit order","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1orders~1stop_limit/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Place a StopLimit order","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Creates a new Stop-Limit order, combining features of a Stop and a Limit"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"order. The direction of the trade (buy/sell) is determined by the sign"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"of the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"quantity"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" field."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Execution Logic:"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"When the instrument's "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Last Traded Price (LTP)"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" reaches the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"specified "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"stopPrice"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", the order is triggered."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"A Limit order is then automatically placed at the specified"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"limitPrice"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"This two-step process helps protect against price slippage that can"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"occur with a standard Stop order."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Order Limitations"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Orders can be executed only in the "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"main account currency"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Important:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" In this beta version, this endpoint is "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"not"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"idempotent"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Sending the same request multiple times may result in"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"duplicate orders."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 2s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/StopLimitRequest"}},"schemaId":"components/schemas/StopLimitRequest","pointer":"/paths/~1api~1v0~1equity~1orders~1stop_limit/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v0/equity/orders/stop_limit","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/StopLimitRequest"}},"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/orders/stop_limit","href":"orders/placestoporder","openApiOperationId":"placeStopOrder","summary":"Place a StopLimit order"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"schemaId":"components/schemas/StopLimitRequest","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/StopLimitRequest"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}},"schemaId":"components/schemas/Order"},{"code":"400","description":"Failed validation"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( orders:execute ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 2s"}],"pointer":"/paths/~1api~1v0~1equity~1orders~1stop_limit/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/Order","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/orders/placestoporder"}],"panels":[]}]},"httpPath":"/api/v0/equity/orders/stop_limit"},{"label":"Cancel a pending order","deprecated":false,"httpVerb":"delete","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/orders/cancelorder","routeSlug":"/api/orders/cancelorder","metadata":{"seo":{"title":"Cancel a pending order","description":"Attempts to cancel an active, unfilled order by its unique ID.Cancellation is not guaranteed if the order is already in the process ofbeing filled. A successful response indicates the cancellation requestwas accepted."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"cancelOrder","name":"Cancel a pending order","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1orders~1{id}/delete","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Cancel a pending order","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Attempts to cancel an active, unfilled order by its unique ID."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Cancellation is not guaranteed if the order is already in the process of"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"being filled. A successful response indicates the cancellation request"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"was accepted."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 50 req / 1m0s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_13","description":"The unique identifier of the order you want to cancel.","required":true}],"pointer":"/paths/~1api~1v0~1equity~1orders~1{id}/delete/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"DELETE","path":"/api/v0/equity/orders/{id}","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_13"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","408","429"],"pointer":"/api/v0/equity/orders/{id}","href":"orders/cancelorder","openApiOperationId":"cancelOrder","summary":"Cancel a pending order"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK"},{"code":"400","description":"Failed validation"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( orders:execute ) missing for API key"},{"code":"404","description":"Order not found"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 50 / 1m0s"}],"pointer":"/paths/~1api~1v0~1equity~1orders~1{id}/delete/responses"}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/orders/cancelorder"}],"panels":[]}]},"httpPath":"/api/v0/equity/orders/{id}"},{"label":"Get a pending order by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/orders/orderbyid","routeSlug":"/api/orders/orderbyid","metadata":{"seo":{"title":"Get a pending order by ID","description":"Retrieves a single pending order using its unique numerical ID. This isuseful for checking the status of a specific order you have previouslyplaced."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"orderById","name":"Get a pending order by ID","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1orders~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get a pending order by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Retrieves a single pending order using its unique numerical ID. This is"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"useful for checking the status of a specific order you have previously"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"placed."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 1s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_13","description":"The unique identifier of the order you want to retrieve.","required":true}],"pointer":"/paths/~1api~1v0~1equity~1orders~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/orders/{id}","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_13"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","404","408","429"],"pointer":"/api/v0/equity/orders/{id}","href":"orders/orderbyid","openApiOperationId":"orderById","summary":"Get a pending order by ID"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Order found","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}},"schemaId":"components/schemas/Order"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( orders:read ) missing for API key"},{"code":"404","description":"Order not found"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 1s"}],"pointer":"/paths/~1api~1v0~1equity~1orders~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/Order","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Order"}}},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/orders/orderbyid"}],"panels":[]}]},"httpPath":"/api/v0/equity/orders/{id}"}],"content":{"contentType":"group","meta":{"name":"Orders"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Orders","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"⚠️ Order Limitations"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Orders can be executed only in the "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"main account currency"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Place, monitor, and cancel equity trade orders. This section provides the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"core functionality for programmatically executing your trading strategies"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"for stocks and ETFs."},"children":[]}]}]}]}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v0/equity/orders","summary":"Get all pending orders","prefix":{"name":"get","color":"get"},"badges":[],"link":"/orders/orders","deprecated":false},{"title":"/api/v0/equity/orders/limit","summary":"Place a Limit order","prefix":{"name":"post","color":"post"},"badges":[],"link":"/orders/placelimitorder","deprecated":false},{"title":"/api/v0/equity/orders/market","summary":"Place a Market order","prefix":{"name":"post","color":"post"},"badges":[],"link":"/orders/placemarketorder","deprecated":false},{"title":"/api/v0/equity/orders/stop","summary":"Place a Stop order","prefix":{"name":"post","color":"post"},"badges":[],"link":"/orders/placestoporder_1","deprecated":false},{"title":"/api/v0/equity/orders/stop_limit","summary":"Place a StopLimit order","prefix":{"name":"post","color":"post"},"badges":[],"link":"/orders/placestoporder","deprecated":false},{"title":"/api/v0/equity/orders/{id}","summary":"Cancel a pending order","prefix":{"name":"delete","color":"delete"},"badges":[],"link":"/orders/cancelorder","deprecated":false},{"title":"/api/v0/equity/orders/{id}","summary":"Get a pending order by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/orders/orderbyid","deprecated":false}]}]}]}]}},{"type":"group","label":"Positions","link":"/api/positions","routeSlug":"/api/positions","items":[{"label":"Fetch all open positions","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/positions/getpositions","routeSlug":"/api/positions/getpositions","metadata":{"seo":{"title":"Fetch all open positions","description":"Fetch all open positions for your account"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getPositions","name":"Fetch all open positions","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1positions/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Fetch all open positions","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Fetch all open positions for your account"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 1s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"ticker","in":"query","schemaId":"schema_14","example":"AAPL_US_EQ"}],"pointer":"/paths/~1api~1v0~1equity~1positions/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/positions","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[{"name":"ticker","in":"query","required":false,"example":"AAPL_US_EQ","schemaId":"schema_14"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","408","429"],"pointer":"/api/v0/equity/positions","href":"positions/getpositions","openApiOperationId":"getPositions","summary":"Fetch all open positions"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_15"}},"schemaId":"schema_15"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( portfolio ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 1s"}],"pointer":"/paths/~1api~1v0~1equity~1positions/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_15","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_15"}}},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/positions/getpositions"}],"panels":[]}]},"httpPath":"/api/v0/equity/positions"}],"content":{"contentType":"group","meta":{"name":"Positions"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Positions","showPageActions":true},{"nodeType":"markdoc","content":"Get a real-time overview of all your open positions, including quantity, average price, and current profit or loss."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v0/equity/positions","summary":"Fetch all open positions","prefix":{"name":"get","color":"get"},"badges":[],"link":"/positions/getpositions","deprecated":false}]}]}]}]}},{"type":"group","label":"Historical events","link":"/api/historical-events","routeSlug":"/api/historical-events","items":[{"label":"Get paid out dividends","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/historical-events/dividends","routeSlug":"/api/historical-events/dividends","metadata":{"seo":{"title":"Get paid out dividends","description":"Rate limit: 20 req / 1m0s"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"dividends","name":"Get paid out dividends","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1history~1dividends/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get paid out dividends","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 20 req / 1m0s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"cursor","in":"query","schemaId":"schema_13","description":"Pagination cursor"},{"name":"ticker","in":"query","schemaId":"schema_14","description":"Ticker filter"},{"name":"limit","in":"query","schemaId":"schema_16","description":"Max items: 50","example":21}],"pointer":"/paths/~1api~1v0~1equity~1history~1dividends/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/history/dividends","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[{"name":"cursor","in":"query","required":false,"schemaId":"schema_13"},{"name":"ticker","in":"query","required":false,"schemaId":"schema_14"},{"name":"limit","in":"query","required":false,"example":21,"schemaId":"schema_16"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/history/dividends","href":"historical-events/dividends","openApiOperationId":"dividends","summary":"Get paid out dividends"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/PaginatedResponseHistoryDividendItem"}},"schemaId":"components/schemas/PaginatedResponseHistoryDividendItem"},{"code":"400","description":"Bad filtering arguments"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( history:dividends ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 20 / 1m0s"}],"pointer":"/paths/~1api~1v0~1equity~1history~1dividends/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/PaginatedResponseHistoryDividendItem","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/PaginatedResponseHistoryDividendItem"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/historical-events/dividends"}],"panels":[]}]},"httpPath":"/api/v0/equity/history/dividends"},{"label":"List generated reports","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/historical-events/getreports","routeSlug":"/api/historical-events/getreports","metadata":{"seo":{"title":"List generated reports","description":"Retrieves a list of all requested CSV reports and their current status."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getReports","name":"List generated reports","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1history~1exports/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List generated reports","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Retrieves a list of all requested CSV reports and their current status."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Asynchronous Workflow:"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Call "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"POST /history/exports"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" to request a report. You will receive a"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"reportId"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Periodically call this endpoint ("},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"GET /history/exports"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":") to check the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" of the report corresponding to your "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"reportId"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Once the status is "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"Finished"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"downloadLink"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" field will contain"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"a URL to download the CSV file."},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 1m0s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/history/exports","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/history/exports","href":"historical-events/getreports","openApiOperationId":"getReports","summary":"List generated reports"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_17"}},"schemaId":"schema_17"},{"code":"400","description":"Bad filtering arguments"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Missing Permissions"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 1m0s"}],"pointer":"/paths/~1api~1v0~1equity~1history~1exports/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_17","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_17"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/historical-events/getreports"}],"panels":[]}]},"httpPath":"/api/v0/equity/history/exports"},{"label":"Request a CSV report","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/historical-events/requestreport","routeSlug":"/api/historical-events/requestreport","metadata":{"seo":{"title":"Request a CSV report","description":"Initiates the generation of a CSV report containing historical accountdata. This is an asynchronous operation. The response will include areportId which you can use to track the status of the generationprocess using the GET /history/exports endpoint."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"requestReport","name":"Request a CSV report","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1history~1exports/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Request a CSV report","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Initiates the generation of a CSV report containing historical account"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"data. This is an asynchronous operation. The response will include a"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"reportId"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" which you can use to track the status of the generation"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"process using the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"GET /history/exports"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" endpoint."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 30s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/PublicReportRequest"}},"schemaId":"components/schemas/PublicReportRequest","pointer":"/paths/~1api~1v0~1equity~1history~1exports/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v0/equity/history/exports","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/PublicReportRequest"}},"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/history/exports","href":"historical-events/requestreport","openApiOperationId":"requestReport","summary":"Request a CSV report"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"schemaId":"components/schemas/PublicReportRequest","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/PublicReportRequest"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/EnqueuedReportResponse"}},"schemaId":"components/schemas/EnqueuedReportResponse"},{"code":"400","description":"Bad filtering arguments"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Missing Permissions"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 30s"}],"pointer":"/paths/~1api~1v0~1equity~1history~1exports/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/EnqueuedReportResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/EnqueuedReportResponse"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/historical-events/requestreport"}],"panels":[]}]},"httpPath":"/api/v0/equity/history/exports"},{"label":"Get historical orders data","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/historical-events/orders_1","routeSlug":"/api/historical-events/orders_1","metadata":{"seo":{"title":"Get historical orders data","description":"Rate limit: 20 req / 1m0s"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"orders_1","name":"Get historical orders data","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1history~1orders/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get historical orders data","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 20 req / 1m0s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"cursor","in":"query","schemaId":"schema_13","description":"Pagination cursor"},{"name":"ticker","in":"query","schemaId":"schema_14","description":"Ticker filter"},{"name":"limit","in":"query","schemaId":"schema_16","description":"Max items: 50","example":21}],"pointer":"/paths/~1api~1v0~1equity~1history~1orders/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/history/orders","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[{"name":"cursor","in":"query","required":false,"schemaId":"schema_13"},{"name":"ticker","in":"query","required":false,"schemaId":"schema_14"},{"name":"limit","in":"query","required":false,"example":21,"schemaId":"schema_16"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/history/orders","href":"historical-events/orders_1","openApiOperationId":"orders_1","summary":"Get historical orders data"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/PaginatedResponseHistoricalOrder"}},"schemaId":"components/schemas/PaginatedResponseHistoricalOrder"},{"code":"400","description":"Bad filtering arguments"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( history:orders ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 20 / 1m0s"}],"pointer":"/paths/~1api~1v0~1equity~1history~1orders/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/PaginatedResponseHistoricalOrder","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/PaginatedResponseHistoricalOrder"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/historical-events/orders_1"}],"panels":[]}]},"httpPath":"/api/v0/equity/history/orders"},{"label":"Get transactions","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/historical-events/transactions","routeSlug":"/api/historical-events/transactions","metadata":{"seo":{"title":"Get transactions","description":"Fetch superficial information about movements to and from your account"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"transactions","name":"Get transactions","isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1history~1transactions/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get transactions","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Fetch superficial information about movements to and from your account"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 20 req / 1m0s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"cursor","in":"query","schemaId":"schema_14","description":"Pagination cursor"},{"name":"time","in":"query","schemaId":"schema_18","description":"Retrieve transactions starting from the specified time"},{"name":"limit","in":"query","schemaId":"schema_16","description":"Max items: 50","example":21}],"pointer":"/paths/~1api~1v0~1equity~1history~1transactions/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/history/transactions","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[{"name":"cursor","in":"query","required":false,"schemaId":"schema_14"},{"name":"time","in":"query","required":false,"schemaId":"schema_18"},{"name":"limit","in":"query","required":false,"example":21,"schemaId":"schema_16"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/history/transactions","href":"historical-events/transactions","openApiOperationId":"transactions","summary":"Get transactions"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/PaginatedResponseHistoryTransactionItem"}},"schemaId":"components/schemas/PaginatedResponseHistoryTransactionItem"},{"code":"400","description":"Bad filtering arguments"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( history:transactions ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 20 / 1m0s"}],"pointer":"/paths/~1api~1v0~1equity~1history~1transactions/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/PaginatedResponseHistoryTransactionItem","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/PaginatedResponseHistoryTransactionItem"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/historical-events/transactions"}],"panels":[]}]},"httpPath":"/api/v0/equity/history/transactions"}],"content":{"contentType":"group","meta":{"name":"Historical events"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Historical events","showPageActions":true},{"nodeType":"markdoc","content":"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."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v0/equity/history/dividends","summary":"Get paid out dividends","prefix":{"name":"get","color":"get"},"badges":[],"link":"/historical-events/dividends","deprecated":false},{"title":"/api/v0/equity/history/exports","summary":"List generated reports","prefix":{"name":"get","color":"get"},"badges":[],"link":"/historical-events/getreports","deprecated":false},{"title":"/api/v0/equity/history/exports","summary":"Request a CSV report","prefix":{"name":"post","color":"post"},"badges":[],"link":"/historical-events/requestreport","deprecated":false},{"title":"/api/v0/equity/history/orders","summary":"Get historical orders data","prefix":{"name":"get","color":"get"},"badges":[],"link":"/historical-events/orders_1","deprecated":false},{"title":"/api/v0/equity/history/transactions","summary":"Get transactions","prefix":{"name":"get","color":"get"},"badges":[],"link":"/historical-events/transactions","deprecated":false}]}]}]}]}},{"type":"group","label":"Pies (Deprecated)","link":"/api/pies-(deprecated)","routeSlug":"/api/pies-(deprecated)","items":[{"label":"Fetch all pies","deprecated":true,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/pies-(deprecated)/getall","routeSlug":"/api/pies-(deprecated)/getall","metadata":{"seo":{"title":"Fetch all pies","description":"Fetches all pies for the account"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getAll","name":"Fetch all pies","deprecated":true,"isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1pies/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Fetch all pies","isWebhook":false,"deprecated":true,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Fetches all pies for the account"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 30s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/pies","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","408","429"],"pointer":"/api/v0/equity/pies","href":"pies-(deprecated)/getall","openApiOperationId":"getAll","summary":"Fetch all pies"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_19"}},"schemaId":"schema_19"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( pies:read ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 30s"}],"pointer":"/paths/~1api~1v0~1equity~1pies/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_19","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_19"}}},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pies-(deprecated)/getall"}],"panels":[]}]},"httpPath":"/api/v0/equity/pies"},{"label":"Create pie","deprecated":true,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/pies-(deprecated)/create","routeSlug":"/api/pies-(deprecated)/create","metadata":{"seo":{"title":"Create pie","description":"Creates a pie for the account by given params"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"create","name":"Create pie","deprecated":true,"isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1pies/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create pie","isWebhook":false,"deprecated":true,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Creates a pie for the account by given params"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 5s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/PieRequest"}},"schemaId":"components/schemas/PieRequest","pointer":"/paths/~1api~1v0~1equity~1pies/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v0/equity/pies","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/PieRequest"}},"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/pies","href":"pies-(deprecated)/create","openApiOperationId":"create","summary":"Create pie"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"schemaId":"components/schemas/PieRequest","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/PieRequest"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"}},"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"},{"code":"400","description":"Bad create request"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( pies:write ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 5s"}],"pointer":"/paths/~1api~1v0~1equity~1pies/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pies-(deprecated)/create"}],"panels":[]}]},"httpPath":"/api/v0/equity/pies"},{"label":"Delete pie","deprecated":true,"httpVerb":"delete","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/pies-(deprecated)/delete","routeSlug":"/api/pies-(deprecated)/delete","metadata":{"seo":{"title":"Delete pie","description":"Deletes a pie by given id"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"delete","name":"Delete pie","deprecated":true,"isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/delete","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Delete pie","isWebhook":false,"deprecated":true,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Deletes a pie by given id"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 5s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_13","required":true}],"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/delete/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"DELETE","path":"/api/v0/equity/pies/{id}","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_13"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","404","408","429"],"pointer":"/api/v0/equity/pies/{id}","href":"pies-(deprecated)/delete","openApiOperationId":"delete","summary":"Delete pie"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( pies:write ) missing for API key"},{"code":"404","description":"Pie not found"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 5s"}],"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/delete/responses"}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pies-(deprecated)/delete"}],"panels":[]}]},"httpPath":"/api/v0/equity/pies/{id}"},{"label":"Fetch a pie","deprecated":true,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/pies-(deprecated)/getdetailed","routeSlug":"/api/pies-(deprecated)/getdetailed","metadata":{"seo":{"title":"Fetch a pie","description":"Fetches a pies for the account with detailed information"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getDetailed","name":"Fetch a pie","deprecated":true,"isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Fetch a pie","isWebhook":false,"deprecated":true,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Fetches a pies for the account with detailed information"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 5s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_13","required":true}],"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v0/equity/pies/{id}","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_13"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","408","429"],"pointer":"/api/v0/equity/pies/{id}","href":"pies-(deprecated)/getdetailed","openApiOperationId":"getDetailed","summary":"Fetch a pie"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"}},"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( pies:read ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 5s"}],"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"}}},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pies-(deprecated)/getdetailed"}],"panels":[]}]},"httpPath":"/api/v0/equity/pies/{id}"},{"label":"Update pie","deprecated":true,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/pies-(deprecated)/update","routeSlug":"/api/pies-(deprecated)/update","metadata":{"seo":{"title":"Update pie","description":"Updates a pie for the account by given params"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"update","name":"Update pie","deprecated":true,"isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Update pie","isWebhook":false,"deprecated":true,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Updates a pie for the account by given params"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 5s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_13","required":true}],"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/post/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/PieRequest"}},"schemaId":"components/schemas/PieRequest","pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v0/equity/pies/{id}","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_13"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/PieRequest"}},"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/pies/{id}","href":"pies-(deprecated)/update","openApiOperationId":"update","summary":"Update pie"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"schemaId":"components/schemas/PieRequest","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/PieRequest"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"}},"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"},{"code":"400","description":"Bad update request"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( pies:write ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 5s"}],"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pies-(deprecated)/update"}],"panels":[]}]},"httpPath":"/api/v0/equity/pies/{id}"},{"label":"Duplicate pie","deprecated":true,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/api/pies-(deprecated)/duplicatepie","routeSlug":"/api/pies-(deprecated)/duplicatepie","metadata":{"seo":{"title":"Duplicate pie","description":"Duplicates a pie for the account"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"duplicatePie","name":"Duplicate pie","deprecated":true,"isWebhook":false,"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}~1duplicate/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Duplicate pie","isWebhook":false,"deprecated":true,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Duplicates a pie for the account"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rate limit:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" 1 req / 5s"},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"authWithSecretKey","scopes":[],"type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},{"name":"legacyApiKeyHeader","scopes":[],"type":"apiKey","in":"header","paramName":"Authorization"}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_13","required":true}],"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}~1duplicate/post/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/DuplicateBucketRequest"}},"schemaId":"components/schemas/DuplicateBucketRequest","pointer":"/paths/~1api~1v0~1equity~1pies~1{id}~1duplicate/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v0/equity/pies/{id}/duplicate","servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_13"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"authWithSecretKey","type":"http","scheme":"basic"},{"id":"legacyApiKeyHeader","type":"apiKey","name":"Authorization","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/DuplicateBucketRequest"}},"responseCodes":["200","400","401","403","408","429"],"pointer":"/api/v0/equity/pies/{id}/duplicate","href":"pies-(deprecated)/duplicatepie","openApiOperationId":"duplicatePie","summary":"Duplicate pie"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"schemaId":"components/schemas/DuplicateBucketRequest","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/DuplicateBucketRequest"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"OK","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"}},"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"},{"code":"400","description":"Bad update request"},{"code":"401","description":"Bad API key"},{"code":"403","description":"Scope( pies:write ) missing for API key"},{"code":"408","description":"Timed-out"},{"code":"429","description":"Limited: 1 / 5s"}],"pointer":"/paths/~1api~1v0~1equity~1pies~1{id}~1duplicate/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AccountBucketInstrumentsDetailedResponse"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"408"},{"code":"429"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pies-(deprecated)/duplicatepie"}],"panels":[]}]},"httpPath":"/api/v0/equity/pies/{id}/duplicate"}],"content":{"contentType":"group","meta":{"name":"Pies (Deprecated)"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Pies (Deprecated)","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Manage your investment Pies. Use these endpoints to create, view, update, and delete your custom portfolios, making automated and diversified investing simple."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Deprecation notice:"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" The current state of the Pies API, while still operational, won't be further supported and updated."},"children":[]}]}]}]}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v0/equity/pies","summary":"Fetch all pies","prefix":{"name":"get","color":"http-deprecated"},"badges":[],"link":"/pies-(deprecated)/getall","deprecated":true},{"title":"/api/v0/equity/pies","summary":"Create pie","prefix":{"name":"post","color":"http-deprecated"},"badges":[],"link":"/pies-(deprecated)/create","deprecated":true},{"title":"/api/v0/equity/pies/{id}","summary":"Delete pie","prefix":{"name":"delete","color":"http-deprecated"},"badges":[],"link":"/pies-(deprecated)/delete","deprecated":true},{"title":"/api/v0/equity/pies/{id}","summary":"Fetch a pie","prefix":{"name":"get","color":"http-deprecated"},"badges":[],"link":"/pies-(deprecated)/getdetailed","deprecated":true},{"title":"/api/v0/equity/pies/{id}","summary":"Update pie","prefix":{"name":"post","color":"http-deprecated"},"badges":[],"link":"/pies-(deprecated)/update","deprecated":true},{"title":"/api/v0/equity/pies/{id}/duplicate","summary":"Duplicate pie","prefix":{"name":"post","color":"http-deprecated"},"badges":[],"link":"/pies-(deprecated)/duplicatepie","deprecated":true}]}]}]}]}}],"store":{"schemaStore":{"components/schemas/AccountBucketDetailedResponse":{"id":"components/schemas/AccountBucketDetailedResponse","kind":"json-schema","title":"AccountBucketDetailedResponse","data":{"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"}},"components/schemas/AccountBucketInstrumentResult":{"id":"components/schemas/AccountBucketInstrumentResult","kind":"json-schema","title":"AccountBucketInstrumentResult","data":{"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"}},"components/schemas/AccountBucketInstrumentsDetailedResponse":{"id":"components/schemas/AccountBucketInstrumentsDetailedResponse","kind":"json-schema","title":"AccountBucketInstrumentsDetailedResponse","data":{"properties":{"instruments":{"items":{"$ref":"#/components/schemas/AccountBucketInstrumentResult"},"type":"array"},"settings":{"$ref":"#/components/schemas/AccountBucketDetailedResponse"}},"type":"object"}},"components/schemas/AccountBucketResultResponse":{"id":"components/schemas/AccountBucketResultResponse","kind":"json-schema","title":"AccountBucketResultResponse","data":{"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"}},"components/schemas/AccountSummary":{"id":"components/schemas/AccountSummary","kind":"json-schema","title":"AccountSummary","data":{"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"}},"components/schemas/Cash":{"id":"components/schemas/Cash","kind":"json-schema","title":"Cash","data":{"properties":{"availableToTrade":{"description":"Funds available for investing.","type":"number"},"inPies":{"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"It’s the sum of the cash inside of all pies that is not yet invested."},"children":[]}]}]}],"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"}},"components/schemas/DividendDetails":{"id":"components/schemas/DividendDetails","kind":"json-schema","title":"DividendDetails","data":{"properties":{"gained":{"type":"number"},"inCash":{"type":"number"},"reinvested":{"type":"number"}},"type":"object"}},"components/schemas/DuplicateBucketRequest":{"id":"components/schemas/DuplicateBucketRequest","kind":"json-schema","title":"DuplicateBucketRequest","data":{"properties":{"icon":{"type":"string"},"name":{"type":"string"}},"type":"object"}},"components/schemas/EnqueuedReportResponse":{"id":"components/schemas/EnqueuedReportResponse","kind":"json-schema","title":"EnqueuedReportResponse","data":{"properties":{"reportId":{"format":"int64","type":"integer"}},"type":"object"}},"components/schemas/Exchange":{"id":"components/schemas/Exchange","kind":"json-schema","title":"Exchange","data":{"properties":{"id":{"format":"int64","type":"integer"},"name":{"type":"string"},"workingSchedules":{"items":{"$ref":"#/components/schemas/WorkingSchedule"},"type":"array"}},"type":"object"}},"components/schemas/Fill":{"id":"components/schemas/Fill","kind":"json-schema","title":"Fill","data":{"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"}},"components/schemas/FillWalletImpact":{"id":"components/schemas/FillWalletImpact","kind":"json-schema","title":"FillWalletImpact","data":{"properties":{"currency":{"type":"string"},"fxRate":{"type":"number"},"netValue":{"type":"number"},"realisedProfitLoss":{"type":"number"},"taxes":{"items":{"$ref":"#/components/schemas/Tax"},"type":"array"}},"type":"object"}},"components/schemas/HistoricalOrder":{"id":"components/schemas/HistoricalOrder","kind":"json-schema","title":"HistoricalOrder","data":{"properties":{"fill":{"$ref":"#/components/schemas/Fill"},"order":{"$ref":"#/components/schemas/Order"}},"type":"object"}},"components/schemas/HistoryDividendItem":{"id":"components/schemas/HistoryDividendItem","kind":"json-schema","title":"HistoryDividendItem","data":{"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"}},"components/schemas/HistoryTransactionItem":{"id":"components/schemas/HistoryTransactionItem","kind":"json-schema","title":"HistoryTransactionItem","data":{"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","INTEREST_ON_FREE_CASH","LENDING_INTEREST"],"type":"string"}},"type":"object"}},"components/schemas/Instrument":{"id":"components/schemas/Instrument","kind":"json-schema","title":"Instrument","data":{"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"}},"components/schemas/InstrumentIssue":{"id":"components/schemas/InstrumentIssue","kind":"json-schema","title":"InstrumentIssue","data":{"properties":{"name":{"enum":["DELISTED","SUSPENDED","NO_LONGER_TRADABLE","MAX_POSITION_SIZE_REACHED","APPROACHING_MAX_POSITION_SIZE","COMPLEX_INSTRUMENT_APP_TEST_REQUIRED","PRICE_TOO_LOW","IPO_INSTRUMENT_NOT_AVAILABLE","ETN_RECONFIRMATION_REQUIRED","ETN_FINAL_RISK_CONFIRMATION_REQUIRED"],"type":"string"},"severity":{"enum":["IRREVERSIBLE","REVERSIBLE","INFORMATIVE"],"type":"string"}},"type":"object"}},"components/schemas/InvestmentResult":{"id":"components/schemas/InvestmentResult","kind":"json-schema","title":"InvestmentResult","data":{"properties":{"priceAvgInvestedValue":{"type":"number"},"priceAvgResult":{"type":"number"},"priceAvgResultCoef":{"type":"number"},"priceAvgValue":{"type":"number"}},"type":"object"}},"components/schemas/Investments":{"id":"components/schemas/Investments","kind":"json-schema","title":"Investments","data":{"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"}},"components/schemas/LimitRequest":{"id":"components/schemas/LimitRequest","kind":"json-schema","title":"LimitRequest","data":{"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"}},"components/schemas/MarketRequest":{"id":"components/schemas/MarketRequest","kind":"json-schema","title":"MarketRequest","data":{"properties":{"extendedHours":{"default":false,"example":true,"type":"boolean"},"quantity":{"example":0.1,"type":"number"},"ticker":{"example":"AAPL_US_EQ","type":"string"}},"type":"object"}},"components/schemas/Order":{"id":"components/schemas/Order","kind":"json-schema","title":"Order","data":{"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","INSTRUMENT_AUTOINVEST"],"type":"string"},"instrument":{"$ref":"#/components/schemas/Instrument"},"limitPrice":{"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Applicable to LIMIT and STOP_LIMIT orders."},"children":[]}]}]}],"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":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Applicable to STOP and STOP_LIMIT orders."},"children":[]}]}]}],"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"}},"components/schemas/PaginatedResponseHistoricalOrder":{"id":"components/schemas/PaginatedResponseHistoricalOrder","kind":"json-schema","title":"PaginatedResponseHistoricalOrder","data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/HistoricalOrder"},"type":"array"},"nextPagePath":{"type":"string"}},"type":"object"}},"components/schemas/PaginatedResponseHistoryDividendItem":{"id":"components/schemas/PaginatedResponseHistoryDividendItem","kind":"json-schema","title":"PaginatedResponseHistoryDividendItem","data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/HistoryDividendItem"},"type":"array"},"nextPagePath":{"type":"string"}},"type":"object"}},"components/schemas/PaginatedResponseHistoryTransactionItem":{"id":"components/schemas/PaginatedResponseHistoryTransactionItem","kind":"json-schema","title":"PaginatedResponseHistoryTransactionItem","data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/HistoryTransactionItem"},"type":"array"},"nextPagePath":{"type":"string"}},"type":"object"}},"components/schemas/PieRequest":{"id":"components/schemas/PieRequest","kind":"json-schema","title":"PieRequest","data":{"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"}},"components/schemas/Position":{"id":"components/schemas/Position","kind":"json-schema","title":"Position","data":{"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"}},"components/schemas/PositionWalletImpact":{"id":"components/schemas/PositionWalletImpact","kind":"json-schema","title":"PositionWalletImpact","data":{"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. Only applies to positions with instrument currency that differs from the accounts.","type":["number","null"]},"totalCost":{"description":"The total cost paid for the position.","type":"number"},"unrealizedProfitLoss":{"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The unrealized profit & loss for the position. Calculated as currentValue - totalCost."},"children":[]}]}]}],"type":"number"}},"type":"object"}},"components/schemas/PublicReportRequest":{"id":"components/schemas/PublicReportRequest","kind":"json-schema","title":"PublicReportRequest","data":{"properties":{"dataIncluded":{"$ref":"#/components/schemas/ReportDataIncluded"},"timeFrom":{"format":"date-time","type":"string"},"timeTo":{"format":"date-time","type":"string"}},"type":"object"}},"components/schemas/ReportDataIncluded":{"id":"components/schemas/ReportDataIncluded","kind":"json-schema","title":"ReportDataIncluded","data":{"properties":{"includeDividends":{"type":"boolean"},"includeInterest":{"type":"boolean"},"includeOrders":{"type":"boolean"},"includeTransactions":{"type":"boolean"}},"type":"object"}},"components/schemas/ReportResponse":{"id":"components/schemas/ReportResponse","kind":"json-schema","title":"ReportResponse","data":{"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"}},"components/schemas/StopLimitRequest":{"id":"components/schemas/StopLimitRequest","kind":"json-schema","title":"StopLimitRequest","data":{"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"}},"components/schemas/StopRequest":{"id":"components/schemas/StopRequest","kind":"json-schema","title":"StopRequest","data":{"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"}},"components/schemas/Tax":{"id":"components/schemas/Tax","kind":"json-schema","title":"Tax","data":{"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"}},"components/schemas/TimeEvent":{"id":"components/schemas/TimeEvent","kind":"json-schema","title":"TimeEvent","data":{"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"}},"components/schemas/TimeValidity":{"id":"components/schemas/TimeValidity","kind":"json-schema","title":"TimeValidity","data":{"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Specifies how long the order remains active:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you."},"children":[]}]}]}]}],"enum":["DAY","GOOD_TILL_CANCEL"],"type":"string"}},"components/schemas/TradableInstrument":{"id":"components/schemas/TradableInstrument","kind":"json-schema","title":"TradableInstrument","data":{"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"}},"components/schemas/WorkingSchedule":{"id":"components/schemas/WorkingSchedule","kind":"json-schema","title":"WorkingSchedule","data":{"properties":{"id":{"format":"int64","type":"integer"},"timeEvents":{"items":{"$ref":"#/components/schemas/TimeEvent"},"type":"array"}},"type":"object"}},"schema_10":{"kind":"json-schema","data":{"items":{"$ref":"#/components/schemas/Exchange"},"type":"array"},"id":"schema_10"},"schema_11":{"kind":"json-schema","data":{"items":{"$ref":"#/components/schemas/TradableInstrument"},"type":"array"},"id":"schema_11"},"schema_12":{"kind":"json-schema","data":{"items":{"$ref":"#/components/schemas/Order"},"type":"array"},"id":"schema_12"},"schema_13":{"kind":"json-schema","data":{"format":"int64","type":"integer"},"id":"schema_13"},"schema_14":{"kind":"json-schema","data":{"type":"string"},"id":"schema_14"},"schema_15":{"kind":"json-schema","data":{"items":{"$ref":"#/components/schemas/Position"},"type":"array"},"id":"schema_15"},"schema_16":{"kind":"json-schema","data":{"default":20,"format":"int32","type":"integer"},"id":"schema_16"},"schema_17":{"kind":"json-schema","data":{"items":{"$ref":"#/components/schemas/ReportResponse"},"type":"array"},"id":"schema_17"},"schema_18":{"kind":"json-schema","data":{"format":"date-time","type":"string"},"id":"schema_18"},"schema_19":{"kind":"json-schema","data":{"items":{"$ref":"#/components/schemas/AccountBucketResultResponse"},"type":"array"},"id":"schema_19"}},"exampleStore":{},"securitySchemeStore":{"authWithSecretKey":{"id":"authWithSecretKey","type":"http","scheme":"basic","description":"Use your API Key as the username and your API Secret as the password"},"legacyApiKeyHeader":{"id":"legacyApiKeyHeader","type":"apiKey","in":"header","paramName":"Authorization"}},"servers":[{"url":"https://demo.trading212.com"},{"url":"https://live.trading212.com"}],"specType":"openapi"},"options":{"mockServer":{"off":true},"disableRouter":true,"downloadUrls":[{"url":"/_bundle/api.json?download"},{"url":"/_bundle/api.yaml?download"}],"excludeFromSearch":false,"replayFeatures":{"graphql":false},"specType":"openapi","markdocOptions":{"tags":{},"nodes":{},"components":{}},"metadata":{"title":"Trading 212 Public API","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 summary.\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# `tr -d '\\n'` strips any line wraps added by GNU base64 on Linux.\n\nCREDENTIALS=$(echo -n \"<YOUR_API_KEY>:<YOUR_API_SECRET>\" | base64 | tr -d '\\n')\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/summary\" \\\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. On Linux, GNU `base64` wraps output at 76\ncharacters by default — pipe through `tr -d '\\n'` to strip those line breaks.\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 | tr -d '\\n'\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","status":"Beta"}},"baseSlug":"/api","routesMapping":{}}