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 & HasEvents & HasMetafields & LegacyInteroperability & 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: # - `comments` # - `created_at` # - `include_app_activity` # - `subject_type` # - `verb` # # See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax). 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 # The ID of the corresponding resource in the REST Admin API. legacyResourceId: UnsignedInt64! # 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 # Finds all metafields with a specific namespace under the resource. namespace: String # 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. 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 |
last
|
Int
|
|
Returns up to the last |
query
|
String
|
|
Supported filter parameters:
See the detailed search syntax. |
reverse
|
Boolean
|
|
Reverse the order of the underlying list. |
sortKey
|
EventSortKeys
|
|
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 |
last
|
Int
|
|
Returns up to the last |
reverse
|
Boolean
|
|
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 |
last
|
Int
|
|
Returns up to the last |
namespace
|
String
|
|
Finds all metafields with a specific namespace under the resource. |
reverse
|
Boolean
|
|
Reverse the order of the underlying list. |
Fields
completedAt
(DateTime
)
Date and time when the draft order converted to a new order, and the draft order's status changed to Completed.
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.
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.
subtotalPrice
(Money!
)
Subtotal of the line items and their discounts (does not contain shipping charges or shipping discounts, or taxes).
totalPrice
(Money!
)
Total amount of the draft order (includes taxes, shipping charges, and discounts).
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).