API Reference

Handling Error Codes

These are a full list of error codes returned by the Pay1st APIs.

List of API error codes

The root cause of errors can be generalised from the HTTP Response Code. The list below details the errors that could occur during an integration or in production.

HTTP Status CodeNameGeneral Guidelines
400Bad RequestCheck the payload or params
401UnauthorizedCheck the auth credentials
403ForbiddenThe credentials provided do not have access to the resources requested
404Not FoundThe requested resource does not exist
405Method Not AllowedCheck the HTTP Request Type and check the Content-Type Header
429Too Many RequestsCheck that there are not too many requests being sent to the server
500Internal Server ErrorNeeds to be raised to the Pay1st Implementation Manager

Error Format

All error messages typically consist of an errorMessage field and an errorCode field.

Response FieldDescription
errorMessageA message detailing the error that occurred
errorCodeA code to identify the error source
sessionIdA session identifier for the request. This will need to be sent to the Pay1st Implementation Manager so that it makes it easier to troubleshoot problems for any API requests

All error responses return a 4xx error HTTP status.

{
    "errorMessage": "ERROR_MESSAGE",
    "errorCode": "ERROR_CODE",
    "sessionId": "SESSION_ID"
}