Jump to content
Sign in to follow this  

Recommended Posts

Hello! I have been testing and developing a trading app for the past few months, however recently I have not changed anything in my api calls and have been getting 500 errors coming back. I was wondering if I need to make any changes to my code. Here is an example of a call

POST https://ciapi.cityindex.com/TradingAPI/order/newtradeorder?UserName=****&Session=****

{
"MarketID": 401484347, "Direction": "buy", "BidPrice": 1.10294, "OfferPrice": 1.10335 , "Quantity": 1000 , "OrderID": 0, "positionMethodId": 1, "TradingAccountId": 0, "MarketName": "EUR/USD", "isTrade": true
}

I made a call to account help and the practice account I am using for development is still active and I was able to use this up until last Tuesday when my server crashed. I got it all back up and running but I haven't had a trade since I got it back up. Was there an update to the api? Please let me know if I need to elaborate more.

Share this post


Link to post

Hello Wertmandu,

I'm surprised this call worked previously as it should not have done. This is because you are supplying a TradingAccountId of 0, instead of the actual trading account ID. It should only work when it has the correct ID. 

As a side note: you should send the OrderID as "null" or you can even drop this field entirely.

Try the call with the correct TradingAccountId and see if that resolved the problem.

Kind Regards, PM

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×