Error Handling
Robust error handling is essential for building reliable integrations with the Tradovate Partner API. This guide covers error types, response formats, retry strategies, and best practices based on the actual implementation.
Error Response Format
The Tradovate API uses different error response formats depending on the endpoint type and the error level. HTTP level errors will produce and HTTP error code, while business-level errors will produce a 200 level response with more details about the error. Many endpoints use the SimpleResponse schema which includes both success status and error information:
However, we also utilize a validation API, which produces 200 level errors with meaningful field-level validity checks:
HTTP Status Codes
| Code | Description |
|---|---|
400 | A 400 level response usually means that the request was formatted incorrectly. |
401 | A 401 means that you don’t have the correct permissions to view this item. |
404 | A 404 HTTP code means that some portion of the response could not be found, or the endpoint itself is not defined. For example, when sending a request to /user/item?id=1234, a 404 will designate that the user with ID 1234 could not be found. |
423 | 423 preceeds a 429 error - this response means you’re about to be locked out of the API. |
429 | 429 is the re-captcha response. Receiving a 429 means that you are locked out of the API on a rolling 1-hour window - requests made during the window will reset the lockout. |
500 | 500 is an internal server error. This means that an error was produced by the message sent to our server. One common case of a 500 level error is an internal timeout being hit. |
Common Error Scenarios
Authentication Errors
Expired Access Token:
Invalid Credentials:
Validation Errors
The API returns validation errors in a violations array format:
Handle validation errors:
Trading-Specific Error Codes
Order placement and trading operations return specific failure reasons using the PlaceOrderResult schema:
Trading Error Codes (from OpenAPI spec):
AccountClosed- Account is closedAdvancedTrailingStopUnsupported- Advanced trailing stop not supportedAnotherCommandPending- Another command is pendingBackMonthProhibited- Back month trading prohibitedExecutionProviderNotConfigured- Execution provider not configuredExecutionProviderUnavailable- Execution provider unavailableInvalidContract- Contract not found or invalidInvalidPrice- Price outside acceptable rangeLiquidationOnly- Account in liquidation-only modeLiquidationOnlyBeforeExpiration- Liquidation-only before expirationMaxOrderQtyIsNotSpecified- Maximum order quantity not specifiedMaxOrderQtyLimitReached- Order quantity exceeds limitsMaxPosLimitMisconfigured- Position limit misconfiguredMaxPosLimitReached- Position limit exceededMaxTotalPosLimitReached- Total position limit exceededMultipleAccountPlanRequired- Multiple account plan requiredNoQuote- No market data availableNotEnoughLiquidity- Insufficient market liquidityOtherExecutionRelated- Other execution-related errorParentRejected- Parent order rejectedRiskCheckTimeout- Risk validation timed outSessionClosed- Trading session is closedSuccess- Operation successfulTooLate- Request too lateTradingLocked- Account trading is lockedTrailingStopNonOrderQtyModify- Cannot modify trailing stop order quantityUnauthorized- Insufficient permissionsUnknownReason- Unknown error reasonUnsupported- Operation not supported
User Registration Error Codes
User signup operations use specific error codes via the SignUpResponse schema:
Signup Error Codes (from OpenAPI spec):
DataError- Data validation errorEmailAlreadyRegistered- Email address already existsEmailPolicyFailed- Email policy validation failedFailedRecaptcha- ReCaptcha verification failedSuccess- Registration successfulUnknownError- Unexpected errorUserAlreadyExists- User already existsWeakPassword- Password doesn’t meet requirementsWrongChallenge- Challenge verification failedWrongChallengeOrigin- Challenge origin verification failed
Subscription Error Codes
Market data and subscription operations use specific error codes:
Subscription Error Codes (from OpenAPI spec):
ConflictWithExisting- Subscription conflict with existing planDowngradeNotAllowed- Cannot downgrade current planIncompatibleCMEMarketDataSubscriptionPlans- CME plan compatibility issueIncorrectPaymentMethod- Payment method issueInsufficientFunds- Insufficient account balancePaymentProviderError- Payment processing errorPlanDiscontinued- Plan no longer availableSingleTrialOnly- Trial already usedSuccess- Operation successfulUnknownError- Unexpected error
Websocket Error Handling
The Websocket protocol will attempt to mimic our REST API response structure as best as possible. A WebSocket error message will be structured in this format:
Connection Errors
Websocket connections have specific error handling:
Connection State Management
Best Practices
1. Implement Comprehensive Error Handling
Be sure to cover all possible error cases for any domains of the API that your application will touch. Here’s an example of what this implementation might look like in JavaScript:

