> 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/resources/tutorials/retrieving-ats-for-specific-skus.md).

# Retrieving ATS for Specific SKUs

Retrieve Available-to-Sell (ATS) quantities for a list of SKUs, optionally for a shopper's delivery country.

This tutorial retrieves ATS quantities for a list of SKUs with the POST endpoint, optionally for a delivery country.

**Before you begin:** you need your retailer identifier and credentials from integration setup. See [Authentication](/inventory/inventory-api/authentication.md).

{% stepper %}
{% step %}

#### Build the request

`skus` is required and must be a valid SKU list. `deliveryCountryIso` is optional; when supplied, use the shopper's two-character ISO delivery country code and validate it first.

```json
{
  "deliveryCountryIso": "FR",
  "skus": [
    "SKU123",
    "SKU456"
  ]
}
```

{% endstep %}

{% step %}

#### Call the POST endpoint

```bash
curl --request POST 'https://api.sandbox.esw.com/inventory/v1/{identifier}/inventory-availability' \
  --header 'Authorization: Bearer {access_token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "deliveryCountryIso": "FR",
    "skus": ["SKU123", "SKU456"]
  }'
```

{% endstep %}

{% step %}

#### Read the response

On `200`, the response is an array of `sku` and `quantity`. With a delivery country, each quantity is aggregated across the fulfillment centres applicable to that country.

```json
[
  { "sku": "SKU123", "quantity": 57 },
  { "sku": "SKU456", "quantity": 8 }
]
```

```javascript
const response = await fetch(
  `https://api.sandbox.esw.com/inventory/v1/${identifier}/inventory-availability`,
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${accessToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ deliveryCountryIso: 'FR', skus: ['SKU123', 'SKU456'] })
  }
);

if (!response.ok) {
  // A failed request is not zero inventory.
  throw new Error(`Inventory request failed: ${response.status}`);
}

const availability = await response.json(); // [{ sku, quantity }]
```

{% endstep %}

{% step %}

#### Handle errors

Use the HTTP status and any returned error information to decide what to do. See [Response Codes](/inventory/inventory-api/response-codes.md).
{% endstep %}
{% endstepper %}

To retrieve every applicable SKU instead, see [Retrieving All ATS Inventory](/inventory/resources/tutorials/retrieving-all-ats-inventory.md).


---

# 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/resources/tutorials/retrieving-ats-for-specific-skus.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.
