commercetools icon

commercetools

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

Actions671

Store Cart Discount → Update CartDiscount in Store by ID

AI-generated

Summary

Update a Cart Discount in a specific commercetools store by its ID using the provided version and specified update actions.

Inputs

  • Store Cart Discount Key (required) — The unique key of the Cart Discount resource in the store.
  • Cart Discount ID (required) — The unique identifier of the Cart Discount to update.
  • Store Key (required) — The unique key of the store where the Cart Discount exists.
  • Version (required) — The current version number of the Cart Discount for optimistic concurrency control.
  • Actions (JSON) — A raw JSON array of update actions to apply to the Cart Discount. Overrides the UI-based Actions if provided.

Output shape

a single JSON object representing the updated Cart Discount resource as returned by the commercetools API

The operation requires passing the current version for concurrency control and executes the provided update actions on the Cart Discount specified by ID within the given store. Errors are returned as node errors or JSON with an error message if 'continue on fail' is enabled.

Examples

Example 1: Update a cart discount's percentage value by its ID in a specific store

Set 'Store Cart Discount Key', 'Cart Discount ID', 'Store Key', and the 'Version' of the resource. Provide the update actions as a JSON array specifying the desired changes (e.g., changing discount percentage)

Links

Discussion