Exchange Short Grant Code
Request
Response
Non-empty if the request failed
Non-empty if the request failed
Available to: Anonymous callers, from a NinjaTrader-owned origin
Environments: Live. The endpoint is not blocked on Demo, but it only ever redeems codes minted in partner mode, which depends on a partner configuration provisioned on Live.
Rate Limit: 10 requests per hour, 3-second back-off, counts failed requests only
Partners do not normally call this endpoint. It is the other half of the shortGrantCode handoff, and it is called by the NinjaTrader-hosted application that receives your redirect: the application reads the code from the URL, exchanges it here for a real access token, and the user lands signed in. It is documented so you can reason about the full round trip and interpret what a user sees when a handoff fails.
errorText and whether accessToken is present: a restricted session returns an access token alongside a non-empty errorText carrying a warning, so errorText alone misreads that case as a failure.How the Code Is Validated
Four checks run in order, and the first failure ends the request:
tradovate.com, ninjatrader.com, or ninjatrader.dev host. This is why the exchange is performed by the NinjaTrader application rather than by your own page.expires_in when they were minted, and a newer code for the same user supersedes an older one.expectedClientIp the code was bound to.All four failure modes surface as errorText values on an HTTP 200 response. See the table below.
"Invalid code" rather than the original reason, which hides the real cause. Mint a fresh code for every attempt.Because the IP comparison is an exact string match, two textual forms of the same IPv6 address do not match. Emit expectedClientIp in the same form the client will present at redemption.
Field Details
code is the value returned by shortGrantCode. appId and appVersion identify the application redeeming the code and are required. The optional deviceId feeds device-trust evaluation on the resulting session; when it is omitted, the device recorded at the time the code was minted is used instead.
Response Fields
A successful exchange returns the same AccessTokenResponse payload as a normal sign-in: accessToken, mdAccessToken, expirationTime, userId, name, and the account-status flags.
renewAccessToken before expirationTime elapses.Sample Call
Common Failure Scenarios
expectedClientIp the code was bound to.Error Messages
Device-trust evaluation also runs on the resulting session, so a user with two-factor authentication enabled can be denied at redemption for an untrusted device or a new machine. Those denials carry their own errorText values, which are shared with the normal sign-in flow rather than specific to this endpoint.