Payzio API Docs

Error Codes

Standardized error codes returned by the API with handling best practices.

When the API encounters an error, it returns a structured error response with a machine-readable error_code that you can use for programmatic error handling.

Error Response Format

Every error response follows this consistent structure:

{
  "status": false,
  "error": {
    "code": 400,
    "error_code": "VALIDATION_INVALID_CURRENCY",
    "message": "Only INR currency is supported",
    "metadata": {
      "supported_currencies": ["INR"],
      "request_id": "abc123"
    }
  }
}
statusbooleanrequired

Always false for error responses.

error.codeintegerrequired

The HTTP status code of the error response.

error.error_codestringrequired

A machine-readable identifier for the specific error type. Use this for programmatic error handling.

error.messagestringrequired

A human-readable description of the error suitable for displaying to end users.

error.metadataobject

Additional context about the error, including the request_id for support inquiries.

Finding the Request ID

Every API request is assigned a unique request_id that helps our support team quickly identify and resolve issues.

You can find the request_id in two places:

Response Headers

The x-request-id header is included in all responses (both successful and failed):

x-request-id: req_abc123xyz
Response Body

For failed requests, the request_id is also included in the JSON response body under metadata:

{
  "status": false,
  "error": {
    "code": 400,
    "error_code": "VALIDATION_INVALID_CURRENCY",
    "message": "Only INR currency is supported",
    "metadata": {
      "supported_currencies": ["INR"],
      "request_id": "req_abc123xyz"
    }
  }
}

When contacting support, always provide the request_id to help us quickly investigate your issue.


Error Code Reference

Validation Errors

Validation errors occur when request data doesn't meet the required format or constraints. All validation error codes are prefixed with VALIDATION_.

VALIDATION_INVALID_CURRENCY
PropertyValue
HTTP Status400
DescriptionThe specified currency is not supported. Currently only INR is accepted.
{
  "error_code": "VALIDATION_INVALID_CURRENCY",
  "message": "Only INR currency is supported",
  "metadata": {
    "supported_currencies": ["INR"]
  }
}
VALIDATION_AMOUNT_TOO_LOW
PropertyValue
HTTP Status400 or 422
DescriptionThe transaction amount is below the minimum allowed threshold.
{
  "error_code": "VALIDATION_AMOUNT_TOO_LOW",
  "message": "Amount is below minimum threshold"
}
VALIDATION_PHONE_REQUIRED
PropertyValue
HTTP Status400
DescriptionPhone number is required but was not provided in the request.
{
  "error_code": "VALIDATION_PHONE_REQUIRED",
  "message": "Phone number is required"
}
VALIDATION_EMAIL_REQUIRED
PropertyValue
HTTP Status400
DescriptionEmail address is required but was not provided in the request.
{
  "error_code": "VALIDATION_EMAIL_REQUIRED",
  "message": "Email address is required"
}
VALIDATION_NAME_REQUIRED
PropertyValue
HTTP Status400
DescriptionName field is required but was not provided.
{
  "error_code": "VALIDATION_NAME_REQUIRED",
  "message": "Name is required"
}
VALIDATION_NAME_INVALID_FORMAT
PropertyValue
HTTP Status400
DescriptionName must be in "FirstName LastName" format.
{
  "error_code": "VALIDATION_NAME_INVALID_FORMAT",
  "message": "Name must be in 'FirstName LastName' format"
}
VALIDATION_REDIRECT_URL_REQUIRED
PropertyValue
HTTP Status400
DescriptionRedirect URL is required for this payment flow.
{
  "error_code": "VALIDATION_REDIRECT_URL_REQUIRED",
  "message": "Redirect URL is required"
}
VALIDATION_USER_DETAILS_REQUIRED
PropertyValue
HTTP Status400
DescriptionUser details object is required but was not provided.
{
  "error_code": "VALIDATION_USER_DETAILS_REQUIRED",
  "message": "User details are required"
}
VALIDATION_FAILED
PropertyValue
HTTP Status400
DescriptionGeneric validation failure. Check metadata for specific field errors.
{
  "error_code": "VALIDATION_FAILED",
  "message": "Validation failed",
  "metadata": {
    "fields": {
      "email": "Invalid email format",
      "amount": "Must be a positive number"
    }
  }
}

