curl --request POST \
--url 'https://clarus-api.com/graphql#ListProducts' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"query": "query($filter: ProductsFilterType) { products { all(filter: $filter) { edges { node { id code barcode description long_description product_type units_per_case shelf_life_min shelf_life_max commodity_code country_of_manufacture } } } } }"
}
'import requests
url = "https://clarus-api.com/graphql#ListProducts"
payload = { "query": "query($filter: ProductsFilterType) { products { all(filter: $filter) { edges { node { id code barcode description long_description product_type units_per_case shelf_life_min shelf_life_max commodity_code country_of_manufacture } } } } }" }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'query($filter: ProductsFilterType) { products { all(filter: $filter) { edges { node { id code barcode description long_description product_type units_per_case shelf_life_min shelf_life_max commodity_code country_of_manufacture } } } } }'
})
};
fetch('https://clarus-api.com/graphql#ListProducts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"products": {
"all": {
"edges": [
{
"node": {
"id": "1",
"code": "SKU-001",
"barcode": "5012345678901",
"description": "Widget Blue Large",
"long_description": "Blue large widget for industrial use",
"product_type": "standard",
"units_per_case": 12,
"shelf_life_min": null,
"shelf_life_max": null,
"commodity_code": "8471300000",
"country_of_manufacture": "GB"
}
}
]
}
}
}
}{
"error": "<string>"
}List products
Retrieve products using GraphQL. Supports filtering by code, barcode, description, account, and product type.
Note on all_codes filter: Use this only when you have a code/barcode value and don’t know which field it belongs to. It searches across code, barcode, case_barcode, inner_barcode, and outer_barcode using exact matching.
curl --request POST \
--url 'https://clarus-api.com/graphql#ListProducts' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"query": "query($filter: ProductsFilterType) { products { all(filter: $filter) { edges { node { id code barcode description long_description product_type units_per_case shelf_life_min shelf_life_max commodity_code country_of_manufacture } } } } }"
}
'import requests
url = "https://clarus-api.com/graphql#ListProducts"
payload = { "query": "query($filter: ProductsFilterType) { products { all(filter: $filter) { edges { node { id code barcode description long_description product_type units_per_case shelf_life_min shelf_life_max commodity_code country_of_manufacture } } } } }" }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'query($filter: ProductsFilterType) { products { all(filter: $filter) { edges { node { id code barcode description long_description product_type units_per_case shelf_life_min shelf_life_max commodity_code country_of_manufacture } } } } }'
})
};
fetch('https://clarus-api.com/graphql#ListProducts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"products": {
"all": {
"edges": [
{
"node": {
"id": "1",
"code": "SKU-001",
"barcode": "5012345678901",
"description": "Widget Blue Large",
"long_description": "Blue large widget for industrial use",
"product_type": "standard",
"units_per_case": 12,
"shelf_life_min": null,
"shelf_life_max": null,
"commodity_code": "8471300000",
"country_of_manufacture": "GB"
}
}
]
}
}
}
}{
"error": "<string>"
}Query Structure
query($filter: ProductsFilterType) {
products {
all(filter: $filter) {
edges {
node {
id
code
barcode
description
long_description
product_type
units_per_case
shelf_life_min
shelf_life_max
commodity_code
country_of_manufacture
}
}
}
}
}
Filter Argument
All filters are passed inside thefilter argument. Each filter field accepts an input object with operators:
{
"filter": {
"code": {
"ilike": "SKU-001"
}
}
}
Available Filters
| Filter | Input Type | Operators | Description |
|---|---|---|---|
code | StringInputType | eq, ilike, like, in, between | Product code |
barcode | StringInputType | eq, ilike, like, in, between | Product barcode |
all_codes | StringInputType | eq, ilike, like, in, between | Search across all code/barcode fields (exact match) |
description | StringInputType | eq, ilike, like, in, between | Product description |
account_id | IdInputType | eq, gt, gteq, lt, lteq, in, filled | Filter by account ID |
product_type | StringInputType | eq, ilike, like, in, between | Product type |
Filter Operators
| Input Type | Operators |
|---|---|
| StringInputType | eq (exact), ilike (case-insensitive partial), like (case-sensitive partial), in (array match), between (range) |
| IntegerInputType | eq, gt, gteq, lt, lteq, between |
| DatetimeInputType | eq, from, to, between |
| BooleanInputType | eq (required) |
| IdInputType | eq, gt, gteq, lt, lteq, in, filled |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
- Token URL
- https://clarus-api.com/oauth/token
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
GraphQL query string
"query($filter: ProductsFilterType) { products { all(filter: $filter) { edges { node { id code barcode description long_description product_type units_per_case shelf_life_min shelf_life_max commodity_code country_of_manufacture } } } } }"
Query variables including the filter object
Show child attributes
Show child attributes
{ "filter": { "code": { "ilike": "SKU-001" } } }

