Skip to content

API coverage & limitations

The goal of @labdigital/commercetools-mock is to implement the commercetools HTTP API cleanly and completely, so you interact with it exactly as documented in the official commercetools API reference — the same endpoints, drafts, update actions and query parameters. There is no separate resource catalog to learn.

In practice the mock is comprehensive but not yet exhaustive. This page lists the areas where behaviour currently differs from production. If something isn’t listed here, assume it should behave like commercetools — and please open an issue if it doesn’t.

These are gaps on the way to full parity, not deliberate design choices — they’re candidates for implementation and contributions are very welcome. Until then, don’t rely on them in tests.

AreaCurrent gap
sortIgnored on all list, projection and search endpoints — results come back in insertion order.
withTotalIgnored — total is always computed and returned.
limitNo maximum is enforced (the real API caps at 500). Default is 20.
where predicatesUnknown fields don’t error (they yield no match), so typos aren’t caught.
expandMulti-dimensional arrays (arrays-of-arrays) aren’t resolved.
Product SearchNo relevancy/scoring, boosting, facet filtering, fuzzy or full wildcard; full-text is substring matching; facets is always [].
Product Projection Searchfuzzy, localeProjection and storeProjection are ignored; range and filtered facets only work on variants.* sources.
Order SearchThe query body is ignored — all orders are returned, paginated (hits carry id and version only).
Missing endpoints / actionsNot every endpoint or update action exists yet; the mock returns an error rather than silently succeeding.

A few things are deliberately relaxed because the mock is a testing tool:

AreaBehaviourWhy
Credential validationClient id/secret are not verified, and expires_in (48h) is never enforced.Keeps test setup simple; opt into stricter checks with validateCredentials. See Authentication.
/me identityThe current customer comes from the request payload, not the token’s customer_id scope.Tokens aren’t tied to per-customer isolation in the mock.

Think one of the “not yet implemented” items should just work? It probably should — open an issue or send a PR. The goal is complete, faithful coverage.