Skip to main content

Search Product Variants

Searching product variants

Contents

Overview

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

This endpoint searches exclusively for product variants. The search matches against the product variant name and barcodes. Results are ranked by relevance, with stronger matches on the variant name weighted highest.

This endpoint returns only product variants. If you also need matching products in the same request, use the combined Search Products endpoint instead, which searches both products and product variants together.

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 the 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=2000042436020' \
-d 'page=1' \
-d 'count=25' \
'https://{Services API hostname}/search/product-variants'

Sample response

The response is a JSON array of product variant objects.

[
{
"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 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 (see Product fields)
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