Response Format
All API responses follow a consistent format:HTTP Status Codes
| Code | Description |
|---|---|
200 | Success - Request completed successfully |
201 | Created - Resource created successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorised - Invalid or missing API key |
403 | Forbidden - Access denied to this resource |
404 | Not Found - Resource doesn’t exist |
422 | Unprocessable Entity - Validation failed |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Something went wrong |
Common Errors
Authentication Errors (401)
- Missing
Authorizationheader - Invalid API key format
- Revoked or expired API key
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)
Handling Errors
JavaScript Example
PHP Example
Error Codes Reference
Checkout Errors
| Message | Cause | Solution |
|---|---|---|
Product not found | Invalid product ID or unpublished | Use a valid, published product ID |
Already purchased | Customer owns this product | Redirect to their purchase |
Product unavailable | Out of stock or quantity limit | Check product availability |
Invalid discount code | Code doesn’t exist or expired | Verify the discount code |
License Errors
| Message | Cause | Solution |
|---|---|---|
License not found | Invalid license key | Verify the license key |
License already activated | Reached activation limit | Show user their activations |
License expired | Past expiration date | Prompt for renewal |
License revoked | Manually revoked | Contact support |
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.