Error Handling

Error Handling - Astrapay API

Overview

All Astrapay APIs follow a consistent error handling pattern. When an error occurs, the system returns a standardized error response object that provides detailed information about what went wrong and how to resolve it.

Error Response Format

All API errors return the same response structure, ensuring consistency across all Astrapay services:

{
  "errorCode": 36,
  "message": "Invalid request parameters",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "xTransactionId": "328d5e1a-06dd-4263-8081-0a2ec31c1f9a",
  "errors": [
    "Amount must be greater than 0.01",
    "Description cannot exceed 140 characters"
  ]
}

Error Response Fields

FieldTypeDescription
errorCodeintegerNumeric error code indicating the type of error
messagestringHuman-readable error message describing the issue
timestampstringISO 8601 timestamp when the error occurred
xTransactionIdstringUnique transaction identifier for tracking
errorsarrayDetailed list of specific validation errors

Erro

Critical Error Handling

Error Code 1 - Contact Support Required

⚠️ IMPORTANT: When errorCode = 1, this indicates a critical system error that requires attention from our support team.

{
  "errorCode": 1,
  "message": "Critical system error - please contact support",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "xTransactionId": "328d5e1a-06dd-4263-8081-0a2ec31c1f9a",
  "errors": [
    "System temporarily unavailable"
  ]
}

Support Contact Information

  • Email: [email protected]
  • Include in your message:
    • The xTransactionId from the error response
    • The full error response JSON
    • Description of the operation you were performing
    • Timestamp when the error occurred