Skip to main content

Error Codes

PayerScan API uses a standardized error response format. All errors follow a consistent structure for easy handling on the merchant's backend.

Error Response Structure

{
"status": "error",
"message": "Invalid API key. Please check your API key and try again.",
"error_code": "INVALID_API_KEY",
"request_id": "ORDER_123456",
"details": { ... }
}

Properties:

  • status: Always "error".
  • message: Human-readable error description.
  • error_code: Machine-readable code in UPPER_SNAKE_CASE format. Use switch/case for automated handling.
  • request_id (optional): Your order ID, returned only if provided when creating the invoice.
  • details (optional): Additional context about the error (e.g., validation errors, field names).

Error Code Reference

Authentication Errors

Error CodeHTTPMessageResolution
MISSING_API_KEY401Missing API key. Please provide x-api-key header.Add x-api-key header to your request.
INVALID_API_KEY401Invalid API key. Please check your API key and try again.Verify your API key on the Dashboard.
ACCOUNT_INACTIVE403Merchant account is inactive. Please contact support to reactivate.Contact PayerScan support.
STORE_INACTIVE403Store is inactive. Please contact support to reactivate your store.Re-enable store on the Dashboard.
AUTHENTICATION_FAILED500Authentication failed. Please try again later.Retry later; if persistent, contact support.

Validation Errors

Error CodeHTTPMessageResolution
VALIDATION_ERROR400Validation failed. Please check your request body.Check details.errors for specific field issues.
INVALID_MERCHANT_ID400Invalid merchant_id. The merchant_id does not match your API key.Ensure merchant_id matches the API key's store.

Business Logic Errors

Error CodeHTTPMessageResolution
INSUFFICIENT_BALANCE402Insufficient balance. Please top-up your account to continue.Top-up on PayerScan Dashboard. Check details for shortage amount.
NO_PAYMENT_METHOD400No payment method configured. Please add at least one wallet or exchange platform.Add a wallet address or connect an exchange platform on the Dashboard.

Invoice Errors

Error CodeHTTPMessageResolution
INVOICE_NOT_FOUND404Invoice not found.Verify trans_id and ensure it belongs to your store.
MISSING_TRANS_ID400Missing trans_id in URL.Include trans_id in the URL path: GET /invoice/:trans_id.
INVALID_TRANS_ID_FORMAT400Invalid trans_id format.Use the correct format: TID-XXXXXXXXXXXXXXXX.

Rate Limit Errors

Error CodeHTTPMessageResolution
RATE_LIMIT_EXCEEDED429Too many requests per second. / Rate limit exceeded.Wait for retry_after_seconds and retry. See Rate Limits.

Server Errors

Error CodeHTTPMessageResolution
INTERNAL_ERROR500Internal server error. Please try again later.Retry with exponential backoff. If persistent, contact support.