commercetools icon

commercetools

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

Actions671

Product-type → Check if ProductType exists by Key

AI-generated

Summary

Check whether a ProductType with a specified key exists in the commercetools project by making a HEAD request to the API.

Inputs

  • Product-type Key (required) — The unique key of the ProductType to check for existence.

Output shape

a JSON object with properties 'exists' (boolean), 'statusCode' (number), and 'url' (string).

Returns 'exists' as true if the ProductType exists (status 200), or false if it does not (status 404). Throws errors for other HTTP status codes. Uses a HEAD HTTP request for existence check.

Examples

Example 1: Check if the ProductType with key 'clothing' exists.

Set 'Product-type Key' to 'clothing'. On execution, the node returns a JSON object with 'exists' true or false, plus the HTTP status code and URL used.

Links

Discussion