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

> Internal API to fetch the Product Collections

Internal API to fetch the Product Collections

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

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

<ParamField query="altType" type="string" required default="LOCATION">
  The type of alt. For now it is only LOCATION
</ParamField>

<ParamField query="collectionIds" type="string" default="65d71377c326ea78e1c47df5,65d71377c326ea78e1c47d34">
  Ids of the collections separated by comma(,) for search purposes
</ParamField>

<ParamField query="name" type="string" default="Best Sellers">
  Query to search collection based on names
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="data" type="array[]" required>
    Array of Collections
  </ResponseField>

  <ResponseField name="total" type="number" required>
    The total count of the collections present, which is useful to calculate the pagination
  </ResponseField>

  ```json theme={null}
  {
    "data": [
      []
    ],
    "total": 0
  }
  ```
</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/collections' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

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