Skip to main content

Error Handling

All Intotes API errors follow a consistent JSON format, making it easy to handle errors programmatically.

Error Response Format​

{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable description of the error"
}
}
FieldTypeDescription
codestringMachine-readable error code (e.g., INSUFFICIENT_BALANCE)
messagestringHuman-readable English description

HTTP Status Codes​

StatusMeaningWhen
400Bad RequestValidation error or business rule violation
401UnauthorizedMissing or invalid authentication
403ForbiddenInsufficient permissions (e.g., not a creator)
404Not FoundResource does not exist
409ConflictDuplicate resource (e.g., email already registered)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error

Common Error Codes​

Authentication Errors​

CodeDescription
INVALID_CREDENTIALSWrong email or password
EMAIL_NOT_VERIFIEDEmail verification required
TOKEN_EXPIREDAccess token has expired
UNAUTHORIZEDNo valid authentication provided

Trading Errors​

CodeDescription
INSUFFICIENT_BALANCENot enough funds for the trade
MARKET_PAUSEDMarket is not accepting trades
MARKET_RESOLVEDMarket has already been resolved
INVALID_AMOUNTAmount is zero, negative, or exceeds limits
INVALID_PRICEPrice is outside the 0–10000 range
ORDER_NOT_FOUNDOrder does not exist
POSITION_NOT_FOUNDNo position in this market

Withdrawal Errors​

CodeDescription
INSUFFICIENT_BALANCENot enough funds to withdraw
MIN_DEPOSIT_REQUIREDMust deposit at least 1000 RUB before withdrawing
WITHDRAWAL_LIMIT_EXCEEDEDDaily withdrawal limit reached
UNSUPPORTED_TOKENToken is not supported for withdrawal
UNSUPPORTED_NETWORKNetwork is not supported
INVALID_ADDRESSWallet address is invalid
PENDING_WITHDRAWAL_EXISTSA withdrawal is already in progress

P2P Errors​

CodeDescription
AD_NOT_ACTIVEThe P2P ad is no longer available
DUPLICATE_AD_TYPEUser already has an active ad of this type
INVALID_AMOUNTAmount outside ad min/max range
ORDER_ALREADY_PAIDOrder has already been marked as paid
ORDER_ALREADY_COMPLETEDOrder is already completed
ORDER_ALREADY_CANCELLEDOrder was already cancelled
CANNOT_CANCELOrder is in a state that cannot be cancelled
INVALID_PAYMENT_METHODPayment method not accepted by the ad

Card Errors​

CodeDescription
CARD_NOT_ACTIVEPlatform card is not active
INVALID_AMOUNTAmount outside deposit/withdrawal limits
ORDER_ALREADY_PAIDCard order already confirmed
MIN_DEPOSIT_REQUIREDMinimum deposit not met for withdrawals

Error Handling Example​

const response = await fetch('https://intotes.com/api/v1/lmsr/trade', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
market_id: 42,
side: 'buy_yes',
amount_type: 'spend',
amount: 10000,
}),
});

if (!response.ok) {
const { error } = await response.json();

switch (error.code) {
case 'INSUFFICIENT_BALANCE':
showNotification('Not enough funds. Please deposit first.');
break;
case 'MARKET_PAUSED':
showNotification('This market is currently paused.');
break;
default:
showNotification(error.message);
}
}