Skip to main content

Error Codes

Every error response follows a consistent format. This page lists all HTTP status codes and application-level error codes.

Error Response Format

{
"code": "VALIDATION_ERROR",
"message": "Invalid format for field: account_id",
"details": [
{
"field": "account_id",
"reason": "Expected format: UUID",
"value": "invalid-id"
}
],
"request_id": "req-a1b2c3d4",
"timestamp": "2026-02-28T10:00:00Z",
"documentation_url": "https://docs.korastratum.com/cba/reference/error-codes"
}
FieldTypeDescription
codestringMachine-readable error code
messagestringHuman-readable description
detailsarrayField-level validation errors (if applicable)
request_idstringUnique request ID for support/tracing
timestampstringISO 8601 timestamp
documentation_urlstringLink to relevant documentation

HTTP Status Codes

StatusWhen It Occurs
400Invalid input, missing required fields, malformed JSON
401Missing token, expired token, invalid signature
403Insufficient role, insufficient scope, feature disabled
404Resource not found
409Duplicate resource, idempotency conflict
422Business rule violation (insufficient funds, limit exceeded, unbalanced journal)
429Rate limit exceeded
500Internal server error or database error
503Dependent service unavailable

Application Error Codes

Authentication & Authorization

CodeHTTPDescription
UNAUTHORIZED401No authorization token provided
INVALID_TOKEN401JWT signature verification failed
TOKEN_EXPIRED401Access token has expired
FORBIDDEN403Action not permitted for this user
INSUFFICIENT_ROLE403User role does not meet minimum requirement
INSUFFICIENT_SCOPE403Token scopes do not include required permission

Validation

CodeHTTPDescription
VALIDATION_ERROR400One or more fields failed validation — check details
INVALID_FORMAT400Field value doesn't match expected format
MISSING_FIELD400Required field not provided

Resources

CodeHTTPDescription
RESOURCE_NOT_FOUND404Generic resource not found
ACCOUNT_NOT_FOUND404Account ID or number doesn't exist
CUSTOMER_NOT_FOUND404Customer doesn't exist in this tenant
CONFLICT409Resource state conflict
DUPLICATE_RESOURCE409Resource with this identifier already exists

Idempotency

CodeHTTPDescription
IDEMPOTENCY_CONFLICT409Idempotency key reused with a different request body

Accounts

CodeHTTPDescription
ACCOUNT_FROZEN422Account is frozen — debits are blocked
ACCOUNT_CLOSED422Account is closed — all operations blocked
ACCOUNT_BLOCKED422Account is blocked by compliance

Transactions

CodeHTTPDescription
INSUFFICIENT_FUNDS422Available balance is less than the transfer amount + fees
DAILY_LIMIT_EXCEEDED422Daily transaction limit exceeded
WEEKLY_LIMIT_EXCEEDED422Weekly transaction limit exceeded
MONTHLY_LIMIT_EXCEEDED422Monthly transaction limit exceeded
SINGLE_LIMIT_EXCEEDED422Single transaction amount exceeds limit
DUPLICATE_REFERENCE409Transaction reference already used
TRANSACTION_NOT_FOUND404Transaction ID doesn't exist

General Ledger

CodeHTTPDescription
JOURNAL_NOT_BALANCED422Total debits do not equal total credits
JOURNAL_EMPTY422Journal has no entries
PERIOD_CLOSED422Cannot post to a closed or locked fiscal period
ACCOUNT_CLOSED422Cannot post to a closed GL account
HEADER_ACCOUNT422Cannot post directly to a header account

Rate Limiting

CodeHTTPDescription
RATE_LIMIT_EXCEEDED429Too many requests — includes retry_after field in seconds

System

CodeHTTPDescription
INTERNAL_ERROR500Unexpected server error
DATABASE_ERROR500Database operation failed
SERVICE_UNAVAILABLE503Dependent service (NIBSS, Interswitch) is down

Common Error Scenarios

Unbalanced Journal

{
"code": "JOURNAL_NOT_BALANCED",
"message": "Journal entries do not balance: debits=100000.00, credits=95000.00",
"request_id": "req-abc123"
}

Fix: Ensure total debit amounts equal total credit amounts.

Insufficient Funds

{
"code": "INSUFFICIENT_FUNDS",
"message": "Insufficient funds: available=50000.00, required=100500.00",
"request_id": "req-def456"
}

Fix: The required amount includes fees. Ensure the source account has enough available balance.

Idempotency Conflict

{
"code": "IDEMPOTENCY_CONFLICT",
"message": "Idempotency key already used with a different request body",
"request_id": "req-ghi789"
}

Fix: Use a new idempotency key, or ensure you're sending the exact same request body as the original.

Best Practices

  • Check code, not message — The message may change; the code is stable.
  • Retry on 503 — External provider errors are transient. Retry with exponential backoff.
  • Never retry 4xx — Fix the request before retrying.
  • Use request_id for support — Include it when contacting support for faster resolution.