Skip to content

Errors

All errors return a consistent JSON structure. View full error definitions in API Reference →

json
{
  "error": {
    "type": "invalid_request_error",
    "code": "parameter_invalid",
    "message": "Amount must be at least 1 USDT",
    "param": "amount",
    "doc_url": "https://ironixpay.com/guide/errors#parameter_invalid"
  }
}

Error Types

TypeDescription
invalid_request_errorBad request — missing/invalid parameters, auth failure
api_errorInternal server error (rare, please retry)
idempotency_errorIdempotency key reused with different body

Error Codes

CodeHTTPWhen
authentication_failed401Missing or invalid API key
parameter_invalid400Invalid request parameter (check param field)
resource_missing404Resource not found
permission_denied403Insufficient permissions
conflict409State conflict (e.g., session already completed)
idempotency_conflict409Same idempotency key, different request body
session_expired410Session has expired
environment_mismatch403API key environment does not match the target network
service_unavailable503Service temporarily unavailable (e.g., address pool exhausted)
api_error500Internal server error

Handling Errors

javascript
try {
  const session = await fetch('/v1/checkout/sessions', { ... });
  const data = await session.json();

  if (!session.ok) {
    const { error } = data;
    console.error(`[${error.type}] ${error.code}: ${error.message}`);

    if (error.code === 'authentication_failed') {
      // Check your API key
    } else if (error.code === 'parameter_invalid') {
      // Fix the parameter indicated by error.param
    }
  }
} catch (err) {
  // Network error — safe to retry
}

HTTP Status Codes

StatusMeaning
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
409Conflict
410Gone
500Internal Server Error
503Service Unavailable