Error Codes Reference

Complete guide to API error codes and solutions

401INVALID_API_KEY

Invalid API key provided

The API key provided is invalid or has been revoked

Solution

Check your API key is correct and active in your dashboard

Example Response

{
  "success": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API key provided",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
401API_KEY_EXPIRED

API key has expired

Your API key has expired and needs to be regenerated

Solution

Generate a new API key from your dashboard

Example Response

{
  "success": false,
  "error": {
    "code": "API_KEY_EXPIRED",
    "message": "API key has expired",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
401UNAUTHORIZED

Not authorized to access this resource

Your API key does not have permission to access this resource

Solution

Check API key permissions or contact support

Example Response

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Not authorized to access this resource",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
401INVALID_SIGNATURE

Request signature verification failed

The HMAC signature provided does not match the expected signature

Solution

Verify your signature generation logic matches the documentation

Example Response

{
  "success": false,
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Request signature verification failed",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
400VALIDATION_ERROR

Request validation failed

One or more required fields are missing or invalid

Solution

Check request body against API specification

Example Response

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
400INVALID_PHONE_NUMBER

Invalid phone number format

Phone number must be in E.164 format

Solution

Use format: +260977123456 for Zambian numbers

Example Response

{
  "success": false,
  "error": {
    "code": "INVALID_PHONE_NUMBER",
    "message": "Invalid phone number format",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
400INVALID_AMOUNT

Amount must be positive

Payment amount must be greater than zero

Solution

Ensure amount > 0 and meets minimum requirements

Example Response

{
  "success": false,
  "error": {
    "code": "INVALID_AMOUNT",
    "message": "Amount must be positive",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
400INVALID_CURRENCY

Unsupported currency

The currency code provided is not supported

Solution

Use supported currencies: ZMW, USD, EUR, GBP

Example Response

{
  "success": false,
  "error": {
    "code": "INVALID_CURRENCY",
    "message": "Unsupported currency",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
400INVALID_PAYMENT_METHOD

Payment method not supported

The payment method specified is not available

Solution

Use: mobile_money, card, or bank_transfer

Example Response

{
  "success": false,
  "error": {
    "code": "INVALID_PAYMENT_METHOD",
    "message": "Payment method not supported",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
402INSUFFICIENT_FUNDSRetryable

Insufficient funds in account

Customer does not have enough balance to complete payment

Solution

Customer needs to add funds to their account

Example Response

{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_FUNDS",
    "message": "Insufficient funds in account",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
402PAYMENT_DECLINEDRetryable

Payment declined by provider

The payment provider declined the transaction

Solution

Try different payment method or contact provider

Example Response

{
  "success": false,
  "error": {
    "code": "PAYMENT_DECLINED",
    "message": "Payment declined by provider",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
400PAYMENT_EXPIRED

Payment session expired

The payment session has timed out

Solution

Create a new payment transaction

Example Response

{
  "success": false,
  "error": {
    "code": "PAYMENT_EXPIRED",
    "message": "Payment session expired",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
409DUPLICATE_TRANSACTION

Duplicate transaction detected

A transaction with this idempotency key already exists

Solution

Check idempotency key or retrieve existing transaction

Example Response

{
  "success": false,
  "error": {
    "code": "DUPLICATE_TRANSACTION",
    "message": "Duplicate transaction detected",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
400AMOUNT_TOO_HIGH

Amount exceeds limit

Transaction amount exceeds maximum allowed

Solution

Reduce amount or split into multiple payments

Example Response

{
  "success": false,
  "error": {
    "code": "AMOUNT_TOO_HIGH",
    "message": "Amount exceeds limit",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
402CARD_DECLINEDRetryable

Card declined

The card was declined by the issuing bank

Solution

Try different card or contact card issuer

Example Response

{
  "success": false,
  "error": {
    "code": "CARD_DECLINED",
    "message": "Card declined",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
504PROVIDER_TIMEOUTRetryable

Provider timeout

Payment provider did not respond in time

Solution

Retry after a few minutes

Example Response

{
  "success": false,
  "error": {
    "code": "PROVIDER_TIMEOUT",
    "message": "Provider timeout",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
404TRANSACTION_NOT_FOUND

Transaction not found

No transaction exists with the provided ID

Solution

Check transaction ID is correct

Example Response

{
  "success": false,
  "error": {
    "code": "TRANSACTION_NOT_FOUND",
    "message": "Transaction not found",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
404MERCHANT_NOT_FOUND

Merchant not found

No merchant account exists with the provided ID

Solution

Verify merchant ID

Example Response

{
  "success": false,
  "error": {
    "code": "MERCHANT_NOT_FOUND",
    "message": "Merchant not found",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
404CUSTOMER_NOT_FOUND

Customer not found

No customer exists with the provided ID

Solution

Check customer ID or create new customer

Example Response

{
  "success": false,
  "error": {
    "code": "CUSTOMER_NOT_FOUND",
    "message": "Customer not found",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
429RATE_LIMIT_EXCEEDEDRetryable

Too many requests

You have exceeded the rate limit for this endpoint

Solution

Slow down requests and implement exponential backoff

Example Response

{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
429CONCURRENT_LIMIT_EXCEEDEDRetryable

Too many concurrent requests

Too many requests are being processed simultaneously

Solution

Reduce parallelism in your application

Example Response

{
  "success": false,
  "error": {
    "code": "CONCURRENT_LIMIT_EXCEEDED",
    "message": "Too many concurrent requests",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
500INTERNAL_ERRORRetryable

Internal server error

An unexpected error occurred on our servers

Solution

Retry with exponential backoff or contact support

Example Response

{
  "success": false,
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "Internal server error",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
503SERVICE_UNAVAILABLERetryable

Service temporarily unavailable

The service is temporarily down for maintenance

Solution

Retry after delay indicated in Retry-After header

Example Response

{
  "success": false,
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "Service temporarily unavailable",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}
503PROVIDER_UNAVAILABLERetryable

Payment provider unavailable

The payment provider is temporarily unavailable

Solution

Use fallback provider or retry later

Example Response

{
  "success": false,
  "error": {
    "code": "PROVIDER_UNAVAILABLE",
    "message": "Payment provider unavailable",
    "details": {}
  },
  "request_id": "req_abc123xyz789"
}

Error Handling Best Practices

Always Check Status Codes

Use HTTP status codes to determine error type before parsing response

Implement Retry Logic

Use exponential backoff for retryable errors (5xx, 429)

Log Error Details

Include request_id in logs for easier debugging and support

Handle Idempotency

Use idempotency keys to safely retry failed requests

🚧 Development Notice

This payment gateway is currently under development and not authorized for commercial use. We are actively working on:

  • Regulatory compliance and licensing
  • Payment gateway aggregator registration
  • Security audits and certifications
  • Production infrastructure setup
Sandbox Mode Available: Test our payment system without real transactions