Skip to main content

inventory Query

Description

Retrieves a paginated list of inventory items with comprehensive filtering options. Supports filtering by stock, status, type, location, categories, dates, and more. Results can be sorted by various fields. For filtering, use the filters parameter with InventoryFilters input type.

query inventory(
$page: Int
$limit: Int
$stock: String
$type: String
$status: String
$discogsStatus: String
$hasSnippet: String
$sort: String
$order: String
$supplierCode: [String]
$condition: [String]
$secondHand: Boolean
$location: [String]
$locationSearch: String
$categories: [String]
$labels: [String]
$itemId: Float
$term: String
$from: String
$to: String
$dateFilter: String
$preOrder: Boolean
$artists: [Float]
$styles: [String]
$genres: [String]
$createdBy: ID
$filters: InventoryFilters
) {
inventory(
page: $page
limit: $limit
stock: $stock
type: $type
status: $status
discogsStatus: $discogsStatus
hasSnippet: $hasSnippet
sort: $sort
order: $order
supplierCode: $supplierCode
condition: $condition
secondHand: $secondHand
location: $location
locationSearch: $locationSearch
categories: $categories
labels: $labels
itemId: $itemId
term: $term
from: $from
to: $to
dateFilter: $dateFilter
preOrder: $preOrder
artists: $artists
styles: $styles
genres: $genres
createdBy: $createdBy
filters: $filters
) {
pagination {
limit
count
page
pages
hasMore
}
entries {
_id
id
type
incId
uniqueId
oldId
created
modified
isForbiddenForSale
handle
path
uri
wants
bitly
}
metadata {
categories
supplierCodes
locations
}
stats {
total
stockCount
listingsCount
}
}
}

Variables

{
"page": 1,
"limit": 20,
"stock": "stock",
"type": "type",
"status": "status",
"discogsStatus": "discogsStatus",
"hasSnippet": "hasSnippet",
"sort": "sort",
"order": "order",
"supplierCode": [
"supplierCode"
],
"condition": [
"condition"
],
"secondHand": true,
"location": [
"location"
],
"locationSearch": "locationSearch",
"categories": [
"categories"
],
"labels": [
"labels"
],
"itemId": 30.7,
"term": "term",
"from": "from",
"to": "to",
"dateFilter": "dateFilter",
"preOrder": true,
"artists": [
30.7
],
"styles": [
"styles"
],
"genres": [
"genres"
],
"createdBy": "90e93e0c1af5e178db8d39dd",
"filters": {
"page": 1,
"limit": 20,
"stock": "stock",
"type": "type",
"itemTypes": [
"itemTypes"
],
"status": "status",
"discogsStatus": "discogsStatus",
"sort": "sort",
"order": 42,
"supplierCode": [
"supplierCode"
],
"condition": [
"condition"
],
"secondHand": true,
"location": [
"location"
],
"locationSearch": "locationSearch",
"categories": [
"categories"
],
"itemId": 30.7,
"term": "term",
"from": "from",
"to": "to",
"dateFilter": "dateFilter",
"availableDate": [
1706144561036
],
"publishedDate": [
1743805796744
],
"createdDate": [
1763467743356
],
"preOrder": true,
"labels": [
42
],
"sleeveCondition": [
"sleeveCondition"
],
"hasSnippet": "hasSnippet",
"artists": [
30.7
],
"styles": [
"styles"
],
"genres": [
"genres"
],
"formatDescriptions": [
"formatDescriptions"
],
"formats": [
"formats"
],
"years": [
42
],
"listingRefs": [
"listingRefs"
],
"filteredIds": [
"572a9741661b9a5a9459c76e"
],
"createdBy": "ce61707cdba8837227b7a9dd",
"countries": [
"Canada"
],
"manufacturers": [
"manufacturers"
],
"productTypes": [
"productTypes"
],
"giftCards": true
}
}

Response

{
"inventory": {
"pagination": {
"limit": 20,
"count": 10,
"page": 1,
"pages": 1,
"hasMore": true
},
"entries": [
{
"_id": "5f4a11e715155dab59a9db6e",
"id": 1.23,
"type": "ReleaseItem",
"incId": 1.23,
"uniqueId": "example",
"oldId": 1.23,
"created": 1762097343211,
"modified": 1762411115856,
"isForbiddenForSale": true,
"handle": "example",
"path": "/release/1763553751/release-artist-release-name",
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"wants": 42,
"bitly": "example"
}
],
"metadata": {
"categories": [
"example"
],
"supplierCodes": [
"example"
],
"locations": [
"example"
]
},
"stats": {
"total": 29.99,
"stockCount": 1.23,
"listingsCount": 1.23
}
}
}

Arguments

NameTypeDescription
pageIntThe requested page number. Defaults to 1 if not specified.
limitIntNumber of items per page. You can request a specific page size, and it will be used if it does not exceed the server-enforced maximum. If your requested size exceeds the maximum, the server will enforce the maximum limit.
stockStringStock filter. Valid values include "inStock", "outOfStock", or "all". Use filters.stock in InventoryFilters instead.
typeStringItem type filter (e.g., "ReleaseItem", "BookItem", "ProductItem"). Use filters.itemTypes in InventoryFilters instead.
statusStringListing status filter. Valid values are "published", "draft", or "private". Use filters.status in InventoryFilters instead.
discogsStatusStringDiscogs listing status filter. Valid values include "listed", "unlisted", or "all". Use filters.discogsStatus in InventoryFilters instead.
hasSnippetStringFilter for items with audio snippets. Valid values include "true", "false", or "all". Use filters.hasSnippet in InventoryFilters instead.
sortStringField name to sort results by. Use filters.sort in InventoryFilters instead.
orderStringSort order: "asc" for ascending, "desc" for descending. Use filters.order in InventoryFilters instead.
supplierCode[String]List of supplier codes to filter by. Use filters.supplierCode in InventoryFilters instead.
condition[String]List of media condition values to filter by. Use filters.condition in InventoryFilters instead.
secondHandBooleanWhether to filter for second-hand items only. Use filters.secondHand in InventoryFilters instead.
location[String]List of location names to filter by. Use filters.location in InventoryFilters instead.
locationSearchStringSearch term to filter locations by name. Use filters.locationSearch in InventoryFilters instead.
categories[String]List of category names to filter by. Use filters.categories in InventoryFilters instead.
labels[String]List of label names to filter by. Use filters.labels in InventoryFilters instead.
itemIdFloatSpecific item ID to filter by. Use filters.itemId in InventoryFilters instead.
termStringSearch term to filter items by. Use filters.term in InventoryFilters instead.
fromStringStart date for date range filtering. Use filters.availableDate, filters.publishedDate, or filters.createdDate in InventoryFilters instead.
toStringEnd date for date range filtering. Use filters.availableDate, filters.publishedDate, or filters.createdDate in InventoryFilters instead.
dateFilterStringDate filter type. Use specific date filters (availableDate, publishedDate, createdDate) in InventoryFilters instead.
preOrderBooleanWhether to filter for pre-order listings only. Use filters.preOrder in InventoryFilters instead.
artists[Float]List of artist IDs to filter by. Use filters.artists in InventoryFilters instead.
styles[String]List of style names to filter by. Use filters.styles in InventoryFilters instead.
genres[String]List of genre names to filter by. Use filters.genres in InventoryFilters instead.
createdByIDReference ID of the admin user who created the item. Use filters.createdBy in InventoryFilters instead.
filtersInventoryFiltersComprehensive filter input for inventory queries using InventoryFilters type.

Returns

Inventory