products
Requires at least one of the permissions inventory:stock_adjustment:create, inventory:stock_transfer:create, payments:invoice:create, products:discount:create, products:product:list, products:product:read, purchase:debit_note:create, purchase:grn:create, purchase:purchase_order:create, purchase:purchase_order:update, sales:quote:create, sales:quote:update, sales:sales_invoice:create, sales:sales_order:create, sales:sales_order:update or storefront:storefront:update.
Returns a page of the products of your organization with a total count. Filter by search text, category, brand, status, price, tags and stock, and sort by name, SKU, price or date. Pages hold at most 100 products. Needs the products read or list permission, or permission to create or edit a document, stock form, discount scheme or storefront that picks products.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query Products($limit: Int!) {
products(limit: $limit) {
hasNextPage
nextCursor
totalCount
items {
id
name
status
createdAt
basePrice
baseUOMId
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query Products($limit: Int!) {\n products(limit: $limit) {\n hasNextPage\n nextCursor\n totalCount\n items {\n id\n name\n status\n createdAt\n basePrice\n baseUOMId\n }\n }\n}",
"variables": {
"limit": 0
}
}
EOF
Variables:
{
"limit": 0
}
Response:
{
"data": {
"products": {
"hasNextPage": true,
"nextCursor": "string",
"totalCount": 0,
"items": [
{
"id": "id",
"name": "string",
"status": "ACTIVE",
"createdAt": "2025-01-15T00:00:00Z",
"basePrice": 0,
"baseUOMId": "id"
}
]
}
}
}
products(
cursor: String
filter: ProductFilterInput
limit: Int! = 20
lite: Boolean = false
skip: Int
skipTotalCount: Boolean = false
sort: ProductSortInput
): ProductConnection!
Arguments
products.cursor ● String scalar
The cursor from the previous page. Omit it for the first page.
products.filter ● ProductFilterInput input
Optional filters: search text, category, brand, status, price range, tags, stock and last-updated date.
products.limit ● Int! non-null scalar
How many products to return, at most 100. Defaults to 20.
products.lite ● Boolean scalar
Set to true to load only the fields a catalog sync needs and skip the heavy per-variant details. Defaults to false.
products.skip ● Int scalar
How many products to skip, as an alternative to a cursor.
products.skipTotalCount ● Boolean scalar
Set to true to skip counting all matching products, which makes large pages faster. Defaults to false.
products.sort ● ProductSortInput input
The field and direction to sort by.
Type
ProductConnection object
A page of products.