Skip to main content

HTTP status codes and error handling

This page describes errors that may be returned when sending requests to the WhiteBoot API.

General list of HTTP status codes with errors:

Error codeError descriptionRecommendations
400Bad RequestThis error means that the request is invalid. To resolve it, review the request parameters and make sure they are correct and complete.
401UnauthorizedThis error means that one or more authentication parameters (POS_ID, API_KEY, API_SECRET, ENDPOINTS_KEY) have an invalid or unacceptable value. Check the authentication values and use the current ones.
404Not FoundThe endpoint or payment record cannot be found. Check the URL used for the request. It may contain typos or may be missing part of the address.
405Method Not AllowedThe request uses an unsupported HTTP method. Check the documentation requirements for the relevant request type and the HTTP method you are using.
406Not AcceptableA POST request must include application/json content. Include content in the required format in the request.
429Too Many RequestsToo many requests were sent within a short period of time. Try sending the request again after a short pause.
500Internal Server ErrorThis error refers to an internal error on the WhiteBoot side. Contact WhiteBoot support for more information about resolving the issue.
503Service UnavailableThis error also refers to an internal error on the WhiteBoot side and means the server cannot be reached. Try sending the request again after a short pause. If that does not help, contact WhiteBoot support.

The response with client-side error information (4XX status codes) has the following structure:

FieldTypeRequired
messageString(512)
argsJSON
args.codeString(16)

Example response:

{
"message": "Invalid pos_id field or credentials",
"args": {
"code": "S-403"
}
}

Receiving a 4XX status code in response to a request means that the payment was not created or was immediately created with a failed status. If you receive a 404 status code, you can retry the request.

The response with server-side error information (5XX status codes) has the following structure:

FieldTypeRequired
messageString(512)
argsObject
args.error_idString(16)

Example response:

{
"message": "Internal error occurred",
"args": {
"error_id": "NYdKYdA4Zv3iOJSw"
}
}

The args parameter may also contain the obj field, which is an array of data.

Example response:

{
"message": "Invalid values provided",
"args": {
"obj": [
{
"msg": [
"The card is expired: expiry month and year must be numbers that are gte than today"
],
"args": []
}
]
}
}

In some cases, the args parameter may also be returned as an array.

Example response:

{
"message":"Invalid amount provided",
"args":[
{
"field_name":"amount",
"violation":"Invalid value for 'amount': must be a Number in range of [500 - 100000] INR, actual - 300"
}
]
}

When receiving a 500 or 503 status code, request the transaction status again using the order_id value that was set in the payment creation request. Request the transaction status no earlier than 1 minute after receiving the error.

Another error type may be returned when a request is sent to a nonexistent endpoint.

Example response:

{
"code": 5,
"details": [
{
"@type": "type.googleapis.com/google.rpc.DebugInfo",
"detail": "service_control",
"stackEntries": []
}
],
"message": "Method does not exist."
}

If you receive this error, check that the endpoint address used for requests is correct.

Incorrectly formed requests may return the following errors:

Error messageRecommendation
API key not valid. Please pass a valid API key.Check the ENDPOINTS_KEY parameter value.
Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API.Check whether the X-API-KEY header is passed.
Invalid pos_id field or credentialsCheck X-API-Auth and POS_ID.