Retrieve products
/v1/productsReturns whole products by their itemIds, in the same shape search returns them: every variant with its price and stock, every photo, the store it is from. Use it to open a product page for an item you got as a compact card from feed, similar or rank, or a list of ids you saved.
Only products in your organization's active datasets are read. An
id that is not one of them (archived, deleted, mistyped, another
organization's) is left out of products without an error, so check
the length when you need every one. Products come back in the order
you asked for them, each once.
Prices in the shopper's market
Send the shopper's country and each product is priced as search
prices it: price, currency and each variant's price,
compareAtPrice and inStock are their market's. Without it, or for
a country the store does not sell into, the store's default market is
used and product.marketExact is false. Unlike search, a product
their market does not sell is kept, marked product.soldHere: false,
so a saved product can still be shown as unavailable rather than
disappear.
Product reads draw on search's allowance, api.v1.search.query.
Request body
application/jsonrequiredFull itemIds. Duplicates are returned once.
The shopper's two-letter ISO 3166 country, such as US. Case does not matter.
Response
One per id found. Ids not found are left out.
Unique item id. It is the same id the queue entry was given at upload time.
The dataset the item belongs to.
The organization that owns the dataset.
Only active items are listed and searchable.
activearchivedIngest pipeline version the item was processed with.
What Stylor's product labeller read from the item's photos and listing
when it was processed. Fields with an enum are closed lists; the
taxonomy (slot, family, features) is shared by every catalogue.
Items processed before a field existed may lack it.
Merchant-facing product data. Everything here comes from your upload or your dataset configuration, not from AI.
Where the item came from. Copied from the dataset's store configuration at processing time.
When the processed item was first written.
When the item was last rewritten by a sync or reprocess.
Errors
26Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.
Request body must be valid JSON.The request body could not be parsed as JSON.
Request body must be a JSON object.The request body is empty, or parsed to something other than a JSON object.
No active datasets found for this organization. Activate one via the dashboard (Dataset → Settings) or through the REST API before proceeding.None of your datasets is active.
itemIds must be a non-empty array.itemIds is missing, not an array, or empty.
itemIds can hold at most 50 ids.itemIds holds more than 50 ids.
Each itemId must be a non-empty string.An entry of itemIds is not a string, is blank, or is longer than 100 characters.
country must be a two-letter ISO 3166 country code, such as 'US'.country was sent (non-null) but is not a string of exactly two letters.
curl -X POST "https://stylor.ai/api/v1/products" \
-H "Authorization: Bearer $STYLOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"itemIds": [
"35a725c8-23fb-4009-a52a-2a778d2e504a",
"a342cbe3-965b-4055-8ac3-20f63103cade"
],
"country": "CA"
}'{
"products": [
{
"itemId": "35a725c8-23fb-4009-a52a-2a778d2e504a",
"organizationId": "0b7c3d9e-1f2a-4b3c-9d8e-7f6a5b4c3d2e",
"datasetId": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"status": "active",
"version": 4,
"product": {
"name": "SLIM JEAN DENIM",
"url": "https://ca.stussy.com/products/slim-jean-denim",
"price": 195,
"currency": "CAD",
"market": "ca",
"marketExact": true,
"variants": [
{
"label": "Dark Wash Indigo / 30",
"options": [
{
"name": "Color",
"value": "Dark Wash Indigo"
},
{
"name": "Size",
"value": "30"
}
],
"inStock": false,
"price": 195
},
{
"label": "Dark Wash Indigo / 34",
"options": [
{
"name": "Color",
"value": "Dark Wash Indigo"
},
{
"name": "Size",
"value": "34"
}
],
"inStock": true,
"price": 195
}
],
"assets": {
"images": [
{
"originalImageUrl": "https://ca.stussy.com/cdn/shop/files/slim-jean-1.jpg",
"uploaded": {
"key": "v1/datasets/images/598fb45a-b960-4224-a83c-e9663116830d.jpeg",
"url": "https://stylor.ai/api/v1/image/v1/datasets/images/598fb45a-b960-4224-a83c-e9663116830d.jpeg"
}
}
]
}
},
"metadata": {
"gender": "mens",
"age_group": "adult",
"slot": "bottom",
"family": "jeans",
"color_family": "blue",
"fit": "slim"
},
"origin": {
"siteUrl": "https://ca.stussy.com",
"brandId": "ca-stussy-com",
"brand": "Stussy"
}
}
]
}