commercetools icon

commercetools

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

Actions671

Order → Update Order by ID

AI-generated

Summary

Update an existing Order by its ID in commercetools by specifying the current version and a list of update actions.

Inputs

  • Order ID (required) — The unique identifier of the Order to update.
  • Version (required) — The current version number of the Order for optimistic concurrency control.
  • Actions (JSON) — A raw JSON array of update actions to apply to the Order; overrides Actions (UI) if provided.
  • Actions (UI) — A collection of configurable update actions to apply to the Order using the UI form; ignored if Actions (JSON) is supplied.

Output shape

a single updated Order object in JSON format

The operation returns the updated Order object as JSON. If an error occurs, it raises a NodeApiError. Multiple actions can be batched in one update request. Use the Version parameter to avoid update conflicts.

Examples

Example 1: To update an Order's comment and set a new shipping address, provide the Order ID and version, then use Actions (UI) to set the desired changes or supply them directly as JSON in Actions (JSON). The node executes the update against the commercetools API and returns the updated Order.

Order ID: required string; Version: required number (current Order version); Actions: either JSON array of actions or UI-configured actions specifying what to update.

Links

Discussion