Improve your user experience by handling error information from Square APIs and SDKs.
Build Basics

Handling Errors

Square APIs always return a response. If an endpoint request fails, the response body includes an errors array as explained in the following section.

When a request fails, Square endpoints return a response that includes the errors field in the body. It provides one or more errors of the Error type. The following is an example response of a failed CreatePayment request:

Note

The Square Connect V1 API is a deprecated API. If you are still using the API, note that all Connect V1 endpoints return JSON error responses to indicate the related HTTP protocol status code and a human-readable message describing the error. The error message is always in English. For example:

Square API endpoints use HTTP protocol status codes to indicate errors. For more information about HTTP response status codes, see HTTP response status codes. The error code values range from 400 to 599.

There are several other introductory topics provided for a new developer to quickly learn the basics of developing applications with Square. For more information, see Basics of Building Applications with Square.

If you need more assistance, contact Developer Support or ask for help in the Developer Forums.