> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Inventory

> The "List Inventory API allows the user to retrieve a paginated list of inventory items. Use this endpoint to fetch details for multiple items in the inventory based on the provided query parameters.

The "List Inventory API allows the user to retrieve a paginated list of inventory items. Use this endpoint to fetch details for multiple items in the inventory based on the provided query parameters.

```http theme={null}
GET https://services.leadconnectorhq.com/products/inventory
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Query parameters

<ParamField query="limit" type="number" default="20">
  The maximum number of items to be included in a single page of results
</ParamField>

<ParamField query="offset" type="number" default="0">
  The starting index of the page, indicating the position from which the results should be retrieved.
</ParamField>

<ParamField query="altId" type="string" required default="6578278e879ad2646715ba9c">
  Account Id or Agency Id
</ParamField>

<ParamField query="altType" type="string" required />

<ParamField query="search" type="string" default="Product Name">
  Search string for Variant Search
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="inventory" type="object[]" required>
    List of inventory items

    <Expandable title="cada item">
      <ResponseField name="_id" type="string" required default="6241712be68f7a98102ba272">
        The unique identifier for the price
      </ResponseField>

      <ResponseField name="name" type="string" required default="Medium T-shirt">
        Name of the price/variant
      </ResponseField>

      <ResponseField name="availableQuantity" type="number" required default="50">
        Available quantity in inventory
      </ResponseField>

      <ResponseField name="sku" type="string" required default="TSHIRT-MED-001">
        SKU for the product variant
      </ResponseField>

      <ResponseField name="allowOutOfStockPurchases" type="boolean" required default="False">
        Whether out of stock purchases are allowed
      </ResponseField>

      <ResponseField name="product" type="string" required default="6241712be68f7a98102ba270">
        Product ID this price belongs to
      </ResponseField>

      <ResponseField name="updatedAt" type="string" required default="2023-12-12T09:27:42.355Z">
        Last update timestamp
      </ResponseField>

      <ResponseField name="image" type="string" default="https://example.com/images/product.jpg">
        Product image URL
      </ResponseField>

      <ResponseField name="productName" type="string" default="T-shirt">
        Product name
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="total" type="object" required>
    Total count of inventory items
  </ResponseField>

  ```json theme={null}
  {
    "inventory": [
      {
        "_id": "6241712be68f7a98102ba272",
        "name": "Medium T-shirt",
        "availableQuantity": 50,
        "sku": "TSHIRT-MED-001",
        "allowOutOfStockPurchases": false,
        "product": "6241712be68f7a98102ba270",
        "updatedAt": "2023-12-12T09:27:42.355Z",
        "image": "https://example.com/images/product.jpg",
        "productName": "T-shirt"
      }
    ],
    "total": {
      "total": 100
    }
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/products/inventory' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/products/inventory', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'GET',
      'https://services.leadconnectorhq.com/products/inventory',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/products/inventory');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'GET',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
