commercetools icon

commercetools

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

Actions671

Associate Cart → Check if Cart exists in BusinessUnit by ID as Associate

AI-generated

Summary

Check if a cart exists within a commercetools Business Unit by its Cart ID as a specified Associate.

Inputs

  • Associate Cart Key (required) — The key identifying the associate cart resource (used internally for selecting the correct API endpoint).
  • Cart ID (required) — The unique identifier of the cart to check for existence.
  • Associate ID (required) — The ID of the associate under whose context the cart existence is checked.

Output shape

a JSON object indicating existence status with fields 'exists' (boolean), 'statusCode' (HTTP status code), and 'url' (the requested URL).

This operation uses an HTTP HEAD request and returns existence status without full cart details. If the cart exists, returns { exists: true, statusCode: 200 }. If not found, returns { exists: false, statusCode: 404 }. Otherwise, throws an error for other HTTP errors.

Examples

Example 1: Check if cart exists in Business Unit by Cart ID as Associate

Set Associate Cart Key, Cart ID, and Associate ID parameters. Upon execution, receives a JSON output with details about whether the specified cart exists in the Business Unit under the associate's context.

Links

Discussion