API Playground

List and search your entities. This playground calls the live API with your account credentials.

Authentication Required

You need to Login to test the API playground

List / Query entities

Retrieve a paginated list of entities for the active brand, optionally filtered and sorted.

This endpoint returns the entities (products) of your active brand using a declarative filter and sort tree. Each entity exposes its core fields plus a normalised attributes array that merges synthetic fields (title, description, brand, category, family) with the brand's global and family attributes.

The same logic is available through two methods: a simple GET with query string parameters, or a POST to /entities/query where the same parameters are sent as a JSON body. In the body, filters, sort and projection are native JSON instead of JSON-encoded strings. Prefer POST /entities/query for large filter trees (for example an in condition with hundreds of codes, which would overflow the maximum URL length) and to apply a saved view.

Note: All requests are scoped to your active brand. Pass an optional brand_id to override it.
Endpoint URL
GET https://api.commerceclarity.com/api/2026-05/entities
POST https://api.commerceclarity.com/api/2026-05/entities/query

Query Parameters

Parameter Type Required Description
filters object Optional Declarative filter tree of groups ({ "operator": "and"|"or", "conditions": [...] }) and conditions ({ "field": ..., "op": ..., "value": ... }). As a query param it must be a JSON-encoded string; in the POST body it can be a JSON object. See Building filters below.
sort array Optional Sort spec: [{ "field": "...", "dir": "asc"|"desc" }]. field is a standard field or attr.<norm_name>; dir defaults to asc. As a query param it must be a JSON-encoded string. When omitted, results are ordered by created_at descending.
page integer Optional 1-based page number. Default 1.
per_page integer Optional Page size. One of 10, 25, 50, 100. Default 50; any other value falls back to 50.
only_updated_attributes boolean Optional When true, each entity's attribute arrays are trimmed to entries whose own updated_at satisfies the updated_at conditions in the filter tree.
only_with_value boolean Optional When true, attributes whose value is null, empty string or empty array are removed from the response.
projection array Optional Ordered list of attribute norm_names. Each entity's attributes array then contains only these attributes, in this order. See Projection.
attribute_dependency string Optional norm_name, attribute_id or _id of a blocking attribute in the brand's attribute dependency rules. Each entity then returns only the attributes that the matching rule allows for its value of the blocking attribute.
brand_id string Optional Override the active brand for this request. The caller must be a member of that brand.

Building filters

The filters value is a recursive tree built from two kinds of nodes that can be freely nested:

  • Group — { "operator": "and" | "or", "conditions": [ ... ] }. Combines its child nodes with boolean AND / OR.
  • Condition — { "field": "...", "op": "...", "value": ... }. A single test on one field.

A group's conditions array may contain conditions, other groups, or a mix — so you can express arbitrarily nested AND/OR logic.

Fields

Standard fields (top-level entity fields):

code, status, publication_state, brand_id, channel_id, family_id, country, product_id, inventory_tags, created_at, updated_at.

product_id is the entity's own _id. It lets a filter tree subtract entities: { "field": "product_id", "op": "not in", "value": ["…"] } means "everything matching, except these".

Attribute fields — prefix the attribute's norm_name with attr. (e.g. attr.colore, attr.peso). Synthetic cc_* attributes are supported too: attr.cc_title, attr.cc_category, attr.cc_brand, … The available norm_name values come from the List attributes endpoint. Use the norm_name, not the display name: attr.Colore targets an attribute that doesn't exist and matches nothing, without raising an error.

Operators (op)

opMeaningvalue
isExact match.scalar
is notNot equal.scalar
is emptyField has no value.omit
is not emptyField has any value.omit
containsSubstring match (case-insensitive, multi-word supported).string
inMatches any value in the list.array
not inMatches none of the values in the list.array
greater thanNumeric greater-than.number
less thanNumeric less-than.number
betweenInclusive numeric range.[min, max]
is afterDate/number strictly after.date or number
is beforeDate/number strictly before.date or number
Notes: text and select values are matched case-insensitively; between expects a two-element [min, max] array; in / not in expect an array; is empty / is not empty take no value; booleans accept true / false (or the strings "true" / "false"); dates accept ISO strings (e.g. "2026-01-01"). Filtering and sorting run on the search index, so an attribute must be indexed for the brand to be filterable.

Conditions that can't be interpreted

Only the top-level shape of filters is validated (it must be a group with operator and conditions). Inside the tree, a condition the server can't turn into a query is dropped, not rejected:

  • a condition with a missing field or op;
  • an op that isn't in the table above;
  • a node that is not an object.

