- 2xx codes indicate success
- 4xx codes indicate an error that failed given the information provided
- 5xx codes indicate an error with Kotani Pay’s servers
Error Response Format
All error responses follow a consistent format:Common Error Codes
| Code | Description |
|---|---|
INVALID_API_KEY | The provided API key is invalid or expired |
INSUFFICIENT_BALANCE | Insufficient balance in the wallet |
INVALID_PHONE_NUMBER | The phone number format is invalid |
TRANSACTION_FAILED | The transaction could not be processed |
RATE_LIMITED | Too many requests - rate limit exceeded |
Best Practices
- Always check the response status before processing the response body
- Implement retry logic for 5xx errors with exponential backoff
- Log error responses for debugging and monitoring
- Handle rate limiting by implementing proper backoff strategies