Skip to main content

completeOrder

Completes an accepted order, transitioning it from "accepted" to "completed" state.

This mutation manually completes an order. Typically, orders are automatically completed by the system when all order items have been fully shipped. However, this mutation allows for manual completion if needed.

Requirements

  • User must have complete_order permission
  • Valid brand context must be provided (via argument or X-Brand-Id header)
  • Order must exist and be in "accepted" state
  • Order must be using the V2 aggregate (internal_version = "v2")

Behavior

  • Transitions order from "accepted" to "completed" state
  • Creates a new OrderStatus record with "completed" status
  • Returns the updated order with completed status

Errors

  • OrderNotFoundError: Order ID does not exist
  • InvalidStateError: Order is not in accepted state
  • InvalidVersionError: Order is not using V2 aggregate
  • ValidationError: Order does not meet completion requirements
completeOrder(
input: CompleteOrderInput!
): V2Order!

Arguments

completeOrder.input ● CompleteOrderInput! non-null input

Parameters for CompleteOrder

Type

V2Order object

The V2 order type. This type represents a V2 order in the system with only the fields necessary for draft creation and details.