Support

addDraftOrder

View as Markdown

Create a new draft order

mutation

Requires one of commerce.order:create, commerce.order:update, commerce.order:cancel, or commerce.order:complete (use the scope that matches the operation).

Create a new draft order

Required headers

HeaderRequiredDescription
x-store-idYesID of the store the operation targets. Omitting it returns HTTP 200 with a GraphQL error: extensions.code: "UNAUTHENTICATED".

Go to Authentication for credential setup.

Arguments

  • input AddDraftOrderInput! required
    • context OrderContextInput! required
    • billing OrderBillingInfoInput optional
    • canceledAt DateTime optional
    • cartId String optional
    • completedAt DateTime optional
    • customerId String optional
    • discounts [DiscountInput!] optional
    • externalId String optional
    • fees [FeeInput!] optional
    • fulfilledAt DateTime optional
    • fulfillmentModes [String!] optional — Automatically set based on lineItem fulfillment modes. This field is read-only.
    • inventoryAction InventoryAction optional
    • lineItems [CreateDraftLineItemInput!] optional
    • metafields [OrderMetafieldInput!] optional
    • notes [NoteInput!] optional
    • number String optional
    • numberDisplay String optional
    • paidAt DateTime optional
    • refundedAt DateTime optional
    • shipping OrderShippingInfoInput optional
    • shippingLines [ShippingLineInput!] optional
    • staffUserIds [String!] optional
    • tags [String!] optional
    • taxes [OrderTaxInput!] optional
    • taxExempted Boolean optional
    • totals OrderTotalsInput optional — Deprecated: Totals are now auto-calculated and should not be manually set
    • transactionIds [String!] optional

Possible returns

  • Order Order

Last updated on

How is this guide?