Skip to main content

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): Example:
BASE_URL=${PEPAY_API_URL}

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

Response

{
  "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: Checkout