Skip to main content

Error Codes Reference

Comprehensive reference of all error codes returned by OLIVE APIs.

Error Response Format

All errors follow this structure:
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human readable message",
    "details": {
      "field": "Additional context"
    }
  }
}

HTTP Status Codes

CodeNameDescription
400Bad RequestInvalid request format or parameters
401UnauthorizedInvalid or missing authentication
402Payment RequiredInsufficient balance or funds
403ForbiddenAuthenticated but not authorized
404Not FoundResource does not exist
409ConflictResource already exists
422Unprocessable EntityValidation failed
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer-side error
503Service UnavailableTemporary outage

Authentication Errors

CodeHTTPDescriptionResolution
AUTH_MISSING401No auth header providedInclude Authorization header
AUTH_INVALID401Token/key is invalidCheck credentials
AUTH_EXPIRED401Token has expiredRefresh or re-authenticate
SIGNATURE_INVALID401HMAC signature failedCheck signing algorithm
SIGNATURE_EXPIRED401Timestamp too oldSync clock, retry
API_KEY_REVOKED401API key has been revokedContact admin for new key
INSUFFICIENT_SCOPE403Key lacks required scopeUse key with proper scope

Transaction Errors

CodeHTTPDescriptionResolution
INSUFFICIENT_BALANCE402Not enough fundsCheck balance before transaction
DAILY_LIMIT_EXCEEDED400Daily transaction limit reachedWait for next day or upgrade KYC
MONTHLY_LIMIT_EXCEEDED400Monthly limit reachedWait for next month
TRANSACTION_LIMIT_EXCEEDED400Single transaction too largeReduce amount
DUPLICATE_REQUEST409Request ID already usedUse unique request_id
TRANSACTION_FAILED500General processing errorRetry with same request_id
RECIPIENT_NOT_FOUND404Recipient doesn’t existVerify recipient ID

Card Errors

CodeHTTPDescriptionResolution
CARD_NOT_FOUND404Card serial not in systemVerify serial number
CARD_ALREADY_LINKED409Card linked to another subscriberCard cannot be reused
CARD_BLOCKED400Card is blockedUnblock card first
CARD_DISABLED400Card permanently disabledRequest new card
INVALID_PIN400Wrong PIN enteredCheck PIN (max 3 attempts)
PIN_LOCKED400Too many wrong PIN attemptsContact support to unlock

Subscriber Errors

CodeHTTPDescriptionResolution
SUBSCRIBER_NOT_FOUND404Subscriber doesn’t existCheck ID/phone number
PHONE_ALREADY_REGISTERED409Phone number in useUse different phone
KYC_REQUIRED400Higher KYC level neededUpgrade KYC level
ACCOUNT_SUSPENDED403Account is suspendedContact support
ACCOUNT_BLOCKED403Account is blockedContact compliance
INVALID_PHONE_FORMAT400Phone number format wrongUse +232XXXXXXXX format

Agent Errors

CodeHTTPDescriptionResolution
AGENT_NOT_FOUND404Agent doesn’t existVerify agent ID
INSUFFICIENT_FLOAT402Agent lacks floatRequest float from master
AGENT_SUSPENDED403Agent is suspendedContact admin
FLOAT_TRANSFER_DENIED403Cannot transfer to this agentCheck agent relationship

POS/Processor Errors

CodeHTTPDescriptionResolution
PROCESSOR_NOT_FOUND404Processor doesn’t existVerify processor ID
PROCESSOR_SUSPENDED403Processor is suspendedContact admin
INVALID_HMAC401HMAC signature invalidCheck secret and algorithm
TERMINAL_NOT_REGISTERED401Unknown terminalRegister terminal first

PEP Access Errors

CodeHTTPDescriptionResolution
PEP_ACCESS_DENIED403Not authorized for PEP accessRequest PEP authorization
INVALID_OTP400Wrong or expired OTPRequest new OTP
OTP_EXPIRED400OTP has expiredRequest new OTP
TOO_MANY_OTP_ATTEMPTS429Too many failed OTP attemptsWait before retrying

Compliance Errors

CodeHTTPDescriptionResolution
COMPLIANCE_HOLD403Transaction flagged for reviewWait for compliance clearance
BLOCKED_RECIPIENT403Recipient is on blocklistCannot transact with this party
HIGH_RISK_TRANSACTION400Transaction blocked by rulesContact compliance

Validation Errors

CodeHTTPDescriptionResolution
VALIDATION_FAILED422Input validation failedCheck error details
REQUIRED_FIELD_MISSING400Required field not providedInclude all required fields
INVALID_AMOUNT400Amount format invalidUse positive integer (cents)
INVALID_CURRENCY400Unknown currency codeUse SLE or USD

Rate Limit Errors

CodeHTTPDescriptionResolution
RATE_LIMITED429Too many requestsWait and retry

Rate Limit Headers

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1704067200
Retry-After: 60

Error Handling Best Practices

Idempotency

Always include request_id for safe retries on failures

Exponential Backoff

Use exponential backoff for rate limit and server errors

Error Logging

Log full error responses for debugging

Graceful Degradation

Handle errors gracefully in your application

Retry Strategy

async function withRetry(fn, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      return await fn();
    } catch (error) {
      if (error.status === 429 || error.status >= 500) {
        const delay = Math.pow(2, i) * 1000; // 1s, 2s, 4s
        await new Promise(r => setTimeout(r, delay));
        continue;
      }
      throw error; // Don't retry 4xx errors
    }
  }
  throw new Error('Max retries exceeded');
}