Skip to main content

Search Products

Searching products

Contents

Overview

  • Call name: search-products
  • Endpoint URL: https://{Services API hostname}/search/products
  • Request methods: HTTP POST
  • Request Content-Type: application/x-www-form-urlencoded
  • Response Content-Type: application/json
  • Auth required: yes

This endpoint searches for both products and product variants in a single request. The search matches against product name, description, owner code, brand, and category fields for products, and against product variant name and barcodes for product variants. Results are ranked by relevance, with stronger matches on the product name weighted highest.

The response returns a JSON object containing two arrays: products and product_variants. If you only need product variants, consider using the dedicated Search Product Variants endpoint instead.

Permissions and Authentication

This API call requires admin authentication:

  • The performing user must be logged in and have access to the chain specified in the request
  • A valid admin session is required (see Authentication)

Headers

The following headers are required:

HeaderDescription
X-Spaaza-Session-User-IdSpaaza ID of the user obtained from the login endpoint
X-Spaaza-Session-KeySession key obtained from the login endpoint
X-Spaaza-Session-Chain-IdThe ID of the Spaaza chain or retailer

Query parameters

This API accepts the following parameters, sent as application/x-www-form-urlencoded form data:

ParameterDescription
chain_id(integer, required) The ID of the Spaaza chain or retailer
query(string, required) The search term(s). Matches against product name, description, owner code, brand, category, and product variant name and barcodes
page(integer, required) The page number of results (starting from 1)
count(integer, optional) Number of results to return per page. Defaults to 10 if not specified

Sample request

curl -X POST \
-H 'X-Spaaza-Session-User-Id: <your user ID>' \
-H 'X-Spaaza-Session-Key: <your session key>' \
-H 'X-Spaaza-Session-Chain-Id: <your chain ID>' \
-d 'chain_id=<your chain ID>' \
-d 'query=Merino Jumper' \
-d 'page=1' \
-d 'count=25' \
'https://{Services API hostname}/search/products'

Sample response

The response is a JSON object with two arrays: products containing matching products, and product_variants containing matching product variants.

{
"products": [
{
"brand": "Aran Brands Inc.",
"category": "knitwear",
"chain_id": 1743,
"cost_price": 79.95,
"created_date": "2026-03-15T10:30:00Z",
"currency": {
"id": 1,
"code": "EUR",
"name_en": "Euro",
"symbol": "\u20ac"
},
"deleted": false,
"description": "The Aran Jumper is a style of jumper that takes its name from the Aran Islands.",
"id": 5,
"image_url": "https://www.example.com/images/arran.jpg",
"last_modified_date": "2026-06-01T14:22:00Z",
"name": "Men's Merino Aran Jumper",
"owner_code": "00024003",
"price": 99.95,
"price_is_promotional": false,
"season": "",
"web_url": "https://www.example.com/products/arran-jumper"
}
],
"product_variants": [
{
"barcodes": [
{
"barcode": "2000042436020",
"created_date": "2026-03-15T10:30:00Z",
"deleted": false,
"id": 3,
"last_modified_date": "2026-06-01T14:22:00Z",
"product_variant_id": 12
}
],
"chain_id": 1743,
"colour": "blue",
"cost_price": 79.95,
"created_date": "2026-03-15T10:30:00Z",
"currency": {
"id": 1,
"code": "EUR",
"name_en": "Euro",
"symbol": "\u20ac"
},
"deleted": false,
"id": 12,
"image_url": "https://www.example.com/images/blue_arran.jpg",
"last_modified_date": "2026-06-01T14:22:00Z",
"name": "Men's Merino Aran Jumper - Blue M",
"price": 99.95,
"price_is_promotional": false,
"product": {
"brand": "Aran Brands Inc.",
"category": "knitwear",
"chain_id": 1743,
"cost_price": 79.95,
"created_date": "2026-03-15T10:30:00Z",
"currency": {
"id": 1,
"code": "EUR",
"name_en": "Euro",
"symbol": "\u20ac"
},
"deleted": false,
"description": "The Aran Jumper is a style of jumper that takes its name from the Aran Islands.",
"id": 5,
"image_url": "https://www.example.com/images/arran.jpg",
"last_modified_date": "2026-06-01T14:22:00Z",
"name": "Men's Merino Aran Jumper",
"owner_code": "00024003",
"price": 99.95,
"price_is_promotional": false,
"season": "",
"web_url": "https://www.example.com/products/arran-jumper"
},
"size": "M",
"web_url": "https://www.example.com/products/arran-jumper-blue-m"
}
]
}

Product fields

FieldTypeDescription
brandstringThe brand name of the product
categorystringThe product category
chain_idintegerThe chain ID the product belongs to
cost_pricefloatThe cost price of the product
created_datestringISO 8601 datetime when the product was created
currencyobjectCurrency information including id, code, name_en, symbol
deletedbooleanWhether the product has been deleted
descriptionstringThe product description
idintegerUnique product identifier
image_urlstringURL to the product image
last_modified_datestringISO 8601 datetime when the product was last modified
namestringThe product name
owner_codestringThe retailer's own code for the product
pricefloatThe retail price of the product
price_is_promotionalbooleanWhether the current price is a promotional price
seasonstringThe product season
web_urlstringURL to the product on the retailer's website

Product variant fields

FieldTypeDescription
barcodesarrayArray of barcode objects (see below)
chain_idintegerThe chain ID the variant belongs to
colourstringThe colour of the variant
cost_pricefloatThe cost price of the variant
created_datestringISO 8601 datetime when the variant was created
currencyobjectCurrency information including id, code, name_en, symbol
deletedbooleanWhether the variant has been deleted
idintegerUnique product variant identifier
image_urlstringURL to the variant image
last_modified_datestringISO 8601 datetime when the variant was last modified
namestringThe variant name
pricefloatThe retail price of the variant
price_is_promotionalbooleanWhether the current price is a promotional price
productobjectThe parent product object (same structure as product fields above)
sizestringThe size of the variant
web_urlstringURL to the variant on the retailer's website

Barcode fields

FieldTypeDescription
barcodestringThe barcode value
created_datestringISO 8601 datetime when the barcode was created
deletedbooleanWhether the barcode has been deleted
idintegerUnique barcode identifier
last_modified_datestringISO 8601 datetime when the barcode was last modified
product_variant_idintegerThe ID of the product variant the barcode belongs to