commercetools icon

commercetools

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

Actions671

State → Check if State exists by Key

AI-generated

Summary

Check for the existence of a commercetools State by its unique key using an HTTP HEAD request.

Inputs

  • State Key (required) — The unique key of the State resource to check for existence.

Output shape

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

Returns 'exists: true' with status code 200 if the State exists; returns 'exists: false' with status code 404 if it does not. Throws an error for other HTTP errors.

Examples

Example 1: Check if a State with key 'active-state' exists

Set 'resource' to 'State', 'operation' to 'Check if State exists by Key', and provide 'active-state' as the State Key.

Links

Discussion