commercetools icon

commercetools

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

Actions671

Discount Code → Check if DiscountCode exists by Query Predicate

AI-generated

Summary

Check whether a discount code exists in commercetools using a Query Predicate filter.

Inputs

  • Filters — Specify the 'where' filter string as a query predicate to refine which discount codes to check for existence.

Output shape

a single JSON object indicating existence status

Returns a JSON object containing an 'exists' boolean, the HTTP status code, and the request URL. No pagination applies.

Examples

Example 1: Check if any discount code matching a specific predicate exists

Set the 'where' filter with a commercetools query expression filtering discount codes, such as "code="SUMMER2023"".

Links

Discussion