Stock of every variant, by product title
GET
/api/v1/workspaces/{workspaceId}/inventory-items
const url = 'https://api.crossmart.io/api/v1/workspaces/example/inventory-items?stockLevel=in_stock&sort=title&direction=asc&limit=50';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.crossmart.io/api/v1/workspaces/example/inventory-items?stockLevel=in_stock&sort=title&direction=asc&limit=50'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspaceId
required
string
Query Parameters
Section titled “Query Parameters”search
string
Matches the SKU or the product title
stockLevel
string
sort
string
direction
string
cursor
string format: uuid
nextCursor from the previous page
page
number
1-based page number, for tables with page numbers. It wins over cursor.
limit
number
Responses
Section titled “Responses”Media typeapplication/json
object
items
required
Array<object>
object
inventoryItemId
required
string format: uuid
variantId
required
string format: uuid
productId
required
string format: uuid
productTitle
required
string
optionValues
required
One value per product option, in order
Array<string>
sku
required
string
imageUrl
required
The product’s first image
string
tracked
required
Whether Crossmart tracks stock for this variant
boolean
onHand
required
Units in stock: available plus reserved
number
reserved
required
Units held for open orders
number
available
required
Units that can still be sold, and what channels receive
number
stockLevel
required
string
updatedAt
required
string format: date-time
nextCursor
required
Null on the last page
string
total
required
How many match in all, for page numbers
number
Example
{ "items": [ { "stockLevel": "in_stock" } ]}