Success and Error Codes
Each Product Catalog API returns an HTTP status code that indicates the outcome of a request, specifying whether it was successfully processed or if an error occurred that requires further handling. Below is a summary of the standard success and error codes.
Standard Success Responses
| Code | Success Type | Definition | Applies to Method Type(s) |
|---|---|---|---|
| 200 | OK | Retrieve requests: Request was processed successfully and:
| Retrieve (GET) (POST) Update (PATCH) Discontinue (DELETE) (POST) |
| 201 | Created | Request was successful, and a new resource was created. | Create (POST) |
| 207 | Multi-status | A single request with partial success. | Create (POST) Update (PATCH) Discontinue (DELETE) |
Standard Error Response
| HTTP Status Code | Error Type | Definition | Applies to Method Type(s) |
|---|---|---|---|
| 400 | Bad Request | Request is syntactically or structurally invalid and cannot be processed, such as:
| All |
| 401 | Unauthorized | Request could not be authenticated, such as:
| All |
| 403 | Forbidden |
| All |
| 404 | Not Found |
| All |
| 409 | Conflict | Create requests:
| Create (POST) Discontinue (DELETE) (POST) |
| 415 | Unsupported Media Type | Content-type is required but is missing, invalid, or valid but not for that end point. | Retrieve (GET) Update (PATCH) |
| 429 | Too Many Requests | Rate limit has been exceeded. | All |
| 500 | Internal Server Error | Unexpected error due to a bug, crash, unhandled exception, etc. | All |
| 502 | Bad Gateway | Integration backend failed or returned a malformed response. | All |
| 503 | Service Unavailable | The downstream system is temporarily unavailable or a timeout occurred. | All |
Recommendations for API Consumers
- Always check for the correct HTTP status code in your application logic.
- Gracefully handle error scenarios (e.g., 400, 401, 403, 404, 422) by providing clear feedback to the user of your system.
- Implement retry logic for transient errors like 502, 503, and 504.
- Use the response body (where applicable) to extract more context or error details provided by the API.