> ## 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.

# Fetch Product Store Stats

> API to fetch the total number of products, included in the store, and excluded from the store and other stats

API to fetch the total number of products, included in the store, and excluded from the store and other stats

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

## 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>

## Path parameters

<ParamField path="storeId" type="string" required default="3SwdhCu3svxI8AKsPJt6">
  Products related to the store
</ParamField>

## Query parameters

<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="Awesome product">
  The name of the product for searching.
</ParamField>

<ParamField query="collectionIds" type="string" default="65c2789a812e52f9bd6ec577,65c2789a812e52de9a6ec576">
  Filter by product collection Ids. Supports comma separated values
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="totalProducts" type="number" required default="100">
    Total number of products
  </ResponseField>

  <ResponseField name="includedInStore" type="number" required default="80">
    Number of products included in the store
  </ResponseField>

  <ResponseField name="excludedFromStore" type="number" required default="20">
    Number of products excluded from the store
  </ResponseField>

  ```json theme={null}
  {
    "totalProducts": 100,
    "includedInStore": 80,
    "excludedFromStore": 20
  }
  ```
</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/store/YOUR_storeId/stats' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/products/store/YOUR_storeId/stats', {
    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/store/YOUR_storeId/stats',
      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/store/YOUR_storeId/stats');
  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>
