Error Handling

This document provides a comprehensive reference for all error codes, messages, descriptions, and recommended actions for the PIPE API.

Application Response Codes

These are the core response codes used throughout the ERM system for business logic errors.

CodeDescriptionCommon ScenariosRecommended Actions
00General/Unknown ErrorCurrency mismatch, configuration errors, user mismatchReview request parameters, verify configuration settings
6General Transaction FailureDatabase errors, processing failuresRetry the transaction, check system logs, and contact support if persistent
11Invalid AmountAmount format incorrect, negative amountsEnsure the amount is a valid positive number with correct decimal places
12Invalid TransactionTransaction validation failedVerify all transaction fields are correct and complete
25Transaction Not FoundReferenced transaction doesn't existVerify the transaction ID, and check if the transaction was created
30Bad RequestMalformed request body, missing fieldsReview API documentation, validate request payload
31Route Configuration Error for Issuer InstitutionSender endpoint undefined, local payment confirmation undefinedConfigure the sender institution's routing properly in the system
39Invalid AccountAccount validation failed, account not recognizedVerify account details, ensure account exists and is active
40Sender InvalidSender account/details invalidCheck sender account information, verify sender is authorized
51Insufficient FundsLiquidity shortage, balance insufficientAdd funds, wait for liquidity replenishment, or reduce transaction amount
64Authentication Token InvalidToken expired, signature invalid, public key errorsRefresh the authentication token, verify the signature, and check the public key configuration
80Account Name MismatchSender/receiver account details don't matchVerify account names match registered accounts exactly
91Remote Service UnreachableLiquidity gateway not found, timeoutCheck network connectivity, verify gateway configuration, retry later
92Routing Configuration Error for Receiving InstitutionReceiver gateway not found, endpoint undefinedConfigure the receiving institution's routing properly
93Gateway Configuration ErrorMissing liquidity provider ID, exchange rate not setConfigure the gateway with the required parameters (liquidity provider, exchange rate)
96System MalfunctionInternal system errorContact the system administrator, check system health

Error Types

The ERM system uses typed errors to categorize different failure modes.

1. AppErrorFormat

HTTP Status: 400 Bad Request

A structured application error with code, details, and description.

{
  "error": "sender-gateway-not-found",
  "code": "92",
  "description": "Issue/Error with routing configuration for the receiving institution"
}

2. ErrorMissingParameter

HTTP Status: 400 Bad Request

Occurs when a required parameter is not provided.

{
  "error": "error-missing-parameter",
  "data": "parameter_name",
  "message": "Missing Required Parameter",
  "code": "optional_code"
}

Possible Actions:

  • Check API documentation for required fields
  • Ensure all mandatory parameters are included in the request

3. ErrorNotFound

HTTP Status: 404 Not Found

Resource not found in the system.

{
  "error": "error-not-found",
  "data": "resource_id",
  "message": "Not Found"
}

Possible Actions:

  • Verify the resource ID is correct
  • Check if the resource was created
  • Ensure you have permission to access the resource

4. ErrorInvalidJSON

HTTP Status: 400 Bad Request

Request body is not valid JSON.

{
  "error": "error-invalid-json",
  "data": null,
  "message": "The JSON data you submitted is not well formed JSON!"
}

Possible Actions:

  • Validate JSON syntax before sending
  • Check for missing brackets, quotes, or commas
  • Use a JSON validator tool

5. ErrorInvalidIdentifierFormat

HTTP Status: 400 Bad Request

Identifier contains invalid characters.

{
  "error": "error-invalid-identifier-format",
  "data": "parameter_name",
  "message": "Invalid Identifier Format. Only letters a-z, digits 0-9, and characters [_-.@#&+%] are valid."
}

Possible Actions:

  • Remove special characters not in the allowed set
  • Use URL encoding if necessary
  • Validate identifiers before submission

6. ErrorInvalidEmailFormat

HTTP Status: 400 Bad Request

Email address is not in valid format.

{
  "error": "error-invalid-email-format",
  "data": "email_parameter",
  "message": "error-invalid-email-format"
}

Possible Actions:

  • Verify email follows standard format ([email protected])
  • Check for typos in the email address

7. ErrorInvalidNumber

HTTP Status: 400 Bad Request

Numeric field contains invalid value.

{
  "error": "error-invalid-number",
  "data": "parameter_name",
  "message": "error-invalid-number"
}

Possible Actions:

  • Ensure the value is numeric
  • Check decimal separator (use period, not comma)
  • Verify the number is within an acceptable range

8. ErrorWrongFormat

HTTP Status: 400 Bad Request

Data format doesn't match the expected format.

{
  "error": "error-wrong-format",
  "data": "parameter_name",
  "message": "Wrong Format: details"
}

Possible Actions:

  • Review API documentation for the expected format
  • Check date formats (ISO 8601 recommended)
  • Verify currency codes are ISO 4217 compliant

9. ErrorIncompleteData

HTTP Status: 422 Unprocessable Entity

The request is valid, but the data is incomplete for processing.

{
  "error": "error-incomplete-data",
  "details": "specific_details",
  "extra": {}
}

Possible Actions:

  • Review the details field for specific missing information
  • Complete all required data fields
  • Check for dependent field requirements

10. ErrorConflictOperationAlreadyPerformed

HTTP Status: 409 Conflict

Attempting to perform an operation that was already completed.

{
  "error": "error-conflict-operation-already-performed",
  "data": "operation_id",
  "message": "error-conflict-operation-already-performed; status:id"
}

