commercetools icon

commercetools

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

Actions671

Product-discount → Check if ProductDiscount exists by Key

AI-generated

Summary

Check whether a ProductDiscount exists in the commercetools project by its unique key using a HEAD request.

Inputs

  • Product-discount Key (required) — The unique key of the ProductDiscount resource to check for existence.

Output shape

a single JSON object indicating existence with 'exists' boolean, HTTP status code, and requested URL

Returns { exists: true } if the ProductDiscount with the specified key exists (status code 200). Returns { exists: false } if it does not exist (status code 404). Throws an error for other HTTP issues.

Examples

Example 1: Check if ProductDiscount with key 'discount123' exists

Set resource to 'Product-discount', operation to 'Check if ProductDiscount exists by Key', and provide 'discount123' in Product-discount Key parameter.

Links

Discussion