Error Handling

The Storeep API uses standard HTTP status codes and returns structured JSON error responses.

Error Response Format

All error responses follow this structure:

JSON
{
    "status": "error",
    "errors": [
        "description of what went wrong"
    ]
}

The errors field is always an array. For authentication errors, it contains string messages. For validation errors (422), it is an object with field names as keys.

422 Validation Error
{
    "status": "error",
    "errors": {
        "limit": "limit must be an integer",
        "sort_order": "sort order must be ASC or DESC"
    }
}

HTTP Status Codes

CodeStatusDescription
200OKRequest succeeded. Response contains the requested data.
401UnauthorizedAuthentication failed. Missing, invalid, or expired access token.
403ForbiddenToken is valid but lacks the required permission for this endpoint.
422Unprocessable EntityRequest parameters are invalid. Check the errors object for field-specific messages.
429Too Many RequestsRate limit exceeded. Wait and retry. See Rate Limits.
500Internal Server ErrorSomething went wrong on our end. Retry later or contact support.

Common Errors

Authentication Errors (401)

Error MessageCauseFix
authorization header is missingNo Authorization header in request.Add Authorization: Bearer YOUR_TOKEN header.
access token format is invalidToken is not a valid UUID.Check the token format matches xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
access token is invalidToken does not exist or was deleted.Create a new token in Settings → Access tokens.
access token has expiredToken's expiration date has passed.Create a new token with a future expiration date or set to "Never".

Permission Errors (403)

Error MessageCauseFix
insufficient permissions, requires: products:readToken lacks products:read permission.Edit the token in Settings → Access tokens to add the required permission.
insufficient permissions, requires: orders:readToken lacks orders:read permission.Edit the token in Settings → Access tokens to add the required permission.

Validation Errors (422)

FieldError Message
searchsearch must be a string or search term too long (max 255 characters)
marketmarket must be a string or array of strings, market cannot exceed 20 values, or each market must be a valid country code
limitlimit must be an integer, limit must be at least 1, or limit cannot exceed 50
pagepage must be an integer or page must be at least 1
sort_fieldsort field must be created_at or updated_at
sort_ordersort order must be ASC or DESC

Best Practices