Error Handling
The Case AI API uses conventional HTTP response codes and returns detailed error information in JSON format.HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Access denied |
404 | Not Found - Resource doesn’t exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
Error Response Format
All errors return a consistent JSON structure:Error Codes
Authentication Errors
| Code | Description |
|---|---|
unauthorized | Invalid or missing API key |
forbidden | Not authorized for this resource |
Validation Errors
| Code | Description |
|---|---|
invalid_request | Malformed request body |
missing_field | Required field is missing |
invalid_field | Field value is invalid |
Business Logic Errors
| Code | Description |
|---|---|
insufficient_inventory | Not enough stock available |
minimum_not_met | Below minimum order quantity |
license_invalid | Buyer license not valid |
supplier_unavailable | Supplier not accepting orders |
Not Found Errors
| Code | Description |
|---|---|
product_not_found | Product doesn’t exist or is inactive |
order_not_found | Order doesn’t exist |
supplier_not_found | Supplier doesn’t exist or isn’t verified |
webhook_not_found | Webhook doesn’t exist |
Rate Limiting
| Code | Description |
|---|---|
rate_limit_exceeded | Too many requests |