# Get a collection

Fetches a collection. Works with Shopify and WooCommerce accounts.

```http
GET https://api.pozy.ai/v1/commerce/collections/{collectionId}
```

- Area: Commerce / Commerce
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `collectionId` (string, required)

## Query parameters

- `accountId` (string, required)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/commerce/collections/6b46c9dca98561aa77455ce1?accountId=696e0b682d0a31188e7a2ba9" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/commerce/collections/6b46c9dca98561aa77455ce1?accountId=696e0b682d0a31188e7a2ba9", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/commerce/collections/6b46c9dca98561aa77455ce1",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "accountId": "696e0b682d0a31188e7a2ba9",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `collection`, object
  - `id`, string
  - `accountId`, string
  - `platform`, string: One of `shopify`, `woocommerce`
  - `title`, string
  - `handle`, string: Can be null
  - `descriptionHtml`, string: Can be null
  - `image`, object
    - one of: Commerce Image
      - `id`, string: Can be null
      - `url`, string
      - `altText`, string: Can be null
  - `sortOrder`, string: One of `manual`, `best_selling`, `alpha_asc`, `alpha_desc`, `price_asc`, `price_desc`, `created`, `created_desc`, `most_relevant`
  - `productCount`, integer: Can be null
  - `seo`, object
    - `title`, string: Can be null
    - `description`, string: Can be null
  - `updatedAt`, string (date-time): Can be null
  - `platformData`, object: Can be null

```json
{
  "collection": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "accountId": "696e0b682d0a31188e7a2ba9",
    "platform": "shopify",
    "title": "Launch day",
    "handle": "acme",
    "descriptionHtml": "string",
    "image": {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "url": "https://pozy.ai/media/example-1.jpg",
      "altText": "Hello from Pozy"
    },
    "sortOrder": "manual",
    "productCount": 42,
    "seo": {
      "title": "Launch day",
      "description": "A short description"
    },
    "updatedAt": "2026-10-02T09:00:00.000Z",
    "platformData": {}
  }
}
```
