DraftOrder

Required access

read_draft_orders access scope

Represents a draft order. Merchants can use draft orders to create orders on behalf of their customers.

Show definition
# Represents a draft order. Merchants can use draft orders to create orders on behalf of their customers.
type DraftOrder implements CommentEventSubject, HasMetafields, Node {
  # Order-level discount applied to the draft order.
  appliedDiscount: DraftOrderAppliedDiscount

  # Billing address of the customer.
  billingAddress: MailingAddress

  # Date and time when the draft order converted to a new order,
  # and the draft order's status changed to **Completed**.
  completedAt: DateTime

  # Date and time when the draft order was created in Shopify.
  createdAt: DateTime!

  # Three letter code for the currency of the store at the time that the invoice is sent.
  currencyCode: CurrencyCode!

  # Custom information added to the draft order on behalf of your customer.
  customAttributes: [Attribute!]!

  # Customer who will be sent an invoice for the draft order, if there is one.
  customer: Customer

  # Email address of the customer, which is used to send notifications to.
  email: String

  # List of events associated with the draft order.
  events(
    # Returns the elements that come after the specified cursor.
    after: String

    # Returns the elements that come before the specified cursor.
    before: String

    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns up to the last `n` elements from the list.
    last: Int

    # Supported filter parameters:
    #  - `created_at`
    #  - `comments`
    query: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: EventSortKeys = ID
  ): EventConnection!

  # Whether the merchant has added timeline comments to the draft order.
  hasTimelineComment: Boolean!

  # Globally unique identifier.
  id: ID!

  # Date and time when the invoice was last emailed to the customer.
  invoiceSentAt: DateTime

  # Link to the checkout, which is sent to your customer in the invoice email.
  invoiceUrl: URL

  # List of the line items in the draft order.
  lineItems(
    # Returns the elements that come after the specified cursor.
    after: String

    # Returns the elements that come before the specified cursor.
    before: String

    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns up to the last `n` elements from the list.
    last: Int

    # Reverse the order of the underlying list.
    reverse: Boolean = false
  ): DraftOrderLineItemConnection!

  # The metafield associated with the resource.
  metafield(
    # Identifier for the metafield (maximum of 30 characters).
    key: String!

    # Container for a set of metafields (maximum of 20 characters).
    namespace: String!
  ): Metafield

  # A paginated list of metafields associated with the resource.
  metafields(
    # Returns the elements that come after the specified cursor.
    after: String

    # Returns the elements that come before the specified cursor.
    before: String

    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns up to the last `n` elements from the list.
    last: Int

    # Reverse the order of the underlying list.
    reverse: Boolean = false
  ): MetafieldConnection!

  # Unique identifier for the draft order, which is unique within the store. For example, _#D1223_.
  name: String!

  # Text from an optional note attached to the draft order.
  note: String!

  # Text from an optional note attached to the draft order.
  note2: String

  # Order that was created from this draft order.
  order: Order

  # Shipping mailing address of the customer.
  shippingAddress: MailingAddress

  # Line item that contains the shipping costs.
  shippingLine: ShippingLine

  # Status of the draft order.
  status: DraftOrderStatus!

  # Subtotal of the line items and their discounts (does not contain shipping charges or shipping discounts, or taxes).
  subtotalPrice: Money!

  # Tags added to the draft order.
  tags: [String!]!

  # Whether the draft order is tax exempt.
  taxExempt: Boolean!

  # Total amount of taxes charged for each line item and shipping line.
  taxLines: [TaxLine!]!

  # Whether the line item prices include taxes.
  taxesIncluded: Boolean!

  # Total amount of the draft order (includes taxes, shipping charges, and discounts).
  totalPrice: Money!

  # Total shipping charge for the draft order.
  totalShippingPrice: Money!

  # Total amount of taxes for the draft order.
  totalTax: Money!

  # Total weight (grams) of the draft order.
  totalWeight: UnsignedInt64!

  # Date and time when the draft order was last changed.
  # The format is YYYY-MM-DD HH:mm:ss (for example, 2016-02-05 17:04:01).
  updatedAt: DateTime!
}

