commercetools icon

commercetools

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

Actions671

Inventory → Check if InventoryEntry exists by ID

AI-generated

Summary

Check whether an InventoryEntry exists by its Inventory ID in commercetools by performing a HEAD request.

Inputs

  • Inventory ID (required) — The unique identifier of the InventoryEntry to check for existence.

Output shape

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

Returns exists=true and statusCode=200 if the InventoryEntry exists; exists=false and statusCode=404 if it does not. Other HTTP errors are thrown as node errors.

Examples

Example 1: Check if an inventory entry with a given ID exists before attempting update.

Set resource to Inventory, operation to Check if InventoryEntry exists by ID, and specify the Inventory ID.

Links

Discussion