We do have minimum balance requirements, but to join the API Access program you already have met them. Take a look at what endpoint you’re using. If you didn’t change from demo.tradovateapi.com to live.tradovateapi.com then requests will fail for live accounts.
My request payload is same for both demo account and live account
“action”: “Buy”,
“symbol”: “MYMU1”,
“orderQty”: 1,
“orderType”: “Market”,
“accountSpec”: “myuser id”,
“accountId”: my account id,
“isAutomated”: true
Could anyone please confirm live orders are successful with the above place order API end point - https://live.tradovateapi.com/order/placeorder and Json payload, do we need to add any more details for Live order compared to demo order payload
Where you have "accountSpec": "my user id", do you use the integer userId value from the auth response or the or the string name value? You should use name for accountSpec.
I am using string name only, it’s accepting the request, but giving back with a response as access denied for live account. and same payload giving the order id in demo account.
I am using same account ID, as when checked in other APIs , it’s returning the same account ID for both demo and live accounts. If it is different how to get the live account id.
If you’re getting access to the live API (meaning you’re using the live endpoint for /auth/accessTokenRequest and you get a 200 response with an accessToken field), you can just make a GET request to /account/list. This will return all of the accounts associated with your live user as an array. Each data object represents an Account and the id field is the real account entity ID.
@Alexander, springing off this post - I have no issues with ordering via demo and replay, but live gives the same Access is denied message.
I’m using the live endpoint (https://live.tradovateapi.com/v1) for the /auth/accessTokenRequest, and checking my accountSpec and accountId in the logs, they correspond to the live account. Is the order/ family of endpoints looking for accountSpec XOR / OR / AND accountId? Since my tradovate-api-access-token per the example docs is coming from the live endpoint, I’m not sure what else it could be. isAutomated is set to true since the order handling is software driven without manual intervention on my part.
The only thing I can think of is because I’m running my project as a Node.js app instead of a browser / webpack app, I’m using the v4 function from uuid from NPM to generate deviceID, which may be less consistent than device-uuid per the example projects.
I’ve made sure that my API key is given full access for Orders, and I don’t believe keys are separate for demo and live.
Are there any other things to look into regarding why live orders are being rejected?
The order family of endpoints is looking for both accountSpec and accountId. accountSpec is either ‘VXXXXX’ or ‘DEMOXXXXX’, the accountId is the actual account entity ID. You need to find the account entity ID separately from the auth response. The simplest way to get account info is to use the account/list endpoint (after you’ve been granted an access token), which will return an array of any accounts associated with your user.
Regarding the API key, you should be fine as long as you’ve given the key full access for Orders.
The demo account did not require the non-required fields on my end. This led to a long debugging session when requesting live account. I was able to request read only data like accountList with only providing the required fields, not write fields like placeOrder.