Search for products
curl --request GET \
--url https://api-beta.pepay.io/api/commerce/search \
--header 'x-commerce-api-key: <api-key>'import requests
url = "https://api-beta.pepay.io/api/commerce/search"
headers = {"x-commerce-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-commerce-api-key': '<api-key>'}};
fetch('https://api-beta.pepay.io/api/commerce/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-beta.pepay.io/api/commerce/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-commerce-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-beta.pepay.io/api/commerce/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-commerce-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-beta.pepay.io/api/commerce/search")
.header("x-commerce-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-beta.pepay.io/api/commerce/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-commerce-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"products": [
{
"productId": "B000NPYY04",
"title": "Nature's Bounty Fish Oil, 1200 mg Omega-3, 200 Rapid Release Softgels",
"price": 12.48,
"image": "https://images-na.ssl-images-amazon.com/images/I/51KGjV22PWL._AC_US218_.jpg",
"rating": 4.5,
"reviewCount": 395,
"fresh": false,
"retailer": "amazon",
"url": "https://www.amazon.com/dp/B000NPYY04"
}
],
"pagination": {
"page": 1,
"totalPages": 8,
"totalResults": 150,
"hasNext": true
},
"query": "wireless headphones",
"retailer": "amazon"
},
"meta": {
"timestamp": 1738240496,
"cacheStats": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": [
{
"field": "q",
"message": "Search query must be between 1 and 200 characters"
}
]
}
}{
"success": false,
"error": {
"code": "COMMERCE_API_KEY_MISSING",
"message": "Commerce API key required"
}
}{
"success": false,
"error": {
"code": "COMMERCE_API_KEY_SUSPENDED",
"message": "Commerce API key suspended"
}
}{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many search requests. Please wait before trying again.",
"retryAfter": 60
}
}{
"success": false,
"error": {
"message": "Commerce features are currently disabled"
}
}Search Commerce
Search products/retail inventory via the Commerce API.
GET
/
api
/
commerce
/
search
Search for products
curl --request GET \
--url https://api-beta.pepay.io/api/commerce/search \
--header 'x-commerce-api-key: <api-key>'import requests
url = "https://api-beta.pepay.io/api/commerce/search"
headers = {"x-commerce-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-commerce-api-key': '<api-key>'}};
fetch('https://api-beta.pepay.io/api/commerce/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-beta.pepay.io/api/commerce/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-commerce-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-beta.pepay.io/api/commerce/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-commerce-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-beta.pepay.io/api/commerce/search")
.header("x-commerce-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-beta.pepay.io/api/commerce/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-commerce-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"products": [
{
"productId": "B000NPYY04",
"title": "Nature's Bounty Fish Oil, 1200 mg Omega-3, 200 Rapid Release Softgels",
"price": 12.48,
"image": "https://images-na.ssl-images-amazon.com/images/I/51KGjV22PWL._AC_US218_.jpg",
"rating": 4.5,
"reviewCount": 395,
"fresh": false,
"retailer": "amazon",
"url": "https://www.amazon.com/dp/B000NPYY04"
}
],
"pagination": {
"page": 1,
"totalPages": 8,
"totalResults": 150,
"hasNext": true
},
"query": "wireless headphones",
"retailer": "amazon"
},
"meta": {
"timestamp": 1738240496,
"cacheStats": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": [
{
"field": "q",
"message": "Search query must be between 1 and 200 characters"
}
]
}
}{
"success": false,
"error": {
"code": "COMMERCE_API_KEY_MISSING",
"message": "Commerce API key required"
}
}{
"success": false,
"error": {
"code": "COMMERCE_API_KEY_SUSPENDED",
"message": "Commerce API key suspended"
}
}{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many search requests. Please wait before trying again.",
"retryAfter": 60
}
}{
"success": false,
"error": {
"message": "Commerce features are currently disabled"
}
}Overview
Use this endpoint to search Commerce inventory and build a product browsing experience.Authentication
Commerce search requires a commerce-scoped API key (see Commerce APIs).Request
SDK
const results = await pepay.commerce.search({ q: 'wireless headphones', limit: 10 });
cURL
curl "https://api-beta.pepay.io/api/commerce/search?q=wireless%20headphones&limit=10" \
-H "x-commerce-api-key: ck_..."
Response
{
"success": true,
"data": {
"products": [
{
"productId": "B000NPYY04",
"title": "Wireless Headphones",
"price": 129.99,
"image": "https://images.example.com/product.png"
}
]
}
}
Errors
400invalid search parameters401missing/invalid commerce auth
Examples
- Build “search → cart → checkout” flows using the adjacent Commerce endpoints in the sidebar. Next: Create a checkout invoice
Authorizations
commerceApiKeymerchantApiKey
Legacy alias for commerce-scoped API keys. Prefer x-api-key with scope=commerce.
Query Parameters
Search query (1-200 characters)
Required string length:
1 - 200Page number for pagination (1-100)
Required range:
1 <= x <= 100Retailer to search (currently only Amazon supported)
Available options:
amazon, walmart Minimum price filter in USD
Required range:
x >= 0Maximum price filter in USD
Required range:
x >= 0Was this page helpful?
⌘I

