Developer Reference

Error Codes & Handling

MONIEFLEX uses conventional HTTP status codes to indicate the outcome of API requests. These codes help you easily identify if the request was successful, encountered an error, or if there's an issue with the servers.

HTTP Response Codes

HTTP CodeMeaningDescription
200, 201OK / CreatedThe request was successful, and the operation was completed as expected.
400Bad RequestThe request was invalid, usually due to missing or incorrect parameters.
401UnauthorizedNo valid API key or Bearer token was provided, or the key is invalid.
403ForbiddenThe API key does not have permission or merchant KYC verification is required.
404Not FoundThe requested resource could not be found, possibly due to an incorrect URL or ID.
409ConflictThe request conflicts with an existing record, such as a duplicate reference.
422Unprocessable EntityValidation error — check required fields and data formats.
429Too Many RequestsToo many requests were sent in a short period. Please implement exponential backoff.
500, 502, 503, 504Server ErrorsInternal server errors. Rare, but if persistent please contact support.

Troubleshooting Tips

  • 400 & 422 Errors: Double-check request parameters to ensure all required fields are included and formatted properly.
  • 401 & 403 Errors: Confirm your secret key and api-key are correctly passed in the headers.
  • 429 Errors: Implement an exponential backoff retry strategy with jitter.
  • 5xx Errors: These indicate upstream gateway issues; please retry or contact support.

Standard Error Response Format

json
{
  "status": false,
  "code": "invalid_reference",
  "message": "customer_ref must be at least 3 characters"
}