commercetools icon

commercetools

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

Actions671

Cart Discount → Check if CartDiscount exists by Key

AI-generated

Summary

Check the existence of a Cart Discount in commercetools by its unique key using an HTTP HEAD request.

Inputs

  • Cart Discount Key (required) — The unique key identifying the Cart Discount to check.

Output shape

a single JSON object

Returns an object indicating whether the cart discount exists with properties 'exists' (boolean), 'statusCode' (HTTP status code), and 'url' (the API endpoint checked). Returns exists = false if the discount is not found (404); throws error for other failures.

Examples

Example 1: Check if a Cart Discount with key 'summer-sale' exists.

Set resource to 'Cart Discount', operation to 'Check if CartDiscount exists by Key', and provide 'summer-sale' as the Cart Discount Key input parameter.

Links

Discussion