Skip to content
On this page

Error Handling ​

When interacting with the Storeino API, errors are communicated using standard HTTP status codes and a consistent error response format. This helps you quickly identify and resolve issues in your integration.

Error Response Format ​

All error responses return a JSON object with the following structure:

json
{
  "status": "error",
  "message": "A human-readable description of the error.",
  "errors": {
    "field_name": [
      "Error message related to the field."
    ]
  }
}
  • status: Always "error" for failed requests.
  • message: A brief description of the error.
  • errors: (optional) An object containing field-specific validation errors.

Example Error Responses ​

Validation Error ​

json
{
  "status": "error",
  "message": "The given data was invalid.",
  "errors": {
    "email": [
      "The email field is required."
    ]
  }
}

Authentication Error ​

json
{
  "status": "error",
  "message": "Unauthenticated."
}

Not Found Error ​

json
{
  "status": "error",
  "message": "Resource not found."
}

Common HTTP Status Codes ​

Status CodeMeaningDescription
400Bad RequestThe request was invalid or cannot be served.
401UnauthorizedAuthentication failed or missing.
403ForbiddenYou do not have permission to access.
404Not FoundThe requested resource does not exist.
422Unprocessable EntityValidation failed for the request data.
429Too Many RequestsRate limit exceeded.
500Internal Server ErrorAn error occurred on the server.

Handling Errors ​

  • Always check the HTTP status code and the error message in the response.
  • For validation errors (422), inspect the errors object for details about which fields failed.
  • For authentication errors (401), ensure your API key or token is valid and included in the request headers.
  • If you encounter a 429 error, wait before making more requests.

Need Help? ​

If you need further assistance, please contact our support team at support@storeino.com.

Released under the MIT License.