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

# Commerce search

> Search products and offers via the commerce API.

## Overview

Search is the entrypoint for “browse → merchant cart → checkout” flows. Results are safe to render in product UIs.

## Authentication

Requires `x-commerce-api-key`.

## Request

### Search

```ts theme={null}
const results = await pepay.commerce.search({
  q: 'headphones',
  limit: 10
});
```

## Response

Example response (truncated):

```json theme={null}
{
  "success": true,
  "data": {
    "products": [
      {
        "productId": "B000NPYY04",
        "title": "Wireless Headphones",
        "price": 129.99,
        "image": "https://images.example.com/product.png"
      }
    ]
  }
}
```

## Errors

* `400` invalid search parameters
* `401` missing/invalid commerce API key

## Examples

* Use `limit` and narrow queries to keep product UIs fast and predictable.
  Next: [Merchant carts](/sdk/commerce/merchant-carts)
