Search variants with advanced filters

🚧

Beta — subject to change. This endpoint is publicly available, but its request/response shape may evolve before General Availability as we incorporate early feedback.

Searches variants using a structured filter body with nested logical operators (and, or) and per-field comparators. Use this when the flat query parameters on GET /variants aren’t expressive enough.

Only the fields listed in the request schema may appear in filter and order; unknown fields return 422. Custom field values are addressable via custom_fields.<uuid> nested paths, whichever representation the account returns them in — <uuid> is always the custom field definition id. The values on each returned variant follow the account’s representation, so the X-Custom-Fields-Format header applies here as well.

The response differs from GET /variants: the item reference is a single item_id with an item_type discriminator (rather than separate product_id/material_id), and the optional enriched item is returned under item. Use the include array to opt into item enrichment and to widen the result set to archived and/or deleted variants (both are excluded by default).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Structured filter body. See the schema for the field allowlist, the operator allowlist, and value caps.

filter
object

Filter clause. Only the fields listed below may appear here — unknown fields are rejected with 422. Custom field values can also be addressed via custom_fields.<uuid> nested keys, where <uuid> is the custom field definition id.

Sort directive(s). Each entry is <field> ASC|DESC (direction defaults to ASC). Only filterable fields may be used here. custom_fields.<uuid> nested paths are orderable.

integer
0 to 200
Defaults to 50

Page size. Defaults to 50 when omitted. Maximum 200.

integer
≥ 1
Defaults to 1

1-based page number. Defaults to 1 when omitted. Pagination follows the same convention as every other paginated endpoint in the public API.

include
array of strings

Related data to include and result-set widening. item enriches each variant with its parent item under item. archived and deleted include otherwise-excluded variants in the results.

include
Allowed:
Headers
string
enum

Selects the representation of custom_fields on items, for both the request body and the response.

  • default — object keyed by custom field definition id (UUID).
  • legacy — the {field_name, field_value} array tied to custom fields collections.

Most accounts do not need this header: an account that has not moved to item custom fields always gets legacy, and an account that has moved and no longer uses collections always gets the object representation. The header matters only while both are available for the account, where legacy is the default and default opts into the object representation.

Requesting a representation the account does not have returns 422, as does sending a custom_fields body whose shape does not match the representation in force, mixing both shapes in one request, or combining custom_field_collection_id with the object representation — that field belongs to the legacy representation and is left out of responses entirely under the object one. Responses vary on this header.

Allowed:
Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Choose an example:
application/json