A dropped condition is simply left out, so it widens the result: a tree whose conditions are all dropped returns the whole catalogue. An empty conditions array also means "no filter". Check the operator spelling (is not empty, greater than, …) when a filter seems to have no effect.

An unknown field is not dropped: it is queried as is and matches no entity for positive operators (is, in, …) and every entity for negative ones (is not, not in, is empty). The bulk endpoints (delete, publication state, tags) are stricter and refuse a filter with any dropped condition.

Examples

Single condition — online products only
{
  "operator": "and",
  "conditions": [
    { "field": "publication_state", "op": "is", "value": "online" }
  ]
}
Attribute filters — colour in a set AND weight in a range
{
  "operator": "and",
  "conditions": [
    { "field": "attr.colore", "op": "in", "value": ["rosso", "blu"] },
    { "field": "attr.peso", "op": "between", "value": [10, 25] }
  ]
}
Nested AND / OR — online AND (title contains "pro" OR category is empty)
{
  "operator": "and",
  "conditions": [
    { "field": "publication_state", "op": "is", "value": "online" },
    {
      "operator": "or",
      "conditions": [
        { "field": "attr.cc_title", "op": "contains", "value": "pro" },
        { "field": "attr.cc_category", "op": "is empty" }
      ]
    }
  ]
}
Recently changed — updated after a date
{
  "operator": "and",
  "conditions": [
    { "field": "updated_at", "op": "is after", "value": "2026-01-01" }
  ]
}

Projection

By default every entity returns its full attributes array. Pass projection, a list of attribute norm_names, to get only those attributes, in the exact order given.

  • A norm_name the entity doesn't have is skipped, with no error and no placeholder.
  • Duplicate entries are ignored (the first occurrence wins).
  • Top-level fields (code, sku, pictures, …) are always returned; projection only filters attributes.
  • It combines with every other parameter and is applied last, after only_with_value.
  • An empty projection ([]) returns entities with no attributes. Omit the parameter to get every attribute.
Only title, brand and colour, in that order
{
  "projection": ["cc_title", "cc_brand", "colore"]
}

In a GET request, send it as a JSON-encoded string (?projection=["cc_title","cc_brand"]) or as a repeated projection[] parameter.

Apply a saved view

A saved view of the entities grid stores its filters, sort and columns in a definition that already has the shape this endpoint takes. There is no view_id parameter: to get a view's entities, read the view with GET /api/2026-05/entities/views/{id} and send its definition to POST /api/2026-05/entities/query.

View fieldQuery parameterHow
definition.filtersfiltersPass as is. Omit it when it is null.
definition.sortsortPass as is.
definition.columnsprojectionKeep the entries with visible: true, sort them by order, and send their colIds. Omit it when no column is visible.

A colId can also be a top-level field (code, sku, …): projection skips it without error, and top-level fields are returned anyway. A view can also reference attributes deleted after it was saved; nothing here raises an error for them, so drop them on your side by comparing against List attributes, as the grid does.

Request Examples

curl -X POST "https://api.commerceclarity.com/api/2026-05/entities/query" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "page": 1,
    "per_page": 50,
    "only_with_value": true,
    "filters": {
      "operator": "and",
      "conditions": [
        { "field": "publication_state", "op": "is", "value": "online" }
      ]
    },
    "sort": [{ "field": "updated_at", "dir": "desc" }]
  }'
$client = new \GuzzleHttp\Client();

$response = $client->post('https://api.commerceclarity.com/api/2026-05/entities/query', [
    'headers' => [
        'Authorization' => 'Bearer ' . $apiToken,
        'Accept'        => 'application/json',
    ],
    'json' => [
        'page'            => 1,
        'per_page'        => 50,
        'only_with_value' => true,
        'filters'         => [
            'operator'   => 'and',
            'conditions' => [
                ['field' => 'publication_state', 'op' => 'is', 'value' => 'online'],
            ],
        ],
        'sort' => [['field' => 'updated_at', 'dir' => 'desc']],
    ],
]);

