Phoenix Wallet

Error Handling

Understanding and handling API errors

All API errors return a consistent JSON structure with an error code and message.

Error Response Format

{
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "Wallet has insufficient available balance for this operation"
  }
}

Common Error Codes

CodeHTTP StatusDescription
INSUFFICIENT_BALANCE400Not enough available funds
WALLET_NOT_FOUND404Wallet does not exist
WALLET_FROZEN403Wallet is frozen
RESERVATION_EXPIRED400Reservation has expired
IDEMPOTENCY_CONFLICT409Different request with same idempotency key
POLICY_VIOLATION400Operation violates policy rules

Handling Errors

Always check for both HTTP status codes and error codes in your integration.