Skip to main content

createPendingOrder

Creates a new pending order in the V2 orders state machine.

Pending orders are used for external orders received from integrations. These orders are created directly in the "pending" state, bypassing the draft state. Pending orders typically have complete data as they come from external systems.

Requirements

  • User must have create_order permission
  • Valid brand context must be provided (via argument or X-Brand-Id header)
  • Order number must be unique within the brand context (if provided)
  • Sales channel must exist or system will use default

Arguments

Most arguments are optional, allowing flexibility for different external order formats. However, pending orders typically include complete order data from external systems.

Order Properties

  • **Order Identification**: order_number (optional, must be unique if provided)
  • **Sales Channel**: sales_channel_id (optional, system may use default)
  • **Responsible Person**: responsible_id (optional party/person ID)
  • **Addresses**: Shipping and billing address details (all optional)
  • **Order Items**: order_items array (optional)
  • **Notes**: order_notes array (optional)
  • **Metadata**: order_metadata JSON (optional)
  • **Tags**: order_tags array (optional)
  • **Customer**: customer_id (optional, for linking to existing customer)

Behavior

  • Creates order with "pending" status
  • Validates sales channel exists or uses default
  • Validates order number uniqueness if provided
  • Validates responsible person exists if provided
  • Returns the created order with pending status
createPendingOrder(
input: CreatePendingOrderInput!
): V2Order!

Arguments

createPendingOrder.input ● CreatePendingOrderInput! non-null input

Parameters for CreatePendingOrder

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.