DraftOrder
Requires access scope.
An order that a merchant creates on behalf of a customer. Draft orders are useful for merchants that need to do the following tasks:
- Create new orders for sales made by phone, in person, by chat, or elsewhere. When a merchant accepts payment for a draft order, an order is created.
- Send invoices to customers to pay with a secure checkout link.
- Use custom items to represent additional costs or products that aren't displayed in a shop's inventory.
- Re-create orders manually from active sales channels.
- Sell products at discount or wholesale rates.
- Take pre-orders.
- Save an order as a draft and resume working on it later.
For draft orders in multiple currencies is the source of truth for what a customer is going to be charged and
is an estimate of what the merchant might receive in their shop currency.
Caution: Only use this data if it's required for your app's functionality. Shopify will restrict access to scopes for apps that don't have a legitimate use for the associated data.
Anchor to Fields and connectionsFields and connections
- Anchor to acceptAutomaticDiscountsaccept•
Automatic Discounts Whether or not to accept automatic discounts on the draft order during calculation. If false, only discount codes and custom draft order discounts (see
) will be applied. If true, eligible automatic discounts will be applied in addition to discount codes and custom draft order discounts.
- Anchor to allowDiscountCodesInCheckoutallow•
Discount Codes In Checkout Boolean!non-null Whether discount codes are allowed during checkout of this draft order.
- Anchor to allVariantPricesOverriddenall•
Variant Prices Overridden Boolean!non-null Whether all variant prices have been overridden.
- Anchor to anyVariantPricesOverriddenany•
Variant Prices Overridden Boolean!non-null Whether any variant prices have been overridden.
- Anchor to appliedDiscountapplied•
Discount The custom order-level discount applied.
- Anchor to billingAddressbilling•
Address The billing address of the customer.
- Anchor to billingAddressMatchesShippingAddressbilling•
Address Matches Shipping Address Boolean!non-null Whether the billing address matches the shipping address.
- Anchor to completedAtcompleted•
At The date and time when the draft order was converted to a new order, and had it's status changed to Completed.
- Anchor to createdAtcreated•
At DateTime! non-null The date and time when the draft order was created in Shopify.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The shop currency used for calculation.
- Anchor to customAttributescustom•
Attributes [Attribute!]!non-null The custom information added to the draft order on behalf of the customer.
- Anchor to customercustomer•
The customer who will be sent an invoice.
- Anchor to defaultCursordefault•
Cursor String!non-null A default cursor that returns the single next record, sorted ascending by ID.
- Anchor to discountCodesdiscount•
Codes [String!]!non-null All discount codes applied.
- Anchor to emailemail•
The email address of the customer, which is used to send notifications.
- Anchor to eventsevents•Event
Connection! non-null The list of events associated with the draft order.
- Anchor to hasTimelineCommenthas•
Timeline Comment Boolean!non-null Whether the merchant has added timeline comments to the draft order.
- •ID!non-null
A globally-unique ID.
- Anchor to invoiceEmailTemplateSubjectinvoice•
Email Template Subject String!non-null The subject defined for the draft invoice email template.
- Anchor to invoiceSentAtinvoice•
Sent At The date and time when the invoice was last emailed to the customer.
- Anchor to invoiceUrlinvoice•
Url The link to the checkout, which is sent to the customer in the invoice email.
- Anchor to legacyResourceIdlegacy•
Resource Id UnsignedInt64! non-null The ID of the corresponding resource in the REST Admin API.
- Anchor to lineItemsline•
Items DraftOrder non-nullLine Item Connection! The list of the line items in the draft order.
- Anchor to lineItemsSubtotalPriceline•
Items Subtotal Price MoneyBag! non-null A subtotal of the line items and corresponding discounts, excluding include shipping charges, shipping discounts, taxes, or order discounts.
- Anchor to localizedFieldslocalized•
Fields LocalizedField non-nullConnection! List of localized fields for the resource.
- Anchor to metafieldmetafield•
A custom field, including its
namespace
andkey
, that's associated with a Shopify resource for the purposes of adding and storing additional information.- Anchor to metafieldsmetafields•Metafield
Connection! non-null A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to namename•String!non-null
The identifier for the draft order, which is unique within the store. For example, #D1223.
- Anchor to note2note2•
The text from an optional note attached to the draft order.
- Anchor to orderorder•
The order that was created from the draft order.
- Anchor to paymentTermspayment•
Terms The associated payment terms for this draft order.
- Anchor to phonephone•
The assigned phone number.
- Anchor to platformDiscountsplatform•
Discounts [DraftOrder non-nullPlatform Discount!]! The list of platform discounts applied.
- Anchor to poNumberpo•
Number The purchase order number.
- Anchor to presentmentCurrencyCodepresentment•
Currency Code CurrencyCode! non-null The payment currency used for calculation.
- Anchor to purchasingEntitypurchasing•
Entity The purchasing entity.
- Anchor to readyready•Boolean!non-null
Whether the draft order is ready and can be completed. Draft orders might have asynchronous operations that can take time to finish.
- Anchor to reserveInventoryUntilreserve•
Inventory Until The time after which inventory will automatically be restocked.
- Anchor to shippingAddressshipping•
Address The shipping address of the customer.
- Anchor to shippingLineshipping•
Line The line item containing the shipping information and costs.
- Anchor to statusstatus•Draft
Order non-nullStatus! The status of the draft order.
- Anchor to subtotalPriceSetsubtotal•
Price Set MoneyBag! non-null The subtotal, of the line items and their discounts, excluding shipping charges, shipping discounts, and taxes.
- Anchor to tagstags•[String!]!non-null
The comma separated list of tags associated with the draft order. Updating
tags
overwrites any existing tags that were previously added to the draft order. To add new tags without overwriting existing tags, use the tagsAdd mutation.- Anchor to taxesIncludedtaxes•
Included Boolean!non-null Whether the line item prices include taxes.
- Anchor to taxExempttax•
Exempt Boolean!non-null Whether the draft order is tax exempt.
- Anchor to taxLinestax•
Lines [TaxLine!]! non-null The list of of taxes lines charged for each line item and shipping line.
- Anchor to totalDiscountsSettotal•
Discounts Set MoneyBag! non-null Total discounts.
- Anchor to totalLineItemsPriceSettotal•
Line Items Price Set MoneyBag! non-null Total price of line items.
- Anchor to totalPriceSettotal•
Price Set MoneyBag! non-null The total price, includes taxes, shipping charges, and discounts.
- Anchor to totalQuantityOfLineItemstotal•
Quantity Of Line Items Int!non-null The sum of individual line item quantities. If the draft order has bundle items, this is the sum containing the quantities of individual items in the bundle.
- Anchor to totalShippingPriceSettotal•
Shipping Price Set MoneyBag! non-null The total shipping price.
- Anchor to totalTaxSettotal•
Tax Set MoneyBag! non-null The total tax.
- Anchor to totalWeighttotal•
Weight UnsignedInt64! non-null The total weight in grams of the draft order.
- Anchor to transformerFingerprinttransformer•
Fingerprint Fingerprint of the current cart. In order to have bundles work, the fingerprint must be passed to each request as it was previously returned, unmodified.
- Anchor to updatedAtupdated•
At DateTime! non-null The 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.
- Anchor to visibleToCustomervisible•
To Customer Boolean!non-null Whether the draft order will be visible to the customer on the self-serve portal.
- Anchor to warningswarnings•[Draft
Order non-nullWarning!]! The list of warnings raised while calculating.
Map
Anchor to QueriesQueries
- •query
Returns a DraftOrder resource by ID.
- •query
List of saved draft orders.
DraftOrder Queries
Queried by
Anchor to MutationsMutations
- •mutation
Completes a draft order and creates an order.
- •mutation
Creates a draft order.
- •mutation
Creates a draft order from order.
- •mutation
Duplicates a draft order.
- •mutation
Sends an email invoice for a draft order.
- •mutation
Updates a draft order.
If a checkout has been started for a draft order, any update to the draft will unlink the checkout. Checkouts are created but not immediately completed when opening the merchant credit card modal in the admin, and when a buyer opens the invoice URL. This is usually fine, but there is an edge case where a checkout is in progress and the draft is updated before the checkout completes. This will not interfere with the checkout and order creation, but if the link from draft to checkout is broken the draft will remain open even after the order is created.
DraftOrder Mutations
Anchor to InterfacesInterfaces
- •interface
- •interface
- •interface
- •interface
- •interface
- •interface