Response Format
All API responses follow a consistent format:message and errors. Some of them, such as authentication and rate limit errors, omit the data field.
HTTP Status Codes
Common Errors
Authentication Errors (401)
Solution:
Missing Scope (403)
The API key is valid but lacks a scope the endpoint requires:- The key was created without the scope the endpoint requires
- The role of the team member who created the key was downgraded, which removed the scope
errors.scopes to the key in Settings → API Keys. Read errors.scopes rather than message in your code, because the message is translated into the request language. See Authentication for the scope each endpoint requires.
Resource Not Found (404)
- Invalid resource ID
- Resource belongs to a different store
- Resource has been deleted
- Product is not published (for public endpoints)
Validation Errors (422)
- Missing required fields
- Invalid field format
- Business rule violations
Rate Limit Exceeded (429)
Retry-After header and retry. See Rate Limits for details.
Handling Errors
JavaScript Example
PHP Example
Error Codes Reference
Checkout Errors
License Errors
Best Practices
Always Check Status Codes
Always Check Status Codes
Don’t assume success - always check the HTTP status code before processing the response.
Log Errors
Log Errors
Log error responses for debugging and monitoring purposes.
Show User-Friendly Messages
Show User-Friendly Messages
Translate API errors into user-friendly messages for your customers.
Implement Retry Logic
Implement Retry Logic
For 5xx errors and rate limits, implement automatic retry with exponential backoff.