The products a selection lists, with counts, saved or not
POST
/api/v1/workspaces/{workspaceId}/channel-connections/{connectionId}/product-selection/preview
const url = 'https://api.crossmart.io/api/v1/workspaces/example/channel-connections/example/product-selection/preview?limit=25';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"rule":{"filter":{"search":"example","status":"DRAFT","gap":"images","tags":["example"],"vendor":"example"},"includeProductIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"excludeProductIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.crossmart.io/api/v1/workspaces/example/channel-connections/example/product-selection/preview?limit=25' \ --header 'Content-Type: application/json' \ --data '{ "rule": { "filter": { "search": "example", "status": "DRAFT", "gap": "images", "tags": [ "example" ], "vendor": "example" }, "includeProductIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "excludeProductIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] } }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspaceId
required
string
connectionId
required
string
Query Parameters
Section titled “Query Parameters”cursor
string format: uuid
nextCursor from the previous page
limit
number
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
rule
required
The selection; null lists every product
object
filter
required
object
search
Matches title, handle or SKU
string
status
string
gap
string
tags
Products with any of these tags
Array<string>
vendor
Products of this vendor, ignoring case
string
includeProductIds
required
Array<string>
excludeProductIds
required
Array<string>
Responses
Section titled “Responses”Media typeapplication/json
object
total
required
Products the selection lists
number
matchingFilter
required
Products the filter matches, before the manual lists
number
addedManually
required
Products added by hand that the filter does not match
number
removedManually
required
Products the filter matches that were removed by hand
number
items
required
Array<object>
object
id
required
string format: uuid
handle
required
string
title
required
string
status
required
string
vendor
required
string
productType
required
string
variantCount
required
number
totalAvailable
required
Stock across variants that track it; null when none do
number
priceRange
required
object
min
required
Decimal string in the workspace currency
string
max
required
string
imageUrl
required
string
stores
required
The stores it is in, in the order it joined them
Array<object>
object
connectionId
required
string format: uuid
channel
required
string
storeName
required
string
status
required
string
source
required
string
updatedAt
required
string format: date-time
nextCursor
required
string
toPublish
required
Products saving this rule publishes now
number
toRemove
required
Products saving this rule delists now
number
Example
{ "items": [ { "status": "DRAFT", "priceRange": { "min": "22.00", "max": "89.00" }, "stores": [ { "channel": "shopify", "storeName": "Demo Store", "status": "PENDING", "source": "MANUAL" } ] } ]}