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

# Search

> Search commerce products and offers.

## Overview

Search returns product results you can use to build discovery and browsing experiences. Results typically include enough metadata to render a product card (title, image, price) and a `productId` you can use for product details and checkout flows.

## Authentication

Requires `x-commerce-api-key`.

## Request

Endpoint:

* `GET /api/commerce/search`

Playground (interactive reference):

* [Search commerce products](/api-spec/endpoints/commerce-search)

Example:

```bash theme={null}
BASE_URL=${PEPAY_API_URL}

curl "$BASE_URL/api/commerce/search?q=headphones&limit=10" \
  -H "x-commerce-api-key: ck_live_..."
```

## Response

```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 auth

## Examples

* Next step for purchases: fetch product offers, then create a [Checkout invoice](/api-spec/commerce/checkout) (optionally via [Merchant carts](/api-spec/commerce/merchant-carts) for server-managed flows).

Next: [Checkout](/api-spec/commerce/checkout)
