HooPay Docs
| API Reference v1.0
Sandbox
← Home

Error Codes

Reference for all error codes returned by the API.

HTTP Status Codes

Code Meaning
200Success
201Created
400Bad Request - Invalid parameters
401Unauthorized - Invalid API key or signature
403Forbidden - IP not whitelisted or key disabled
404Not Found - Resource doesn't exist
409Conflict - Duplicate reference_id
422Unprocessable - Validation failed
429Too Many Requests - Rate limited
500Internal Server Error

Error Codes

Authentication Errors

Code Description
UNAUTHORIZEDInvalid or missing API key
INVALID_SIGNATUREHMAC signature doesn't match
API_KEY_DISABLEDAPI key has been deactivated
IP_NOT_WHITELISTEDRequest IP not in whitelist

Validation Errors

Code Description
VALIDATION_ERRORRequest failed validation
INVALID_AMOUNTAmount is invalid or out of range
INVALID_CURRENCYUnsupported currency code
MISSING_REQUIRED_FIELDRequired field not provided

Business Errors

Code Description
USER_NOT_FOUNDUser identifier doesn't match any account
INSUFFICIENT_BALANCEUser doesn't have enough funds
DUPLICATE_REFERENCEReference ID already used
CANNOT_CANCELResource cannot be cancelled in current state

Rate Limiting

Code Description
RATE_LIMIT_EXCEEDEDToo many requests, slow down

Error Response Example

422 Unprocessable Entity
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "The given data was invalid.",
    "details": [
      {
        "field": "amount",
        "message": "The amount must be at least 1.00"
      },
      {
        "field": "currency",
        "message": "The selected currency is invalid."
      }
    ]
  }
}

Handling Errors

  • Always check the success field first
  • Use error.code for programmatic error handling
  • Display error.message to users
  • Retry on 5xx errors with exponential backoff