commercetools icon

commercetools

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

Actions671

Order → Update Order by OrderNumber

AI-generated

Summary

Update an existing order in commercetools by specifying its order number and version, applying one or more update actions to modify its details.

Inputs

  • Order Number (required) — The unique order number identifying the order to update.
  • Version (required) — The current version of the order to ensure update concurrency control.
  • Actions (JSON) — A raw JSON array of actions to apply to the order; if provided and non-empty, this overrides UI-defined actions.
  • Actions (UI) — One or more update actions defined via the user interface to modify the order (e.g., set customer email, add delivery).

Output shape

a single JSON object representing the updated order.

The operation requires the order number and version to identify the order and manage update concurrency. Update actions can be specified either as a raw JSON array (which, if present and non-empty, takes precedence) or via an interface supporting multiple action types. The response returns the updated order object or an error if the update fails.

Examples

Example 1: Update an order's customer email and add a delivery address using the UI action collection.

Provide the order number and version, then add actions like 'SetCustomerEmail' and 'AddDelivery' under the UI actions.

Example 2: Send raw JSON update actions to set a new order number and change the order state.

Provide the order number, version, and a JSON array of actions such as [{"setOrderNumber":{"orderNumber":"new-number"}},{"changeOrderState":{"orderState":"Completed"}}].

Links

Discussion