API Error Handling

Understand API error codes, validation failures, and warning messages to build resilient integrations.

When working with APIs, errors can occur due to authorization issues, invalid request parameters, or business rule validations. PCE APIs return standardized error codes and messages to help you identify the root cause of a failed request and take the appropriate corrective action.

Proper error handling allows integrations to detect issues quickly, respond gracefully, and maintain reliable communication with the platform.

API error responses typically contain the following information:

  • Error Code – A unique identifier used to categorize the error.
  • Error Message – A human-readable description explaining the error.
  • Details – Additional context about the validation or processing issue (when available).

Error Code Categories

API errors are grouped into the following categories based on their prefix.

Error Code FormatDescription
EC-AUTH-XXXXErrors related to authorization and credential validation
EC-VA-XXXXErrors related to request validation
EC-BL-XXXXErrors related to business logic validations

Authorization Errors

Authorization errors occur when a request fails authentication or the user does not have the necessary permissions to perform an action.

Error CodeError Message
EC-AUTH-0001User authorization attempt failed. User needs to confirm their credentials.

These errors typically occur when:

  • Authentication credentials are incorrect or expired
  • The request is made by an unauthorized user
  • The client does not have access to the requested resource

Validation Errors

Validation errors occur when the request structure, headers, or parameters do not meet the required format or rules defined by the API.

Header Validation

These errors occur when required request headers are missing or invalid.

Error CodeError Message
EC-VA-0001Missing header param: :[object].
EC-VA-0002Invalid header param: :[object].

User Verification & Security Validation

These validations ensure required security inputs are provided when performing certain account operations.

Error CodeError Message
EC-VA-0106Three security questions are required
EC-VA-0107At least one of new password or security question is required

API Request Validation

These errors occur when request parameters or payload values do not meet the required validation rules.

Error CodeError Message
EC-VA-0004:[jsonString]
EC-VA-0005Validation Failed.
EC-VA-0006Invalid Value :[value] for field :[field].
EC-VA-0007Invalid Value :[value].
EC-VA-0008Invalid Field :[value].

These errors usually occur when:

  • Required parameters are missing
  • Field values do not meet expected formats
  • Invalid data types are provided in the request payload

Warning Messages

In addition to errors, the API may return warning messages in the response header.

Warning messages provide important information related to an operation without causing the request to fail. These messages are intended to help you improve or adjust your request structure.

For example, warnings may indicate:

  • Optional parameters that were ignored
  • Recommended changes to request formatting
  • Additional information related to the processed request

Developers should review warning messages to ensure their integration follows recommended API usage patterns.


Best Practices

Follow these best practices when handling API errors:

  • Always inspect the error code and message returned in the response.
  • Log API responses to assist with debugging and troubleshooting.
  • Validate request parameters before sending them to avoid validation errors.
  • Handle authorization failures by verifying credentials or access permissions.
  • Review warning messages to improve request structure and avoid potential issues.


.readme-logo { display: none !important; }