Trading 212 API Update šŸ› ļø

Using the API I can sell a partial stock, but when I try to sell all my remaining stock which is exactly 12.09032128 shares using the api It is rejected with the message:

T212 RESPONSE {ā€œsuccessā€:false,ā€œerrorā€:{ā€œtypeā€:ā€œ/api-errors/quantity-precision-mismatchā€,ā€œtitleā€:ā€œError while placing the orderā€,ā€œstatusā€:400,ā€œdetailā€:ā€œinvalid quantity precision 4ā€

I have tried different precision levels but keep getting this message.

I did not there a few codes which I’m surprised are not available. I’m going to open a screen of US stocks to see what results are how there. Surprised SRB is missing thats a well traded small cap in the UK

I’ve also noted Ramsdens is not available LON:RFX which also surprises me!

This is not an API-specific issue. However, LON:SRB has been requested several times before:

1 Like

Regarding this request, the stock (Serabi Gold) trades on an LSE segment that isn’t supported on our platform, which explains why we’re unable to offer it.

1 Like

Hey team! Pagination for this endpoint doesn’t seem to be working properly:

  • For some users, deposits/withdrawals are missing
  • For other users, nextPagePath in the response is always null, and we need to paginate using id + time
  • For other users, nextPagePath in the response is an entire path, like /api/v0/equity/history/orders?cursor={cursor}&limit=5&instrumentCode- and some others it’s just query params, like limit=5&cursor={cursor}&time=2026-01-12T11:12:31.337Z

Can someone take a look? We’re integrating with the API and this particular endpoint is not very consistent.

We’re also using get account summary, get historical orders, get historical dividends. Those work just fine - but historical transactions (cash), has an issue with pagination.

Thank you!

1 Like

Will it ever be possible to trade in a different currency from main account one? When you create an account in europe you can’t select the main currency but it will be fixed to euro, this basically prevents you to ever use API with US stocks

Hi there,
I’ve a question:
Im using he API for a while mainly for getting account information and positions. All works fine. But now I want to create or delete orders but get a response message that its not allowed to do so in ā€˜real money’ accounts.

{'type': '/api-errors/not-available-in-real-money-account', 'title': 'The action is not allowed in real money account', 'status': 403, 'traceId': '600bcd2d5454545454545497c8d'}
Could this be related to account privileges, setting or something else? I’ve granted my API key with all privileges.

I want to use my API Key to link with Portfolio Central. They are asking for my API Secret. On querying this they told me that the Secret was generated one time only when you generate the API Key.

My question is can I generate a second API Key for this website while leaving the original Key in place for the existing connections or am I only allowed one API Key and must re-connect any existing accounts.

Only market orders are supported via the API, for now (no idea why). Since market orders usually execute quickly, there oughtn’t be any market orders available to cancel, in which case perhaps T212 haven’t enabled the delete endpoint for anything in real-money accounts.

I would have expected that you could generate a second key but, if you can’t, you should at least be able to cancel or revoke an existing API key and generate a new one.

Is an API update planned for fetching and quering of pies?

1 Like

There are (or were) pie endpoints, but they’re deprecated and T212 have said they’ve no plans to replace them.

1 Like

Saw that, but they can only be used for the pies in your account. I would like to see the option to get and or query all the pies.

Thank you @strix
Would be good to read that somewhere in the API docs or maybe I missed that.
Hopefully they will release all of the order possibilities for the live trading soon!

1 Like

Hmm. I guess you mean published or shared pies. I suspect it may not have occurred to the development team to provide support for that and, if it has, then they probably have different priorities.

Last I knew, the real-money API doesn’t even support limit orders which strikes me as a glaring omission. I’d love to know what the technical obstacle to that is.

That is true.

Totaly agree, thanks for you time @strix

1 Like

I am not sure if I am doing something wrong, I can use the API in the live server but I get 401 whenever I use it with the demo server. I tried all 3 possible combinations of authentications, by passing only the user and password (key and secret), by passing only the authorization header with the basic base64 key+secret, and the combination of the 2. In the live server I am able to authenticate with all 3 methods and get a correct response from the various API endpoints I tested, from the demo all 3 fail.

Ok I finally figured it out, perhaps it’s already explained somewhere but I couldn’t find in the documentation. In case someone struggles like I did, the solution is that it is necessary to create an API key in the Demo account too. After switching to the Demo account I went to Settings → API (Beta) and realised that my keys weren’t there, so I created a new key and in demo server everything works with the new key.