> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/inventory/inventory-api/response-codes.md).

# Response Codes

HTTP response codes returned by the Inventory API, the error body schemas, and how to handle each response.

Both Inventory API endpoints return the following HTTP status codes.

| Status | Description                                          | Error body                       | Recommended action                                                                 |
| ------ | ---------------------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------- |
| `200`  | Request processed successfully                       | None (array of SKU and quantity) | Use the returned quantities                                                        |
| `400`  | Request is invalid                                   | `ProblemDetailsErrorsResult`     | Check the identifier, the SKU list (POST) and `deliveryCountryIso`; fix and resend |
| `401`  | Request is unauthorized                              | `ProblemDetails`                 | Check the access token and the `Authorization` header                              |
| `403`  | Request is forbidden                                 | `ProblemDetails`                 | Confirm the credentials have the permissions provided during integration setup     |
| `404`  | Required ESW fulfillment configuration was not found | `ProblemDetailsErrorsResult`     | Contact ESW so the configuration can be reviewed                                   |
| `409`  | ESW fulfillment configuration conflict               | `ProblemDetailsErrorsResult`     | Contact ESW so the configuration can be reviewed                                   |
| `500`  | Internal server error                                | `ProblemDetailsErrorsResult`     | Apply the agreed retry approach for temporary failures; avoid uncontrolled retries |

Any other error response is described by `ProblemDetails`.

The `404` and `409` responses relate to internal ESW configuration used to determine applicable inventory. If either occurs, contact ESW.

{% hint style="danger" %}
A failed API request must not be interpreted as zero inventory. Treat a quantity of `0` as a valid zero-ATS position only when it is returned in a successful response.
{% endhint %}

## Error Response Structures

### ProblemDetails

Returned for `401`, `403` and other error responses.

| Field      | Type    | Description                                  |
| ---------- | ------- | -------------------------------------------- |
| `type`     | string  | A URI reference identifying the problem type |
| `title`    | string  | A short summary of the problem               |
| `status`   | integer | The HTTP status code                         |
| `detail`   | string  | An explanation specific to this occurrence   |
| `instance` | string  | A reference to this occurrence               |

### ProblemDetailsErrorsResult

Returned for `400`, `404`, `409` and `500`. It has the same fields as `ProblemDetails`, plus an `errors` array.

| Field              | Type   | Description                |
| ------------------ | ------ | -------------------------- |
| `errors`           | array  | One or more error entries  |
| `errors[].message` | string | A description of the error |

```json
{
  "type": "<problem type>",
  "title": "<summary>",
  "status": 400,
  "detail": "<explanation>",
  "instance": "<reference>",
  "errors": [
    { "message": "<error description>" }
  ]
}
```

## Integration Safeguards

* Use the applicable retailer identifier.
* Ensure POST requests contain a valid SKU list.
* Validate the delivery-country value when supplied.
* Handle authentication and authorization failures explicitly.
* Use HTTP status codes and returned error information to determine the appropriate response.
* Apply the agreed retry approach for temporary failures, and avoid uncontrolled retries.
* Do not expose authentication credentials in application logs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.esw.com/inventory/inventory-api/response-codes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