Implements

Connections

events   (EventConnection!)

List of events associated with the draft order.

Argument Type Default Description
after

String

Returns the elements that come after the specified cursor.

before

String

Returns the elements that come before the specified cursor.

first

Int

Returns up to the first n elements from the list.

last

Int

Returns up to the last n elements from the list.

query

String

Supported filter parameters:

  • created_at
  • comments

reverse

Boolean

false

Reverse the order of the underlying list.

sortKey

EventSortKeys

ID

Sort the underlying list by the given key.

lineItems   (DraftOrderLineItemConnection!)

List of the line items in the draft order.

Argument Type Default Description
after

String

Returns the elements that come after the specified cursor.

before

String

Returns the elements that come before the specified cursor.

first

Int

Returns up to the first n elements from the list.

last

Int

Returns up to the last n elements from the list.

reverse

Boolean

false

Reverse the order of the underlying list.

metafields   (MetafieldConnection!)

A paginated list of metafields associated with the resource.

Argument Type Default Description
after

String

Returns the elements that come after the specified cursor.

before

String

Returns the elements that come before the specified cursor.

first

Int

Returns up to the first n elements from the list.

last

Int

Returns up to the last n elements from the list.

reverse

Boolean

false

Reverse the order of the underlying list.

Fields

appliedDiscount   (DraftOrderAppliedDiscount)

Order-level discount applied to the draft order.

billingAddress   (MailingAddress)

Billing address of the customer.

completedAt   (DateTime)

Date and time when the draft order converted to a new order, and the draft order's status changed to Completed.

createdAt   (DateTime!)

Date and time when the draft order was created in Shopify.

currencyCode   (CurrencyCode!)

Three letter code for the currency of the store at the time that the invoice is sent.

customAttributes   ([Attribute!]!)

Custom information added to the draft order on behalf of your customer.

customer   (Customer)

Customer who will be sent an invoice for the draft order, if there is one.

email   (String)

Email address of the customer, which is used to send notifications to.

hasTimelineComment   (Boolean!)

Whether the merchant has added timeline comments to the draft order.

id   (ID!)

Globally unique identifier.

invoiceSentAt   (DateTime)

Date and time when the invoice was last emailed to the customer.

invoiceUrl   (URL)

Link to the checkout, which is sent to your customer in the invoice email.

metafield   (Metafield)

The metafield associated with the resource.

Argument Type Default Description
key

required

String!

Identifier for the metafield (maximum of 30 characters).

namespace

required

String!

Container for a set of metafields (maximum of 20 characters).

name   (String!)

Unique identifier for the draft order, which is unique within the store. For example, #D1223.

note2   (String)

Text from an optional note attached to the draft order.

order   (Order)

Order that was created from this draft order.

shippingAddress   (MailingAddress)

Shipping mailing address of the customer.

shippingLine   (ShippingLine)

Line item that contains the shipping costs.

status   (DraftOrderStatus!)

Status of the draft order.

subtotalPrice   (Money!)

Subtotal of the line items and their discounts (does not contain shipping charges or shipping discounts, or taxes).

tags   ([String!]!)

Tags added to the draft order.

taxExempt   (Boolean!)

Whether the draft order is tax exempt.

taxLines   ([TaxLine!]!)

Total amount of taxes charged for each line item and shipping line.

taxesIncluded   (Boolean!)

Whether the line item prices include taxes.

totalPrice   (Money!)

Total amount of the draft order (includes taxes, shipping charges, and discounts).

totalShippingPrice   (Money!)

Total shipping charge for the draft order.

totalTax   (Money!)

Total amount of taxes for the draft order.

totalWeight   (UnsignedInt64!)

Total weight (grams) of the draft order.

updatedAt   (DateTime!)

Date and time when the draft order was last changed. The format is YYYY-MM-DD HH:mm:ss (for example, 2016-02-05 17:04:01).

Deprecated fields

Show/Hide

note   (String!)

deprecated

Text from an optional note attached to the draft order.

Deprecation warning

Use note2 instead

Sign up for a Partner account to get started.

Sign up