$data = json_decode($response->getBody(), true);
const response = await fetch('https://api.commerceclarity.com/api/2026-05/entities/query', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiToken}`,
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  },
  body: JSON.stringify({
    page: 1,
    per_page: 50,
    only_with_value: true,
    filters: {
      operator: 'and',
      conditions: [
        { field: 'publication_state', op: 'is', value: 'online' }
      ]
    },
    sort: [{ field: 'updated_at', dir: 'desc' }]
  })
});

const data = await response.json();

Response Example

Success Response
{
  "status": "success",
  "results": {
    "data": [
      {
        "_id": "507f1f77bcf86cd799439011",
        "code": "8001234567890",
        "sku": "CUSTOM-SKU-123",
        "status": "completed",
        "publication_state": "online",
        "validation_messages": [],
        "pictures": [
          "https://media.commerceclarity.com/media/.../image.jpg"
        ],
        "pictures_updated_at": "2026-01-15T10:30:00.000000Z",
        "country": "it",
        "tags": ["tag1", "tag2"],
        "attributes": [
          { "id": null, "norm_name": "cc_title", "name": "cc_title", "type": "text", "value": "Product Name", "updated_at": null },
          { "id": null, "norm_name": "cc_category", "name": "cc_category", "type": "single-select", "value": [{ "option": "Home > Appliances", "option_id": "619" }], "updated_at": null },
          { "id": "color", "norm_name": "color", "name": "Color", "type": "multi-select", "value": [{ "option": "Black", "option_id": null }], "updated_at": "2026-01-15T10:30:00.000000Z" }
        ],
        "created_at": "2026-01-15T10:30:00.000000Z",
        "updated_at": "2026-01-15T10:30:00.000000Z"
      }
    ],
    "total": 500,
    "current_page": 1,
    "per_page": 50,
    "last_page": 10,
    "from": 1,
    "to": 50
  }
}

Response Structure

results holds the page of entities in results.data[] plus the pagination fields total, current_page, per_page, last_page, from and to (from / to are null when nothing matches). Each entity in results.data[] contains the following fields:

Field Type Description
_idstringMongoDB entity identifier.
codestringProduct code (e.g. EAN/GTIN).
skustring|nullCustomer SKU.
statusstring|nullProcessing status of the entity.
publication_statestringOne of pending_review, ready, online.
validation_messagesarray|nullValidation warnings/errors for the entity.
picturesarrayOrdered list of image URLs.
pictures_updated_atstring|nullTimestamp of the last picture change.
countrystringCountry/locale of the entity.
tagsarray|nullFree-form tags of the entity.
attributesarrayNormalised attribute list (see below).
attributes[].idstring|nullAttribute id; null for synthetic cc_* fields.
attributes[].norm_namestringNormalised name — the key used when updating the attribute.
attributes[].namestringHuman-readable attribute name.
attributes[].typestringtext, rich-text, number, boolean, single-select, multi-select.
attributes[].valuemixedValue, shaped by type (string, number, boolean, or option objects).
created_at / updated_atstringEntity timestamps.
Synthetic attributes: fields prefixed with cc_ (cc_title, cc_description, cc_short_description, cc_brand, cc_category, cc_family) are derived from core entity fields and always returned alongside the brand's real attributes.

Errors

Validation errors return 422 with { "status": "error", "message": "..." }:

TriggerMessage
filters is not valid JSONInvalid JSON in "filters" parameter: ...
filters is not a JSON objectThe "filters" parameter must be a JSON object.
filters missing operator or conditionsThe "filters" object must have "operator" (and|or) and "conditions" (array) keys.
filters.operator is not and or orThe "filters.operator" must be "and" or "or", got: "...".
filters.conditions is not an arrayThe "filters.conditions" must be an array.
sort is not valid JSONInvalid JSON in "sort" parameter: ...
sort is not a JSON arrayThe "sort" parameter must be a JSON array.
A sort entry is missing fieldsort[N] must be an object with at least a "field" key.
sort[N].dir is not asc or descsort[N].dir must be "asc" or "desc", got: "...".
projection is not valid JSONInvalid JSON in "projection" parameter: ...
projection is not a JSON arrayThe "projection" parameter must be a JSON array of attribute norm_name strings.
A projection entry is not a stringEach entry in "projection" must be an attribute norm_name string.
attribute_dependency set, but the brand has no dependency rulesNo attribute dependencies configured for this brand.
attribute_dependency matches no attribute of the brandAttribute not found for "attribute_dependency": ...
The attribute isn't the blocking attribute of any ruleAttribute "..." is not configured as a blocking attribute in any dependency rule.

Other errors:

  • 403 — brand_id points at a brand the caller isn't a member of.
  • 404 — brand_id points at a brand that doesn't exist.
  • 503 — the search index is temporarily unavailable. Retry after a short delay.