Skip to main content

commitDraftOrder

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

This mutation is used when a manual draft order is ready to be accepted and should transition directly to the "accepted" state.

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 "accepted" state
  • Creates a new OrderState record with "accepted" status
  • Locks the order to prevent concurrent updates during transition
  • Returns the updated order with accepted 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.