Possible Actions:

  • Check the current status of the resource
  • Do not retry idempotent operations that succeeded
  • Use GET to retrieve the current state

11. ErrorEncryption

HTTP Status: 500 Internal Server Error

Encryption/decryption operation failed.

{
  "error": "error-encryption",
  "data": "",
  "message": "error-encryption: extra_info"
}

Possible Actions:

  • Verify encryption keys are configured correctly
  • Check that the encryption algorithm matches the expected
  • Contact the system administrator



HTTP Status Codes

Status CodeMeaningWhen Used
200OKSuccessful request
201CreatedResource successfully created
400Bad RequestInvalid request format, missing parameters, validation errors
401UnauthorizedMissing or invalid authentication token
404Not FoundResource does not exist
409ConflictOperation already performed, duplicate resource
422Unprocessable EntityValid request but semantic errors (incomplete data, signature required)
500Internal Server ErrorServer-side errors (encryption, system malfunction)
501Not ImplementedFeature not available

Detailed Error Messages

Payment Processing Errors

Error DetailCodeDescriptionAction
sender-gateway-not-found92Sender payment gateway doesn't existVerify gateway ID, check gateway registration
receiver-gateway-not-found92The receiver payment gateway doesn't existVerify gateway ID, check gateway registration
sender-liquidity-gateway-not-found91Sender's liquidity provider is unreachableCheck liquidity provider configuration
receiver-liquidity-gateway-not-found91The receiver's liquidity provider is unreachableCheck liquidity provider configuration
sender-currencies-mismatch00Currency doesn't match sender configurationVerify currency codes match the gateway setup
receiver-currencies-mismatch00Currency doesn't match receiver configurationVerify currency codes match the gateway setup
not-enough-liquidity-at-this-moment51Insufficient liquidity for transferWait for liquidity, reduce the amount, or fund the account
not-enough-pre-funding-liquidity-at-this-moment51Pre-funded balance insufficientAdd pre-funding to the gateway account
not-enough-terminating-liquidity-at-this-moment51The terminating gateway lacks fundsFund terminating gateway
no-terminating-liquidity-at-this-moment51No liquidity available at the terminating gatewayConfigure liquidity or wait
no-processing-gateway-to-terminate-transaction6No gateway available to complete the transactionCheck the gateway routing configuration

Account Verification Errors

Error DetailCodeDescriptionAction
sender-account-verification-endpoint-undefined31Sender verification URL not configuredConfigure verification endpoint
receiver-account-verification-endpoint-undefined92Receiver verification URL not configuredConfigure verification endpoint
sender-account-verification-bearer-token-undefined64Missing auth token for sender verificationConfigure bearer token
receiver-account-verification-bearer-token-undefined64Missing auth token for receiver verificationConfigure bearer token
error-validating-sender-account39Sender account validation failedVerify account details
error-validating-receiver-account39Receiver account validation failedVerify account details
sender-not-recognized39Sender account not found in the systemRegister or verify sender account
receiver-not-recognized39The receiver account was not found in the systemRegister or verify the receiver account
invalid-post-sender-account-verification-endpoint92POST verification endpoint invalidCheck endpoint URL format
invalid-get-sender-account-verification-endpoint92GET verification endpoint is invalidCheck endpoint URL format

Authentication & Signature Errors

Error DetailCodeDescriptionAction
error-decoding-sender-public-key64Public key format invalidCheck the Base64 encoding of the public key
error-could-not-parse-public-key64Public key parsing failedVerify PEM format of public key
error-could-not-parse-public-key-not-rsa64The key is not in the RSA formatUse the RSA public key
X-PAPE-SIGNATURE-BASE64-must-be-set64Missing signature headerAdd X-PAPE-SIGNATURE-BASE64 header
error-decoding-sender-signature64Signature format invalidCheck the Base64 encoding of the signature
error-signature-mismatch64Signature verification failedRe-sign with the correct private key
not-allowed-to-access-this-resource64Authorization insufficientCheck permissions, use correct credentials
auth-user-not-same-as-sender-user00An authenticated user differs from the senderUse correct authentication context

Configuration Errors

Error DetailCodeDescriptionAction
sender-gateway-transaction-channel-must-be-pre-funded00Gateway requires pre-fundingConfigure pre-funded channel
liquidity-provider-id-must-be-set-for-terminating-gateway93Missing liquidity provider configSet liquidity provider ID
exchange-rate-not-must-be-set-for-terminating-gateway93Missing exchange rateConfigure the exchange rate
sender-local-payment-confirmation-endpoint-undefined31Payment confirmation URL missingConfigure confirmation endpoint
receiver-local-payment-confirmation-endpoint-undefined92Payment confirmation URL missingConfigure confirmation endpoint

Recall Payment Errors

Error DetailCodeDescriptionAction
payment-with-id-[X]-not-found00Payment to recall doesn't existVerify payment ID
payment-with-id-[X]-already-recalled00Payment was already recalledNo action needed, recall complete
sender-account-mismatch80Account names don't matchVerify sender account details
receiver-account-mismatch80Account names don't matchVerify receiver account details

Error Response Format

Standard Error Response

{
  "error": "error-type-identifier",
  "code": "numeric_code",
  "description": "Human-readable description",
  "data": "additional_context",
  "message": "Detailed message"
}

AppErrorFormat Response

{
  "error": "specific-error-detail",
  "code": "XX",
  "description": "Standard description for code XX"
}