Skip to main content

commitDraftOrder

Commits a draft order, transitioning it from "draft" to "pending" state.

This mutation is used when a manual draft order is ready to be committed and should transition to the "pending" state, where transformations may be applied.

Requirements

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

Behavior

  • Transitions order from "draft" to "pending" state
  • Creates a new OrderStatus record with "pending" status
  • Applies transformations transactionally with the transition
  • Locks the order to prevent concurrent updates during transition
  • Returns the updated order with pending status

Errors

  • OrderNotFoundError: Order ID does not exist
  • InvalidStateError: Order is not in draft state
  • InvalidVersionError: Order is not using V2 aggregate
commitDraftOrder(
input: CommitDraftOrderInput!
): V2Order!

Arguments

commitDraftOrder.input ● CommitDraftOrderInput! non-null input

Parameters for CommitDraftOrder

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.