Authentication & Authorization Errors

Errors related to API authentication and access permissions. All authentication error codes are prefixed with AUTH_.

AUTH_UNAUTHORIZED
PropertyValue
HTTP Status401
DescriptionAuthentication failed. Invalid credentials or missing/expired token.
{
  "error_code": "AUTH_UNAUTHORIZED",
  "message": "Authentication required"
}
AUTH_FORBIDDEN
PropertyValue
HTTP Status403
DescriptionAccess denied. You don't have permission to perform this action.
{
  "error_code": "AUTH_FORBIDDEN",
  "message": "You do not have permission to perform this action"
}
AUTH_INVALID_API_KEY
PropertyValue
HTTP Status401
DescriptionThe provided API key is invalid, malformed, or has been revoked.
{
  "error_code": "AUTH_INVALID_API_KEY",
  "message": "Invalid API key"
}

Payin Errors

Errors specific to payin (collection) transactions. All payin error codes are prefixed with PAYIN_.

PAYIN_DISABLED
PropertyValue
HTTP Status500
DescriptionPayin functionality is disabled for your account. Contact support.
{
  "error_code": "PAYIN_DISABLED",
  "message": "Payin functionality is disabled for this account"
}
PAYIN_DUPLICATE
PropertyValue
HTTP Status400
DescriptionA payin with this merchant_order_no already exists.
{
  "error_code": "PAYIN_DUPLICATE",
  "message": "A payment with this order number already exists",
  "metadata": {
    "existing_payment_id": "pay_abc123"
  }
}

Use idempotency keys or check for existing orders before creating new payments to avoid this error.

PAYIN_PROCESSING_FAILED
PropertyValue
HTTP Status500
DescriptionFailed to process the payment. Please try again later.
{
  "error_code": "PAYIN_PROCESSING_FAILED",
  "message": "Payment processing failed"
}
PAYIN_STATUS_FETCH_FAILED
PropertyValue
HTTP Status500
DescriptionUnable to retrieve the payment status at this time.
{
  "error_code": "PAYIN_STATUS_FETCH_FAILED",
  "message": "Unable to fetch payment status"
}

Payout Errors

Errors specific to payout (disbursement) transactions. All payout error codes are prefixed with PAYOUT_.

PAYOUT_DISABLED
PropertyValue
HTTP Status500
DescriptionPayout functionality is disabled for your account. Contact support.
{
  "error_code": "PAYOUT_DISABLED",
  "message": "Payout functionality is disabled for this account"
}
PAYOUT_DUPLICATE
PropertyValue
HTTP Status400
DescriptionA payout with this merchant_order_no already exists.
{
  "error_code": "PAYOUT_DUPLICATE",
  "message": "A payout with this order number already exists",
  "metadata": {
    "existing_payout_id": "pout_xyz789"
  }
}
PAYOUT_PROCESSING_FAILED
PropertyValue
HTTP Status500
DescriptionFailed to process the payout. Please try again later.
{
  "error_code": "PAYOUT_PROCESSING_FAILED",
  "message": "Payout processing failed"
}
PAYOUT_STATUS_FETCH_FAILED
PropertyValue
HTTP Status500
DescriptionUnable to retrieve the payout status at this time.
{
  "error_code": "PAYOUT_STATUS_FETCH_FAILED",
  "message": "Unable to fetch payout status"
}
PAYOUT_INSUFFICIENT_BALANCE
PropertyValue
HTTP Status400
DescriptionInsufficient available balance to complete this payout.
{
  "error_code": "PAYOUT_INSUFFICIENT_BALANCE",
  "message": "Insufficient balance",
  "metadata": {
    "available_balance": "1000.00",
    "requested_amount": "1500.00"
  }
}

Check your wallet balance using the Get Balance endpoint before initiating payouts to avoid this error.


