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

# All products

You can use this endpoint to get all the products in your store, with the main things you need for a shop page: name, price, photo, colors and whether it's sold out.

```method: GET theme={null}
https://api.baag.cc/v1/products
```

## Authorization

All you need is your **API key** in the `Authorization` header.

<ParamField header="Authorization" type="string" required>
  `Bearer`, a space, then your API key. You can find it in **Baag App** → **Settings** → **Developers**.
</ParamField>

## Response

When everything goes well, you get back status `200` with all your products in `data`, newest first:

```json theme={null}
{
  "data": [
    {
      "slug": "mw6",
      "name": "Linen Shirt",
      "priceRange": {
        "min": 25000,
        "max": 28000
      },
      "isSoldOut": false,
      "imageUrl": "https://…/mw6-red.jpg",
      "colors": [
        {
          "name": "Red",
          "hex": "#C0392B"
        },
        {
          "name": "Navy",
          "hex": "#1F2A44"
        }
      ]
    }
  ]
}
```

Here is what each part means:

* `slug` is the product's short name. Keep it: you will need it to get the product's full details and to start a checkout.
* `priceRange` is the lowest and highest price of the product. When sizes or colors have different prices, they're not the same, so you can show "From 25,000 RWF".
* `isSoldOut` is `true` when nothing is left to buy.
* `imageUrl` is the product's first photo, or `null` when it has none.
* Archived products are not in the list.

To show one product with all its photos, sizes and stock, use [Get product](/products/get) with its `slug`.

## Error Responses

<AccordionGroup>
  <Accordion title="Missing API key">
    Returned with status `401` when the request has no `Authorization` header. Add your key as `Authorization: Bearer pk_live_xxxxxxxxx`.

    ```json theme={null}
    {
      "error": {
        "code": "missing_api_key",
        "message": "Send your API key as: Authorization: Bearer <key>."
      }
    }
    ```
  </Accordion>

  <Accordion title="Invalid API key">
    Returned with status `401` when the key is wrong, or it was regenerated in **Baag App**. Copy your key again from **Settings** → **Developers**.

    ```json theme={null}
    {
      "error": {
        "code": "invalid_api_key",
        "message": "That API key isn't valid. It may have been regenerated."
      }
    }
    ```
  </Accordion>

  <Accordion title="Plan required">
    Returned with status `403` when your store's plan doesn't include the API. Your key works again as soon as your store is on the **Basic** or **Pro** plan.

    ```json theme={null}
    {
      "error": {
        "code": "plan_required",
        "message": "This store's plan doesn't include API access."
      }
    }
    ```
  </Accordion>

  <Accordion title="Rate limited">
    Returned with status `429` when your key sent too many requests in a short time. Wait a moment, then try again.

    ```json theme={null}
    {
      "error": {
        "code": "rate_limited",
        "message": "Too many requests. Slow down and try again shortly."
      }
    }
    ```
  </Accordion>

  <Accordion title="Internal error">
    Returned with status `500` when something went wrong on Baag's side. It's not your fault. Wait a moment, then try again.

    ```json theme={null}
    {
      "error": {
        "code": "internal_error",
        "message": "Something went wrong on our side. Please try again."
      }
    }
    ```
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.