Trading 212 API error code
Trading 212 API error: HTTP 403
What does HTTP 403 mean on the Trading 212 API?
The request was refused. The Trading 212 documentation lists 403 as a response but does not describe it, so no cause here is confirmed. Keys carry the permissions chosen when they are created, so a missing permission is one possibility, and the forum records other causes: a Cloudflare block, an order type not allowed on a real money account, and a browser CORS preflight.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
How do I fix HTTP 403?
Read the response body first: an error path such as not-available-in-real-money-account names the cause, and an HTML page from Cloudflare points at the network rather than the key. If the body says nothing, check in the app that the key carries the permission the endpoint needs, and make a new key if it does not.