commercetools icon

commercetools

Interact with the commercetools API. Operations are auto-generated from the official Postman collection.

Actions671

Store Cart → Check if Cart exists in Store by Query Predicate

AI-generated

Summary

Check if a cart exists within a specified commercetools store by applying a query predicate filter.

Inputs

  • Store Cart Key (required) — The unique key identifying the store cart resource within commercetools.
  • Store Key (required) — The key of the store within commercetools where the cart is searched.
  • Filters — Additional query parameters to apply as filter predicates to the cart search, specified as a 'where' string for fine-grained conditions.

Output shape

a JSON object indicating whether a cart exists, including at least the fields 'exists' (boolean), 'statusCode' (number), and 'url' (string) used to perform the check.

The operation returns quickly with existence status based on an HTTP HEAD request. If the cart matching the query predicate exists, 'exists' is true with status code 200; if not, 'exists' is false with status code 404. Other HTTP errors result in an exception. The output does not include cart details, only existence information.

Examples

Example 1: Verify cart existence by query in a specific store

Provide the store cart key and store key, and optionally a 'where' filter to locate the cart matching criteria in that store. The node returns if such a cart exists.

Links

Discussion