Payrix Pro API Error Handling Guide
Effective error handling is crucial for building robust and user-friendly integrations with the Payrix Pro API. This guide reviews common API errors and best practices for handling them, focusing on specific error use cases.
Errors returned by the Payrix Pro API are unique. Except for unauthorized requests or invalid syntax for a request, most errors return a 200 OK
successful response (indicating successful communication with the server) with error-related metadata included in the errors
array.
Error Format
The errors
array metadata in every response describes any errors applicable to the request and features parameters that identify the nature of the error and how to proceed.
{
"response": {
"data": [],
"details": {
"requestId": 1
},
"errors": [
{
"field": "username",
"code": 15,
"severity": 2,
"msg": "This field is required to be set",
"errorCode": "required_field"
},
]
}
}
field
: Identifies the parameter causing the error, if applicable.code
: Indicates the category of error.severity
: Determines the seriousness of the error and the next steps to proceed.msg
: Provides a summary of what triggered the error.errorCode
: References the unique Payrix Pro API server error code.
Severity
The severity
parameter determines the immediate impact the error has on your request.
1
: Informative error message. The request was processed.2
: Error warning. Request processing might continue based on the specific error.3
: Error notice. The request was unable to complete processing.4
: Failure notice. The request has failed and was not processed.
Note
While handling the following errors, contact Support if the issue continues after taking these troubleshooting steps.
Error Codes
Each error provides a code
, errorCode,
and msg
(message) fields with details about the nature of the error. See the following table for information about each Payrix Pro API error:
|
|
|
---|---|---|
|
| Invalid request Content-Type header |
|
| An email confirmation is required to create the resource |
|
| Invalid confirmation code |
|
| Invalid user authentication |
|
| Invalid request type, such as |
|
| Should be used for unknown processing errors |
|
| The user’s IP address is blacklisted |
|
| The user’s IP address is invalid |
|
| The record cannot be updated or deleted |
|
| The model relationship does not exist |
|
| There is no authenticated user |
|
| A record already exists in the database |
|
| The requested action or resource does not exist |
|
| Request type/action cannot be defined in the processor |
|
| The record could not be created |
|
| The record could not be updated |
|
| The record could not be deleted |
|
| The record could not be found |
|
| The requested action could not be processed |
|
| Invalid user authentication for the requested action |
|
| The request has more than 10 nested models |
|
| The maximum number of parent logins reached |
|
| The record or parent model has a flag set to inactive or frozen |
|
| Bad response from the integration platform |
|
| No data received from the integration platform |
|
| There is no available integration platform to process the transaction |
|
| The generic key does not exist |
|
| The user has no permission over the record |
|
| Syntax error |
|
| Syntax error |
|
| The batch could not be created or found |
|
| No default credentials set for this merchant |
|
| No default payment set for this transaction |
|
| The merchant had not yet boarded |
|
| REST request is not allowed |
|
| The processor has detected fraud in the transaction. |
|
| The processor has detected possible fraud in the transaction. |
|
| Transaction authorization is invalid. |
|
| Transaction authorization has expired. |
|
| Multiple bad authorizations on the same day |
|
| The merchant has a capture with no authorization |
|
| The merchant has a capture with no authorization |
|
| The refund amount is higher than the limit |
|
| The capture amount is higher than the limit |
|
| The merchant has been inactive for the past X days |
|
| The same payment has been used more than the limit on the same day |
|
| The same payment has been used more than the limit in the past 7 days |
|
| Sales have increased by more than 20% past the limit this month |
|
| Refund-to-sale ratio is greater than the limit |
|
| Refund-to-sale ratio is greater than the limit |
|
| Bad totals field in request |
|
| Unknown error |
|
| Search has more than 10 nested relations |
|
| Invalid user authentication for the requested action using a public API key |
|
| Invalid user authentication for the requested action using a public Session key. |
|
| Duplicate request token detected |
|
| Missing original record from duplicate request |
|
| Invalid request |
|
| Invalid SSO ID in request |
|
| Missing SSO Provider in request |
|
| Rate of requests exceeded - Temporary block implemented |
Authentication Errors
See common authentication errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| Check your authentication credentials and re-authenticate. |
|
| Authenticate before performing the request. |
|
| Verify your authentication for the requested action and re-authenticate. |
|
| You have no permission over the record. |
|
| Verify your authentication for the requested action using a public API key and re-authenticate. |
|
| Verify your authentication for the requested action using a public Session key and re-authenticate. |
Fund Batching Errors
See common fund batching errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| The batch could not be created or found; consider retrying. |
API Request Errors
See common API request errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| Ensure your Content-Type header in the request is set correctly, typically to application/json. |
|
| Ensure the request method (GET, POST, PUT, DELETE) is appropriate for your action. |
|
| Your request has too many nested models; simplify the request. |
|
| REST requests are not allowed; use an alternative method. |
|
| Your search has more than 10 nested relations; simplify the request. |
|
| Validate your request and correct any errors. |
|
| Validate the SSO ID in the request and correct any errors. |
|
| The SSO Provider is missing in the request; add it. |
|
| The rate of requests has exceeded the limit; retry after the temporary block is lifted. |
Confirmation Errors
See common login confirmation errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| Check your email for a confirmation code and enter it. |
|
| Verify the confirmation code you entered and re-enter it if incorrect. |
IP Address Errors
See common IP address errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| Your IP address is blacklisted; contact support for details. |
|
| Validate your IP address format and correct it. |
Resource Errors
See common API resource errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| Note that the record cannot be updated or deleted; consider alternative actions. |
|
| Verify the resource relationships and ensure they exist. |
|
| The record already exists; check for duplicates. |
|
| The requested resource does not exist; verify your request. |
|
| The record is inactive or frozen; consider alternative actions. |
|
| No default credentials are set for the merchant; set them. |
|
| No default payment method is set for the transaction; set it. |
|
| The merchant is not yet boarded; complete the boarding process. |
Processing Errors
See common processing errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| Log the error for further investigation and note that an unknown processing error occurred |
|
| Log the error and note that the record could not be created. |
|
| Log the error and note that the record could not be updated. |
|
| Log the error and note that the record could not be deleted. |
|
| The record could not be found; verify your query. |
|
| Note that the requested action could not be processed; consider retrying. |
|
| Log the error and note a bad response from the integration platform. |
|
| No data was received from the integration platform; consider retrying. |
|
| There is no available integration platform to process the transaction. |
|
| Validate the |
|
| Log the error and note that an unknown error occurred. |
Fraud Detection Errors
See common fraud detection errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| Fraud has been detected in the transaction. |
|
| Possible fraud has been detected. |
|
| The transaction authorization is invalid; re-authenticate. |
|
| The transaction authorization has expired; re-authenticate. |
|
| Multiple bad authorizations have occurred on the same day. |
|
| A capture has occurred with no authorization. |
|
| A capture has occurred with an authorization lower than the transaction total. |
|
| The refund amount is higher than the limit. |
|
| The capture amount is higher than the limit. |
|
| The merchant has been inactive for the past X days. |
|
| The same payment has been used more than the limit on the same day. |
|
| The same payment has been used more than the limit in the past 7 days. |
|
| Sales have increased by more than 20% past the limit this month. |
|
| The refund-to-sale ratio is greater than the limit. |
|
| The refund-to-sale ratio is greater than the limit. |
Syntax Errors
See common syntax errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| Validate the XML syntax and correct any errors. |
|
| Validate the JSON syntax and correct any errors. |
Duplicate Request Errors
See common duplicate request errors you might encounter in the following table, along with their corresponding troubleshooting steps:
|
| Troubleshooting |
---|---|---|
|
| A duplicate request token was detected; verify your request. |
|
| The original record from the duplicate request is missing; verify your request. |