commercetools icon

commercetools

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

Actions671

Discount-group → Check if DiscountGroup exists by Key

AI-generated

Summary

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

Inputs

  • Discount-group Key (required) — The unique key of the Discount-group to check for existence.

Output shape

A JSON object indicating existence as a boolean under 'exists', with HTTP status code and requested URL.

Returns an object with 'exists' being true if found (HTTP 200), false if not found (HTTP 404). If other errors occur, an exception is thrown. This operation uses the commercetools project and region credentials to build the API request URL.

Examples

Example 1: Input key 'summer-sale' to verify if the Discount-group exists in the commercetools project.

Set the 'Discount-group Key' parameter to 'summer-sale'. The node outputs a JSON like { exists: true, statusCode: 200, url: 'https://api..commercetools.com//discount-groups/key=summer-sale' } if it exists, or exists: false with statusCode 404 if not.

Links

Discussion