Transaction Errors

General transaction-related errors applicable to both payins and payouts. All transaction error codes are prefixed with TRANSACTION_.

TRANSACTION_NOT_FOUND
PropertyValue
HTTP Status404
DescriptionThe specified transaction does not exist.
{
  "error_code": "TRANSACTION_NOT_FOUND",
  "message": "Transaction not found"
}
TRANSACTION_ACCESS_DENIED
PropertyValue
HTTP Status403
DescriptionYou are not authorized to view or modify this transaction.
{
  "error_code": "TRANSACTION_ACCESS_DENIED",
  "message": "You do not have access to this transaction"
}

Wallet Errors

Errors related to merchant wallet and balance operations. All wallet error codes are prefixed with WALLET_.

WALLET_BALANCE_UPDATE_FAILED
PropertyValue
HTTP Status400
DescriptionFailed to update wallet balance. This may occur due to concurrent operations or insufficient funds.
{
  "error_code": "WALLET_BALANCE_UPDATE_FAILED",
  "message": "Failed to update wallet balance"
}
WALLET_BALANCE_FETCH_FAILED
PropertyValue
HTTP Status500
DescriptionUnable to retrieve wallet balance at this time.
{
  "error_code": "WALLET_BALANCE_FETCH_FAILED",
  "message": "Unable to fetch wallet balance"
}

Internal Errors

Server-side errors that are not caused by client input. All internal error codes are prefixed with INTERNAL_.

INTERNAL_ERROR
PropertyValue
HTTP Status500
DescriptionAn unexpected internal error occurred. Please contact support if the issue persists.
{
  "error_code": "INTERNAL_ERROR",
  "message": "An internal error occurred",
  "metadata": {
    "request_id": "req_abc123xyz"
  }
}

When reporting internal errors to support, always include the request_id from the metadata to help with troubleshooting.


Error Code Quick Reference

Error CodeHTTP StatusCategory
VALIDATION_INVALID_CURRENCY400Validation
VALIDATION_AMOUNT_TOO_LOW400/422Validation
VALIDATION_PHONE_REQUIRED400Validation
VALIDATION_EMAIL_REQUIRED400Validation
VALIDATION_NAME_REQUIRED400Validation
VALIDATION_NAME_INVALID_FORMAT400Validation
VALIDATION_REDIRECT_URL_REQUIRED400Validation
VALIDATION_USER_DETAILS_REQUIRED400Validation
VALIDATION_FAILED400Validation
AUTH_UNAUTHORIZED401Authentication
AUTH_FORBIDDEN403Authentication
AUTH_INVALID_API_KEY401Authentication
PAYIN_DISABLED500Payin
PAYIN_DUPLICATE400Payin
PAYIN_PROCESSING_FAILED500Payin
PAYIN_STATUS_FETCH_FAILED500Payin
PAYOUT_DISABLED500Payout
PAYOUT_DUPLICATE400Payout
PAYOUT_PROCESSING_FAILED500Payout
PAYOUT_STATUS_FETCH_FAILED500Payout
PAYOUT_INSUFFICIENT_BALANCE400Payout
TRANSACTION_NOT_FOUND404Transaction
TRANSACTION_ACCESS_DENIED403Transaction
WALLET_BALANCE_UPDATE_FAILED400Wallet
WALLET_BALANCE_FETCH_FAILED500Wallet
INTERNAL_ERROR500Internal

Handling Errors

Best Practices

  1. Use error_code for programmatic handling

    Always use the error_code field for programmatic error handling rather than parsing the message string, which may change over time.

  2. Display user-friendly messages

    The message field contains human-readable text suitable for displaying to end users. You can also map error codes to your own localized messages.

  3. Log the request_id

    Always log the metadata.request_id value. This helps support teams trace and resolve issues quickly when you contact them.

  4. Handle error categories

    You can handle error categories by checking the prefix. For example, all VALIDATION_* errors can trigger form validation feedback in your UI.


Changelog

VersionDateChanges
1.0.02026-01-20Initial error code documentation

On this page