Errors

Payless Power’s API utilizes standard HTTP status codes to communicate API request outcomes. A successful request returns a 2xx code. Client errors return 4xx codes, such as 400 for invalid syntax, 401 for authentication failures, and 404 for missing resources.

Each 4xx error includes a detailed response object containing specific error codes and descriptions to help developers identify and resolve issues. Server-side problems return 5xx codes, though these are uncommon due to robust infrastructure. For example, 500 indicates an internal server error, while 503 suggests temporary service unavailability.

{
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
    "title": "One or more validation failures have occurred.",
    "status": 400,
    "errors": [
        {
            "field": "firstName",
            "code": "MISSING_REQUIRED_FIELD",
            "message": "Field is required."
        }
    ]
}

HTTP Status Code Summary

200

Ok

Everything worked as expected

400

Bad Request

The request was unacceptable, often due to missing a required parameter

401

Unauthorized

No valid API key provided.

402

Request Failed

The parameters were valid but the request failed.

403

Forbidden

The API key doesn’t have permissions to perform the request.

404

Not Found

The requested resource doesn’t exist.

429

Too Many Requests

Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.

500

Server Errors

Something went wrong on Payless’ end. (These are rare.)

Our Client libraries raise exceptions for many reasons, such as a failed MFA, invalid parameters, authentication errors, and network unavailability. We recommend writing code that gracefully handles all possible API exceptions.