DraftOrder
You can use the DraftOrder resource to allow merchants to create orders on behalf of customers. This is useful for Shopify merchants who receive orders through outside channels and enables a wide range of use cases including the following:
- Create new orders for sales made by phone, in person, via chat, or by other means. Credit card payments for these orders can subsequently be entered in the Shopify admin.
- 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 mistaken orders.
- Sell products at discount or wholesale rates.
- Take pre-orders.
Note
The Draft Order resource does not expose reserve inventory information.
What you can do with DraftOrder
The Shopify API lets you do the following with the DraftOrder resource. More detailed versions of these general actions may be available:
- POST /admin/api/2019-10/draft_orders.json Create a new DraftOrder
- PUT /admin/api/2019-10/draft_orders/{draft_order_id}.json Modify an existing DraftOrder
- GET /admin/api/2019-10/draft_orders.json Retrieves a list of draft orders
- GET /admin/api/2019-10/draft_orders/{draft_order_id}.json Receive a single DraftOrder
- GET /admin/api/2019-10/draft_orders/count.json Receive a count of all DraftOrders
- POST /admin/api/2019-10/draft_orders/{draft_order_id}/send_invoice.json Send an invoice
- DELETE /admin/api/2019-10/draft_orders/{draft_order_id}.json Remove an existing DraftOrder
- PUT /admin/api/2019-10/draft_orders/{draft_order_id}/complete.json Complete a draft order
DraftOrder properties
id |
The ID of the draft order. |
order_id |
The ID of the order that 's created and associated with the draft order after the draft order is completed. |
name |
Name of the draft order. |
customer |
Information about the customer. To load a customer, provide the ID as part of the draft order object in the Create POST request.
To remove a customer, set the customer property to |
shipping_address |
The mailing address to where the order will be shipped. This address is optional and will not be available on orders that do not require shipping. It has the following properties:
|
billing_address |
The mailing address associated with the payment method. This address is an optional field that won't be available on orders that do not require a payment method. It has the following properties:
|
note |
The text of an optional note that a shop owner can attach to the draft order. |
note_attributes |
Extra information that is added to the order. Appears in the Additional details section of an order details page. Each array entry must contain a hash with |
The customer's email address. |
|
currency |
The three letter code (ISO 4217 format) for the currency used for the payment. |
invoice_sent_at |
The date and time (ISO 8601 format) when the invoice was emailed to the customer. |
invoice_url |
The URL for the invoice. |
line_items |
Product variant line item or custom line item associated to the draft order.
Each draft order must include at least one
|
shipping_line |
A
|
tags |
A comma-seperated list of additional short descriptors, commonly used for filtering and searching.
Each individual tag is limited to 40 characters in length. For example, |
tax_exempt |
Whether taxes are exempt for the draft order. If set to |
tax_exemptions |
Whether the customer is exempt from paying specific taxes on their order. Canadian taxes only. Valid values:
|
tax_lines |
An array of tax line objects, each of which details a tax applicable to the order. Each object has the following properties:
|
applied_discount |
The discount applied to the line item or the draft order object. Each draft order object can have one
|
taxes_included |
Whether taxes are included in the order subtotal.
Valid values are |
total_tax |
The sum of all the taxes applied to the order. |
subtotal_price |
the price of the order before shipping and taxes. |
total_price |
The sum of all the prices of all the items in the order, taxes and discounts included. |
completed_at |
The date and time (ISO 8601 format) when the order is created and the draft order is completed. |
created_at |
The date and time (ISO 8601 format) when the order was created in Shopify. |
updated_at |
The date and time (ISO 8601 format) when the order was last modified. |
status |
The status of a draft order as it transitions into an order. When a draft order is created it is set to After a draft order is set to Valid values:
|
Endpoints
Creates a draft order.
Using the DraftOrder resource you can create orders in draft state using product variant line items,
or custom line items. To create a product variant draft order, provide the variant_id
, quantity
and discount
properties. To create a custom line item, provide the title
, price
, taxable
,
and quantity
properties.
Polling
When you create and update draft orders some calculations are done asynchronously, such as calculating shipping and taxes. There might be times when a draft order is created but these calculations haven't completed. In these cases, you need to poll the draft order until the calculations are finished.When a draft order requires polling, a
202 accepted
response code is returned along with location
and retry-after
response headers. The location
header refers to the URL to be polled, and retry-after
denotes the interval (in seconds) at which polling requests should be sent. When the draft order is ready, a 200 OK
response code will be returned.
About custom shipping lines
You can use the DraftOrder resource to send orders with custom shipping lines. A custom shipping line includes atitle
and price
with handle
set to Nil
. A shipping line with a carrier provided shipping rate
(currently set via the Shopify admin) includes the shipping rate handle.
Applying discounts
A draft order and its line items can have one discount each. Calculations for discounts are based on the setting
of the value_type
property, which can be set to either fixed_amount
or percentage
.
For example, you can apply a fixed amount discount to a draft order to reduce the price by the specified value
property.
When you use a percentage discount, the discount amount
property is the price multiplied by the value
property.
For line item discounts, the value
property is applied per individual unit of the item, based on the line item's quantity.
Calculating line item discount amounts
For fixed_amount
discounts, the total amount
corresponds to the line item quantity
times the value of the discount.
For percentage discounts, the total amount corresponds to the following:
amount = floor(price * quantity * value) / 100
, where floor()
is the usual round down function.
For non-fractional currencies, this formula needs to use round() instead of floor(), and the division by 100 takes place inside the rounding, resulting in a non-fractional value. Otherwise, an error is returned.
amount = round(price * quantity * value / 100)
Line item examples
Fixed amount discount
For a $19.99 line item with quantity of 2 and with $5 dollars off, discount amount corresponds to $10 ($5 * 2):
applied_discount: { "value_type": "fixed_amount", "value": 5, "amount": 10 }
For a fixed amount example, see Create a draft order with a discount.
Percentage discount
For a $19.99 line item with quantity of 2 and with 15% off, discount amount corresponds to $5.99 (floor ($19.99 * 2 * 15) / 100):
applied_discount: { "value_type": "percentage", "value": 15, "amount": 5.99 }
For a percentage example, see Create a percent discount on a line item.
Loading and removing customers
You can load a customer to a draft order by sending the customer_id
as part of the draft order object. The recommended way to remove a customer from a draft order is to make a POST request with the Customer object set to null,
without specifying an email, shipping address, or billing address.
A customer may also be removed by setting customer
, email
, shipping_address
, and billing_address
to null
.
use_customer_default_address
|
An optional boolean that you can send as part of a draft order object to load customer shipping information. Valid values: true or false. |
customer_id
|
Used to load the customer. When a customer is loaded, the customer’s email address is also associated. |
Create a simple draft order with only a product variant ID.
POST /admin/api/2019-10/draft_orders.json
{
"draft_order": {
"line_items": [
{
"variant_id": 447654529,
"quantity": 1
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"draft_order": {
"id": 1069920475,
"note": null,
"email": null,
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T21:06:07-05:00",
"updated_at": "2021-02-05T21:06:07-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D5",
"status": "open",
"line_items": [
{
"variant_id": 447654529,
"product_id": 921728736,
"title": "IPod Touch 8GB",
"variant_title": "Black",
"sku": "IPOD2009BLACK",
"vendor": "Apple",
"quantity": 1,
"requires_shipping": true,
"taxable": true,
"gift_card": false,
"fulfillment_service": "shipwire-app",
"grams": 567,
"tax_lines": [
{
"rate": 0.05,
"title": "GST",
"price": "9.95"
},
{
"rate": 0.08,
"title": "Tax",
"price": "15.92"
}
],
"applied_discount": null,
"name": "IPod Touch 8GB - Black",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/996505844"
}
],
"shipping_address": null,
"billing_address": null,
"invoice_url": "https://apple.myshopify.com/690933842/invoices/a264a161312e6beed61b56414c610921",
"applied_discount": null,
"order_id": null,
"shipping_line": null,
"tax_lines": [
{
"rate": 0.05,
"title": "GST",
"price": "9.95"
},
{
"rate": 0.08,
"title": "Tax",
"price": "15.92"
}
],
"tags": "",
"note_attributes": [],
"total_price": "224.87",
"subtotal_price": "199.00",
"total_tax": "25.87",
"presentment_currency": "USD",
"total_line_items_price_set": {
"shop_money": {
"amount": "199.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "199.00",
"currency_code": "USD"
}
},
"total_price_set": {
"shop_money": {
"amount": "224.87",
"currency_code": "USD"
},
"presentment_money": {
"amount": "224.87",
"currency_code": "USD"
}
},
"subtotal_price_set": {
"shop_money": {
"amount": "199.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "199.00",
"currency_code": "USD"
}
},
"total_tax_set": {
"shop_money": {
"amount": "25.87",
"currency_code": "USD"
},
"presentment_money": {
"amount": "25.87",
"currency_code": "USD"
}
},
"total_discounts_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_shipping_price_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"admin_graphql_api_id": "gid://shopify/DraftOrder/1069920475",
"customer": null
}
}
Create a draft order with a discount
POST /admin/api/2019-10/draft_orders.json
{
"draft_order": {
"line_items": [
{
"title": "Custom Tee",
"price": "20.00",
"quantity": 2
}
],
"applied_discount": {
"description": "Custom discount",
"value_type": "fixed_amount",
"value": "10.0",
"amount": "10.00",
"title": "Custom"
},
"customer": {
"id": 207119551
},
"use_customer_default_address": true
}
}
View Response
HTTP/1.1 201 Created
{
"draft_order": {
"id": 1069920476,
"note": null,
"email": "bob.norman@hostmail.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T21:06:11-05:00",
"updated_at": "2021-02-05T21:06:11-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D5",
"status": "open",
"line_items": [
{
"variant_id": null,
"product_id": null,
"title": "Custom Tee",
"variant_title": null,
"sku": null,
"vendor": null,
"quantity": 2,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 0,
"tax_lines": [],
"applied_discount": null,
"name": "Custom Tee",
"properties": [],
"custom": true,
"price": "20.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/996505845"
}
],
"shipping_address": {
"first_name": null,
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": null,
"address2": "",
"company": null,
"latitude": null,
"longitude": null,
"name": "",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": null,
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": null,
"address2": "",
"company": null,
"latitude": null,
"longitude": null,
"name": "",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/8c91e5ab131dcfb835ee36ebca238a70",
"applied_discount": {
"description": "Custom discount",
"value": "10.0",
"title": "Custom",
"amount": "10.00",
"value_type": "fixed_amount"
},
"order_id": null,
"shipping_line": null,
"tax_lines": [],
"tags": "",
"note_attributes": [],
"total_price": "30.00",
"subtotal_price": "30.00",
"total_tax": "0.00",
"presentment_currency": "USD",
"total_line_items_price_set": {
"shop_money": {
"amount": "40.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "40.00",
"currency_code": "USD"
}
},
"total_price_set": {
"shop_money": {
"amount": "30.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "30.00",
"currency_code": "USD"
}
},
"subtotal_price_set": {
"shop_money": {
"amount": "30.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "30.00",
"currency_code": "USD"
}
},
"total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_discounts_set": {
"shop_money": {
"amount": "10.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "10.00",
"currency_code": "USD"
}
},
"total_shipping_price_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"admin_graphql_api_id": "gid://shopify/DraftOrder/1069920476",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
}
}
Create a draft order with a discounted line item
POST /admin/api/2019-10/draft_orders.json
{
"draft_order": {
"line_items": [
{
"title": "Custom Tee",
"price": "20.00",
"quantity": 1,
"applied_discount": {
"description": "Custom discount",
"value_type": "fixed_amount",
"value": "10.0",
"amount": "10.0",
"title": "Custom"
}
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"draft_order": {
"id": 1069920477,
"note": null,
"email": null,
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T21:06:15-05:00",
"updated_at": "2021-02-05T21:06:15-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D5",
"status": "open",
"line_items": [
{
"variant_id": null,
"product_id": null,
"title": "Custom Tee",
"variant_title": null,
"sku": null,
"vendor": null,
"quantity": 1,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 0,
"tax_lines": [
{
"rate": 0.05,
"title": "GST",
"price": "0.50"
},
{
"rate": 0.08,
"title": "Tax",
"price": "0.80"
}
],
"applied_discount": {
"description": "Custom discount",
"value": "10.0",
"title": "Custom",
"amount": "10.00",
"value_type": "fixed_amount"
},
"name": "Custom Tee",
"properties": [],
"custom": true,
"price": "20.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/996505846"
}
],
"shipping_address": null,
"billing_address": null,
"invoice_url": "https://apple.myshopify.com/690933842/invoices/b7851c77e213cf06119f99a2bdf22532",
"applied_discount": null,
"order_id": null,
"shipping_line": null,
"tax_lines": [
{
"rate": 0.05,
"title": "GST",
"price": "0.50"
},
{
"rate": 0.08,
"title": "Tax",
"price": "0.80"
}
],
"tags": "",
"note_attributes": [],
"total_price": "11.30",
"subtotal_price": "10.00",
"total_tax": "1.30",
"presentment_currency": "USD",
"total_line_items_price_set": {
"shop_money": {
"amount": "20.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "20.00",
"currency_code": "USD"
}
},
"total_price_set": {
"shop_money": {
"amount": "11.30",
"currency_code": "USD"
},
"presentment_money": {
"amount": "11.30",
"currency_code": "USD"
}
},
"subtotal_price_set": {
"shop_money": {
"amount": "10.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "10.00",
"currency_code": "USD"
}
},
"total_tax_set": {
"shop_money": {
"amount": "1.30",
"currency_code": "USD"
},
"presentment_money": {
"amount": "1.30",
"currency_code": "USD"
}
},
"total_discounts_set": {
"shop_money": {
"amount": "10.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "10.00",
"currency_code": "USD"
}
},
"total_shipping_price_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"admin_graphql_api_id": "gid://shopify/DraftOrder/1069920477",
"customer": null
}
}
Create a draft order with a percent discount on a line item
POST /admin/api/2019-10/draft_orders.json
{
"draft_order": {
"line_items": [
{
"title": "Custom Tee",
"price": "20.00",
"quantity": 1,
"applied_discount": {
"description": "Custom discount",
"value_type": "percentage",
"value": "10.0",
"amount": "2.0",
"title": "Custom"
}
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"draft_order": {
"id": 1069920478,
"note": null,
"email": null,
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T21:06:18-05:00",
"updated_at": "2021-02-05T21:06:18-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D5",
"status": "open",
"line_items": [
{
"variant_id": null,
"product_id": null,
"title": "Custom Tee",
"variant_title": null,
"sku": null,
"vendor": null,
"quantity": 1,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 0,
"tax_lines": [
{
"rate": 0.05,
"title": "GST",
"price": "0.90"
},
{
"rate": 0.08,
"title": "Tax",
"price": "1.44"
}
],
"applied_discount": {
"description": "Custom discount",
"value": "10.0",
"title": "Custom",
"amount": "2.00",
"value_type": "percentage"
},
"name": "Custom Tee",
"properties": [],
"custom": true,
"price": "20.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/996505847"
}
],
"shipping_address": null,
"billing_address": null,
"invoice_url": "https://apple.myshopify.com/690933842/invoices/0cbd3a5f6adb8bdf037da467f245e48c",
"applied_discount": null,
"order_id": null,
"shipping_line": null,
"tax_lines": [
{
"rate": 0.05,
"title": "GST",
"price": "0.90"
},
{
"rate": 0.08,
"title": "Tax",
"price": "1.44"
}
],
"tags": "",
"note_attributes": [],
"total_price": "20.34",
"subtotal_price": "18.00",
"total_tax": "2.34",
"presentment_currency": "USD",
"total_line_items_price_set": {
"shop_money": {
"amount": "20.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "20.00",
"currency_code": "USD"
}
},
"total_price_set": {
"shop_money": {
"amount": "20.34",
"currency_code": "USD"
},
"presentment_money": {
"amount": "20.34",
"currency_code": "USD"
}
},
"subtotal_price_set": {
"shop_money": {
"amount": "18.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "18.00",
"currency_code": "USD"
}
},
"total_tax_set": {
"shop_money": {
"amount": "2.34",
"currency_code": "USD"
},
"presentment_money": {
"amount": "2.34",
"currency_code": "USD"
}
},
"total_discounts_set": {
"shop_money": {
"amount": "2.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "2.00",
"currency_code": "USD"
}
},
"total_shipping_price_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"admin_graphql_api_id": "gid://shopify/DraftOrder/1069920478",
"customer": null
}
}
Create custom draft order
POST /admin/api/2019-10/draft_orders.json
{
"draft_order": {
"line_items": [
{
"title": "Custom Tee",
"price": "20.00",
"quantity": 2
}
],
"customer": {
"id": 207119551
},
"use_customer_default_address": true
}
}
View Response
HTTP/1.1 201 Created
{
"draft_order": {
"id": 1069920479,
"note": null,
"email": "bob.norman@hostmail.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T21:06:21-05:00",
"updated_at": "2021-02-05T21:06:21-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D5",
"status": "open",
"line_items": [
{
"variant_id": null,
"product_id": null,
"title": "Custom Tee",
"variant_title": null,
"sku": null,
"vendor": null,
"quantity": 2,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 0,
"tax_lines": [],
"applied_discount": null,
"name": "Custom Tee",
"properties": [],
"custom": true,
"price": "20.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/996505848"
}
],
"shipping_address": {
"first_name": null,
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": null,
"address2": "",
"company": null,
"latitude": null,
"longitude": null,
"name": "",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": null,
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": null,
"address2": "",
"company": null,
"latitude": null,
"longitude": null,
"name": "",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/e5ad5282922948ade30d5530e2c07b1e",
"applied_discount": null,
"order_id": null,
"shipping_line": null,
"tax_lines": [],
"tags": "",
"note_attributes": [],
"total_price": "40.00",
"subtotal_price": "40.00",
"total_tax": "0.00",
"presentment_currency": "USD",
"total_line_items_price_set": {
"shop_money": {
"amount": "40.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "40.00",
"currency_code": "USD"
}
},
"total_price_set": {
"shop_money": {
"amount": "40.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "40.00",
"currency_code": "USD"
}
},
"subtotal_price_set": {
"shop_money": {
"amount": "40.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "40.00",
"currency_code": "USD"
}
},
"total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_discounts_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_shipping_price_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"admin_graphql_api_id": "gid://shopify/DraftOrder/1069920479",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
}
}
Add a note to a draft order
PUT /admin/api/2019-10/draft_orders/994118539.json
{
"draft_order": {
"id": 994118539,
"note": "Customer contacted us about a custom engraving on this iPod"
}
}
View Response
HTTP/1.1 202 Accepted
{
"draft_order": {
"id": 994118539,
"note": "Customer contacted us about a custom engraving on this iPod",
"email": "bob.norman@hostmail.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T21:06:25-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D2",
"status": "open",
"line_items": [
{
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 1,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"
}
],
"shipping_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/ba8dcf6c022ccad3d47e3909e378e33f",
"applied_discount": {
"description": "$5promo",
"value": "5.0",
"title": null,
"amount": "5.00",
"value_type": "fixed_amount"
},
"order_id": null,
"shipping_line": {
"title": "UPS Ground",
"custom": false,
"handle": "ups-3-12.25",
"price": "12.25"
},
"tax_lines": [],
"tags": "Wholesale",
"note_attributes": [],
"total_price": "206.25",
"subtotal_price": "194.00",
"total_tax": "0.00",
"presentment_currency": "USD",
"total_line_items_price_set": {
"shop_money": {
"amount": "199.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "199.00",
"currency_code": "USD"
}
},
"total_price_set": {
"shop_money": {
"amount": "206.25",
"currency_code": "USD"
},
"presentment_money": {
"amount": "206.25",
"currency_code": "USD"
}
},
"subtotal_price_set": {
"shop_money": {
"amount": "194.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "194.00",
"currency_code": "USD"
}
},
"total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_discounts_set": {
"shop_money": {
"amount": "5.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "5.00",
"currency_code": "USD"
}
},
"total_shipping_price_set": {
"shop_money": {
"amount": "12.25",
"currency_code": "USD"
},
"presentment_money": {
"amount": "12.25",
"currency_code": "USD"
}
},
"admin_graphql_api_id": "gid://shopify/DraftOrder/994118539",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
}
}
Set a discount on a draft order
PUT /admin/api/2019-10/draft_orders/994118539.json
{
"draft_order": {
"id": 994118539,
"applied_discount": {
"description": "Custom discount",
"value_type": "percentage",
"value": "10.0",
"amount": "19.90",
"title": "Custom"
}
}
}
View Response
HTTP/1.1 202 Accepted
{
"draft_order": {
"id": 994118539,
"note": "rush order",
"email": "bob.norman@hostmail.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T21:06:28-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D2",
"status": "open",
"line_items": [
{
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 1,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"
}
],
"shipping_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/ba8dcf6c022ccad3d47e3909e378e33f",
"applied_discount": {
"description": "Custom discount",
"value": "10.0",
"title": "Custom",
"amount": "19.90",
"value_type": "percentage"
},
"order_id": null,
"shipping_line": {
"title": "UPS Ground",
"custom": false,
"handle": "ups-3-12.25",
"price": "12.25"
},
"tax_lines": [],
"tags": "Wholesale",
"note_attributes": [],
"total_price": "191.35",
"subtotal_price": "179.10",
"total_tax": "0.00",
"presentment_currency": "USD",
"total_line_items_price_set": {
"shop_money": {
"amount": "199.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "199.00",
"currency_code": "USD"
}
},
"total_price_set": {
"shop_money": {
"amount": "191.35",
"currency_code": "USD"
},
"presentment_money": {
"amount": "191.35",
"currency_code": "USD"
}
},
"subtotal_price_set": {
"shop_money": {
"amount": "179.10",
"currency_code": "USD"
},
"presentment_money": {
"amount": "179.10",
"currency_code": "USD"
}
},
"total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_discounts_set": {
"shop_money": {
"amount": "19.90",
"currency_code": "USD"
},
"presentment_money": {
"amount": "19.90",
"currency_code": "USD"
}
},
"total_shipping_price_set": {
"shop_money": {
"amount": "12.25",
"currency_code": "USD"
},
"presentment_money": {
"amount": "12.25",
"currency_code": "USD"
}
},
"admin_graphql_api_id": "gid://shopify/DraftOrder/994118539",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
}
}
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
fields
|
A comma-separated list of fields to include in the response |
limit
|
Amount of results (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID |
updated_at_min
|
Show orders last updated after date (format: 2014-04-25T16:15:47-04:00) |
updated_at_max
|
Show orders last updated before date (format: 2014-04-25T16:15:47-04:00) |
ids
|
Filter by list of IDs |
status
|
|
fields
|
comma-separated list of fields to include in the response |
List all draft orders
GET /admin/api/2019-10/draft_orders.json
View Response
HTTP/1.1 200 OK
{
"draft_orders": [
{
"id": 72885271,
"note": "rush order",
"email": "bob.norman@hostmail.com",
"taxes_included": true,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D4",
"status": "completed",
"line_items": [
{
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 2,
"requires_shipping": true,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"
}
],
"shipping_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/f945c7e2b158dbb69fa642cb8d79171f",
"applied_discount": null,
"order_id": 450789469,
"shipping_line": null,
"tax_lines": [],
"tags": "",
"note_attributes": [],
"total_price": "409.94",
"subtotal_price": "398.00",
"total_tax": "11.94",
"admin_graphql_api_id": "gid://shopify/DraftOrder/72885271",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
},
{
"id": 622762746,
"note": "rush order",
"email": "bob.norman@hostmail.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D1",
"status": "open",
"line_items": [
{
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 1,
"requires_shipping": true,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"
},
{
"variant_id": null,
"product_id": null,
"title": "IPod Nano Engraving",
"variant_title": null,
"sku": "IPODENGRAVING",
"vendor": null,
"quantity": 1,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 0,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano Engraving",
"properties": [],
"custom": true,
"price": "30.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"
},
{
"variant_id": 457924702,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "black",
"sku": "IPOD2008BLACK",
"vendor": null,
"quantity": 3,
"requires_shipping": true,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - black",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"
}
],
"shipping_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/f1df1a91d10a6d7704cf2f0315461api",
"applied_discount": null,
"order_id": null,
"shipping_line": {
"title": "custom shipping",
"custom": true,
"handle": null,
"price": "10.00"
},
"tax_lines": [],
"tags": "",
"note_attributes": [],
"total_price": "836.00",
"subtotal_price": "826.00",
"total_tax": "0.00",
"admin_graphql_api_id": "gid://shopify/DraftOrder/622762746",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
},
{
"id": 691042898,
"note": "rush order",
"email": "bob.norman@hostmail.com",
"taxes_included": true,
"currency": "USD",
"invoice_sent_at": "2016-12-31T19:00:00-05:00",
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"tax_exempt": false,
"completed_at": "2016-12-31T19:00:00-05:00",
"name": "#D4",
"status": "completed",
"line_items": [
{
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 1,
"requires_shipping": true,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"
}
],
"shipping_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/56dd92fb7adc1a2c38402b1aab15b2f4",
"applied_discount": null,
"order_id": 450789469,
"shipping_line": {
"title": "UPS Ground",
"custom": false,
"handle": "ups-3-12.25",
"price": "12.25"
},
"tax_lines": [],
"tags": "",
"note_attributes": [],
"total_price": "409.94",
"subtotal_price": "398.00",
"total_tax": "11.94",
"admin_graphql_api_id": "gid://shopify/DraftOrder/691042898",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
},
{
"id": 994118539,
"note": "rush order",
"email": "bob.norman@hostmail.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D2",
"status": "open",
"line_items": [
{
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 1,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"
}
],
"shipping_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/ba8dcf6c022ccad3d47e3909e378e33f",
"applied_discount": {
"description": "$5promo",
"value": "5.0",
"title": null,
"amount": "5.00",
"value_type": "fixed_amount"
},
"order_id": null,
"shipping_line": {
"title": "UPS Ground",
"custom": false,
"handle": "ups-3-12.25",
"price": "12.25"
},
"tax_lines": [],
"tags": "Wholesale",
"note_attributes": [],
"total_price": "206.25",
"subtotal_price": "194.00",
"total_tax": "0.00",
"admin_graphql_api_id": "gid://shopify/DraftOrder/994118539",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
},
{
"id": 1012750869,
"note": "rush order",
"email": "bob.norman@hostmail.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D2",
"status": "open",
"line_items": [
{
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 1,
"requires_shipping": true,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"
}
],
"shipping_address": null,
"billing_address": null,
"invoice_url": "https://apple.myshopify.com/690933842/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi",
"applied_discount": null,
"order_id": null,
"shipping_line": null,
"tax_lines": [],
"tags": "",
"note_attributes": [],
"total_price": "836.00",
"subtotal_price": "826.00",
"total_tax": "0.00",
"admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869",
"customer": null
}
]
}
fields
|
A comma-separated list of fields to include in the response |
Get a representation of a single draft order
GET /admin/api/2019-10/draft_orders/994118539.json
View Response
HTTP/1.1 200 OK
{
"draft_order": {
"id": 994118539,
"note": "rush order",
"email": "bob.norman@hostmail.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D2",
"status": "open",
"line_items": [
{
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 1,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"
}
],
"shipping_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/ba8dcf6c022ccad3d47e3909e378e33f",
"applied_discount": {
"description": "$5promo",
"value": "5.0",
"title": null,
"amount": "5.00",
"value_type": "fixed_amount"
},
"order_id": null,
"shipping_line": {
"title": "UPS Ground",
"custom": false,
"handle": "ups-3-12.25",
"price": "12.25"
},
"tax_lines": [],
"tags": "Wholesale",
"note_attributes": [],
"total_price": "206.25",
"subtotal_price": "194.00",
"total_tax": "0.00",
"admin_graphql_api_id": "gid://shopify/DraftOrder/994118539",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
}
}
since_id
|
Count draft orders after the specified ID. |
status
|
Count draft orders that have a given status. (default:open )
|
updated_at_max
|
Count draft orders last updated before the specified date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Count draft orders last updated after the specified date (format: 2014-04-25T16:15:47-04:00). |
Count all draft orders
GET /admin/api/2019-10/draft_orders/count.json
View Response
HTTP/1.1 200 OK
{
"count": 5
}
Sends an invoice for the draft order.
You can include the following parameters in the body of the request:
- draft_order_invoice: The object to send in the body of the request.
- to: The email address that will populate the to field of the email.
- from: The email address that will populate the from field of the email.
- bcc: The list of email addresses to include in the bcc field of the email. Emails must be associated with staff accounts on the shop.
- subject: The email subject.
- custom_message: The custom message displayed in the email.
Send a customized invoice
POST /admin/api/2019-10/draft_orders/994118539/send_invoice.json
{
"draft_order_invoice": {
"to": "first@example.com",
"from": "steve@apple.com",
"bcc": [
"steve@apple.com"
],
"subject": "Apple Computer Invoice",
"custom_message": "Thank you for ordering!"
}
}
View Response
HTTP/1.1 201 Created
{
"draft_order_invoice": {
"to": "first@example.com",
"from": "steve@apple.com",
"subject": "Apple Computer Invoice",
"custom_message": "Thank you for ordering!",
"bcc": [
"steve@apple.com"
]
}
}
Send the default invoice
POST /admin/api/2019-10/draft_orders/994118539/send_invoice.json
{
"draft_order_invoice": {}
}
View Response
HTTP/1.1 201 Created
{
"draft_order_invoice": {
"to": "bob.norman@hostmail.com",
"from": "steve@apple.com",
"subject": "Draft Order #D2",
"custom_message": "",
"bcc": []
}
}
Permanently delete a draft order
DELETE /admin/api/2019-10/draft_orders/994118539.json
View Response
HTTP/1.1 200 OK
{
}
Using the DraftOrder resource, you can create a draft order and transition it to an order.
The following flows are supported:
- Create a draft order that calculates taxes and totals but accept payment from the customer outside of Shopify.
- Create a draft order and send an invoice to the customer.
payment_pending
|
|
Complete a draft order, marking it as paid
PUT /admin/api/2019-10/draft_orders/994118539/complete.json
View Response
HTTP/1.1 200 OK
{
"draft_order": {
"id": 994118539,
"note": "rush order",
"email": "bob.norman@hostmail.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T21:07:03-05:00",
"tax_exempt": false,
"completed_at": "2021-02-05T21:07:03-05:00",
"name": "#D2",
"status": "completed",
"line_items": [
{
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 1,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"
}
],
"shipping_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "555-625-1199",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://apple.myshopify.com/690933842/invoices/ba8dcf6c022ccad3d47e3909e378e33f",
"applied_discount": {
"description": "$5promo",
"value": "5.0",
"title": null,
"amount": "5.00",
"value_type": "fixed_amount"
},
"order_id": 1073459975,
"shipping_line": {
"title": "UPS Ground",
"custom": false,
"handle": "ups-3-12.25",
"price": "12.25"
},
"tax_lines": [],
"tags": "Wholesale",
"note_attributes": [],
"total_price": "206.25",
"subtotal_price": "194.00",
"total_tax": "0.00",
"presentment_currency": "USD",
"total_line_items_price_set": {
"shop_money": {
"amount": "826.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "826.00",
"currency_code": "USD"
}
},
"total_price_set": {
"shop_money": {
"amount": "206.25",
"currency_code": "USD"
},
"presentment_money": {
"amount": "206.25",
"currency_code": "USD"
}
},
"subtotal_price_set": {
"shop_money": {
"amount": "194.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "194.00",
"currency_code": "USD"
}
},
"total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_discounts_set": {
"shop_money": {
"amount": "5.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "5.00",
"currency_code": "USD"
}
},
"total_shipping_price_set": {
"shop_money": {
"amount": "12.25",
"currency_code": "USD"
},
"presentment_money": {
"amount": "12.25",
"currency_code": "USD"
}
},
"admin_graphql_api_id": "gid://shopify/DraftOrder/994118539",
"customer": {
"id": 207119551,
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"created_at": "2021-02-05T20:59:20-05:00",
"updated_at": "2021-02-05T20:59:20-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+16136120707",
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": false
}
}
}
}
Complete a draft order, marking it as pending
PUT /admin/api/2019-10/draft_orders/99411