Draft Order
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.
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.
Draft orders created on or after April 1, 2025 will be automatically purged after one year of inactivity.
Anchor to Fields and connectionsFields and connections
- Anchor to acceptAutomaticDiscountsaccept•Boolean
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•Boolean!non-null
Discount Codes In Checkout Whether discount codes are allowed during checkout of this draft order.
- Anchor to allVariantPricesOverriddenall•Boolean!non-null
Variant Prices Overridden Whether all variant prices have been overridden.
- Anchor to anyVariantPricesOverriddenany•Boolean!non-null
Variant Prices Overridden Whether any variant prices have been overridden.
- Anchor to appliedDiscountapplied•Draft
Discount Order Applied Discount The custom order-level discount applied.
- Anchor to billingAddressbilling•Mailing
Address Address The billing address of the customer.
- Anchor to billingAddressMatchesShippingAddressbilling•Boolean!non-null
Address Matches Shipping Address Whether the billing address matches the shipping address.
- Anchor to completedAtcompleted•Date
At Time 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•Date
At Time!non-null The date and time when the draft order was created in Shopify.
- Anchor to currencyCodecurrency•Currency
Code Code!non-null The shop currency used for calculation.
- Anchor to customAttributescustom•[Attribute!]!non-null
Attributes The custom information added to the draft order on behalf of the customer.
- Anchor to customercustomer•Customer
The customer who will be sent an invoice.
- Anchor to defaultCursordefault•String!non-null
Cursor A default cursor that returns the single next record, sorted ascending by ID.
- Anchor to discountCodesdiscount•[String!]!non-null
Codes All discount codes applied.
- Anchor to emailemail•String
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•Boolean!non-null
Timeline Comment Whether the merchant has added timeline comments to the draft order.
- •ID!non-null
A globally-unique ID.
- Anchor to invoiceEmailTemplateSubjectinvoice•String!non-null
Email Template Subject The subject defined for the draft invoice email template.
- Anchor to invoiceSentAtinvoice•Date
Sent At Time The date and time when the invoice was last emailed to the customer.
- Anchor to invoiceUrlinvoice•URL
Url The link to the checkout, which is sent to the customer in the invoice email.
- Anchor to legacyResourceIdlegacy•Unsigned
Resource Id Int64!non-null The ID of the corresponding resource in the REST Admin API.
- Anchor to lineItemsline•Draft
Items Order Line Item Connection!non-null The list of the line items in the draft order.
- Anchor to lineItemsSubtotalPriceline•Money
Items Subtotal Price Bag!non-null A subtotal of the line items and corresponding discounts, excluding include shipping charges, shipping discounts, taxes, or order discounts.
- Anchor to localizedFieldslocalized•Localized
Fields Field Connection!non-null List of localized fields for the resource.
- Anchor to metafieldmetafield•Metafield
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•String
The text from an optional note attached to the draft order.
- Anchor to orderorder•Order
The order that was created from the draft order.
- Anchor to paymentTermspayment•Payment
Terms Terms The associated payment terms for this draft order.
- Anchor to phonephone•String
The assigned phone number.
- Anchor to platformDiscountsplatform•[Draft
Discounts Order Platform Discount!]!non-null The list of platform discounts applied.
- Anchor to poNumberpo•String
Number The purchase order number.
- Anchor to presentmentCurrencyCodepresentment•Currency
Currency Code Code!non-null The payment currency used for calculation.
- Anchor to purchasingEntitypurchasing•Purchasing
Entity 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•Date
Inventory Until Time The time after which inventory will automatically be restocked.
- Anchor to shippingAddressshipping•Mailing
Address Address The shipping address of the customer.
- Anchor to shippingLineshipping•Shipping
Line Line The line item containing the shipping information and costs.
- Anchor to statusstatus•Draft
Order Status!non-null The status of the draft order.
- Anchor to subtotalPriceSetsubtotal•Money
Price Set Bag!non-null The subtotal, of the line items and their discounts, excluding shipping charges, shipping discounts, and taxes.
- •[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•Boolean!non-null
Included Whether the line item prices include taxes.
- Anchor to taxExempttax•Boolean!non-null
Exempt Whether the draft order is tax exempt.
- Anchor to taxLinestax•[Tax
Lines Line!]!non-null The list of of taxes lines charged for each line item and shipping line.
- Anchor to totalDiscountsSettotal•Money
Discounts Set Bag!non-null Total discounts.
- Anchor to totalLineItemsPriceSettotal•Money
Line Items Price Set Bag!non-null Total price of line items.
- Anchor to totalPriceSettotal•Money
Price Set Bag!non-null The total price, includes taxes, shipping charges, and discounts.
- Anchor to totalQuantityOfLineItemstotal•Int!non-null
Quantity Of Line Items 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•Money
Shipping Price Set Bag!non-null The total shipping price.
- Anchor to totalTaxSettotal•Money
Tax Set Bag!non-null The total tax.
- Anchor to totalWeighttotal•Unsigned
Weight Int64!non-null The total weight in grams of the draft order.
- Anchor to transformerFingerprinttransformer•String
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•Date
At Time!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•Boolean!non-null
To Customer Whether the draft order will be visible to the customer on the self-serve portal.
- Anchor to warningswarnings•[Draft
Order Warning!]!non-null The list of warnings raised while calculating.
Deprecated fields and connections
- Anchor to localizationExtensionslocalization•Localization
Extensions Extension Connection!non-nullDeprecated - Anchor to marketNamemarket•String!non-nullDeprecated
Name - Anchor to marketRegionCountryCodemarket•Country
Region Country Code Code!non-nullDeprecated - Anchor to subtotalPricesubtotal•Money!non-nullDeprecated
Price - Anchor to totalPricetotal•Money!non-nullDeprecated
Price - Anchor to totalShippingPricetotal•Money!non-nullDeprecated
Shipping Price - Anchor to totalTaxtotal•Money!non-nullDeprecated
Tax
Anchor to QueriesQueries
- •query
Returns a DraftOrder resource by ID.
- •query
List of saved draft orders.
Anchor to MutationsMutations
- •mutation
Completes a draft order and converts it into a regular order. The order appears in the merchant's orders list, and the customer can be notified about their order.
Use the
mutation when a merchant is ready to finalize a draft order and create a real order in their store. The
mutation also supports sales channel attribution for tracking order sources using the
argument, cart validation controls for app integrations, and detailed error reporting for failed completions.
You can complete a draft order with different payment scenarios:
- Mark the order as paid immediately.
- Set the order as payment pending using payment terms.
- Specify a custom payment amount.
- Select a specific payment gateway.
NoteWhen completing a draft order, inventory is reserved for the items in the order. This means the items will no longer be available for other customers to purchase. Make sure to verify inventory availability before completing the draft order.
- •ID!required
The draft order to complete.
- Anchor to paymentGatewayIdpayment•ID
Gateway Id The gateway for the completed draft order.
- Anchor to paymentPendingpayment•BooleanDeprecatedDefault:false
Pending - Anchor to sourceNamesource•String
Name A channel definition handle used for sales channel attribution.
Arguments
- Anchor to draftOrderdraft•Draft
Order Order The completed draft order.
- Anchor to userErrorsuser•[User
Errors Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Creates a draft order with attributes such as customer information, line items, shipping and billing addresses, and payment terms. Draft orders are useful for merchants that need to:
- 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 with a secure checkout link.
- Use custom items to represent additional costs or products not in inventory.
- Re-create orders manually from active sales channels.
- Sell products at discount or wholesale rates.
- Take pre-orders.
After creating a draft order, you can:
- Send an invoice to the customer using the
mutation.
- Complete the draft order using the
mutation.
- Update the draft order using the
mutation.
- Duplicate a draft order using the
mutation.
- Delete the draft order using the
mutation.
NoteWhen you create a draft order, you can't reserve or hold inventory for the items in the order by default. However, you can reserve inventory using the
input.
- Anchor to inputinput•Draft
Order Input!required The fields used to create the draft order.
Arguments
- Anchor to draftOrderdraft•Draft
Order Order The created draft order.
- Anchor to userErrorsuser•[User
Errors Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Creates a draft order from order.
- Anchor to orderIdorder•ID!required
Id Specifies the order's id that we create the draft order from.
Arguments
- Anchor to draftOrderdraft•Draft
Order Order The created draft order.
- Anchor to userErrorsuser•[User
Errors Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Duplicates a draft order.
- Anchor to draftOrderIddraft•IDDeprecated
Order Id - •ID
The ID of the draft order to duplicate.
Arguments
- Anchor to draftOrderdraft•Draft
Order Order The newly duplicated draft order.
- Anchor to userErrorsuser•[User
Errors Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Sends an email invoice for a draft order.
- Anchor to emailemail•Email
Input Specifies the draft order invoice email fields.
- •ID!required
Specifies the draft order to send the invoice for.
Arguments
- Anchor to draftOrderdraft•Draft
Order Order The draft order an invoice email is sent for.
- Anchor to userErrorsuser•[User
Errors Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •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.
- •ID!required
Specifies the draft order to update.
- Anchor to inputinput•Draft
Order Input!required The draft order properties to update.
Arguments
- Anchor to draftOrderdraft•Draft
Order Order The updated draft order.
- Anchor to userErrorsuser•[User
Errors Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
Anchor to InterfacesInterfaces
- •interface
- •interface
- •interface
- •interface
- •interface
- •interface