commercetools icon

commercetools

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

Actions671

Store Business Unit → Check if BusinessUnit exists in Store by Key

AI-generated

Summary

Check the existence of a specific Business Unit within a given Store by its key using the commercetools API.

Inputs

  • Store Business Unit Key (required) — The key identifying the Store Business Unit to check.
  • Store Key (required) — The key identifying the Store in which to check for the Business Unit.
  • Business Unit Key (required) — The key of the Business Unit whose existence in the Store is being checked.

Output shape

a JSON object containing at least 'exists' (boolean), 'statusCode' (number), and 'url' (string) fields indicating whether the Business Unit exists in the Store.

Uses an HTTP HEAD request to the commercetools API, returning an 'exists: true' with status code 200 if found, or 'exists: false' with status code 404 if not found. Other HTTP errors will throw an error.

Examples

Example 1: Check if a Business Unit with key 'bu-123' exists in Store 'store-abc' and Store Business Unit with key 'sbunit-key'

Provide 'sbunit-key' as Store Business Unit Key, 'store-abc' as Store Key, and 'bu-123' as Business Unit Key.

Links

Discussion