commercetools icon

commercetools

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

Actions671

Store Cart → Update Cart in Store by Key

AI-generated

Summary

Update a cart identified by its key within a specified store in commercetools by applying one or more update actions.

Inputs

  • Store Key (required) — The key of the store where the cart exists.
  • Cart Key (required) — The unique key identifying the cart within the store.
  • Version (required) — The current version of the cart resource for optimistic concurrency control.
  • Actions (JSON) — A raw JSON array of update actions to apply to the cart, overriding the UI-defined actions if provided.
  • Actions (UI) — A collection of individual update actions selectable and configurable through the UI. Each action modifies the cart (e.g., adding items, setting addresses).

Output shape

a single updated cart object in JSON format

The response returns the updated cart resource as a JSON object. Provide either Actions (JSON) for direct raw input of actions or Actions (UI) for selecting actions through the interface. The operation requires the correct current version to ensure successful update.

Examples

Example 1: Update a cart by adding a line item

Set Store Key and Cart Key for the target cart, specify the current Version, and use Actions (UI) to add a line item including product ID, variant ID, and quantity.

Links

Discussion