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.

Lifecycle of a draft order

When a draft order is created it is set to open status. At this point an invoice can be sent to the customer for payment, and status changes to invoice_sent. Otherwise, the draft order can be paid, set to pending, or paid by credit card; in each case, the draft order is set to completed and an order is created.

Note

Once a draft order is set to status completed the only further draft order modifications that can be made are adding tags or metafields.

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:

DraftOrder properties

id
"id": 450789469

The unique numeric identifier for the draft order.

order_id
"id": 456789101

The unique numeric identifier for the order associated to the draft order, once created.

name
"name": "#1001"

Name of the draft order.

customer
"id": 207119551

Customer associated with the draft order. Used to load/remove the associated customer with customer id. When a customer is loaded, the customer’s email address is also assocaited. Set use_customer_default_address to true as part of a draft order object in the body of a POST request, to additionally load the associated shipping information. When a customer is removed, the shipping, billing, and email addresses are also removed. The recommended way to remove a customer from a draft order is to make a POST request with customer object set to null, without specifying an email, shipping address, or billing address. If this is not possible, a customer may also be removed by setting all of customer, email, shipping_address, and billing_address to null.

shipping_address
"shipping_address": [
  {
    "address1": "123 Amoebobacterieae St",
    "address2": "",
    "city": "Ottawa",
    "company": null,
    "country": "Canada",
    "first_name": "Bob",
    "last_name": "Bobsen",
    "latitude": "45.41634",
    "longitude": "-75.6868",
    "phone": "555-625-1199",
    "province": "Ontario",
    "zip": "K2P0V6",
    "name": "Bob Bobsen",
    "country_code": "CA",
    "province_code": "ON"
  }
]

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 one. It has the following properties:

  • address1: The street address of the shipping address.
  • address2: An optional additional field for the street address of the shipping address.
  • city: The city of the shipping address.
  • company: The company of the person associated with the shipping address.
  • country: The name of the country of the shipping address.
  • country_code: The two-letter code for the country of the shipping address.
  • first_name: The first name of the person associated with the payment method.
  • last_name: The last name of the person associated with the payment method.
  • latitude: The latitude of the shipping address.
  • longitude: The longitude of the shipping address.
  • name: The full name of the person associated with the payment method.
  • phone: The phone number at the shipping address.
  • province: The name of the state or province of the shipping address.
  • province_code: The two-letter abbreviation of the state or province of the shipping address.
  • zip: The zip or postal code of the shipping address.

billing_address
"billing_address": [
  {
    "address1": "123 Amoebobacterieae St",
    "address2": "",
    "city": "Ottawa",
    "company": null,
    "country": "US",
    "first_name": null,
    "id": 207119551,
    "last_name": null,
    "phone": "(555)555-5555",
    "province": "KY",
    "zip": "40202",
    "name": null,
    "province_code": null,
    "country_code": null,
    "default": true
  }
]

The mailing address associated with the payment method. This address is an optional field that will not be available on orders that do not require one. It has the following properties:

  • address1: The street address of the billing address.
  • address2: An optional additional field for the street address of the billing address.
  • city: The city of the billing address.
  • company: The company of the person associated with the billing address.
  • country: The name of the country of the billing address.
  • country_code: The two-letter code (ISO 3166-1 alpha-2 two-letter country code) for the country of the billing address.
  • first_name: The first name of the person associated with the payment method.
  • last_name: The last name of the person associated with the payment method.
  • latitude: The latitude of the billing address.
  • longitude: The longitude of the billing address.
  • name: The full name of the person associated with the payment method.
  • phone: The phone number at the billing address.
  • province: The name of the state or province of the billing address.
  • province_code: The two-letter abbreviation of the state or province of the billing address.
  • zip: The zip or postal code of the billing address.

note
"note": null

The text of an optional note that a shop owner can attach to the draft order.

note_attributes
"note_attributes": [
  {
    "name": "custom name",
    "value": "custom value"
  }
]

Extra information that is added to the order. Each array entry must contain a hash with "name" and "value" keys.

email
"email": "bob.norman@example.com"

The customer's email address.

currency
"currency": "USD"

The three letter code (ISO 4217) for the currency used for the payment.

invoice_sent_at
"invoice_sent_at": "2008-01-10T11:00:00-05:00"

This auto-generated property is the date and time when the invoice was emailed to the customer, in ISO 8601 format.

invoice_url
"invoice_url": "https://www.example.com/14376108/checkouts/91a9b3f92d7d42e57268eff5ebd570df"

The URL for the invoice.

line_items
"line_items": [
  {
    "custom": false,
    "fulfillable_quantity": 1,
    "fulfillment_service": "amazon",
    "grams": 500,
    "id": 669751112,
    "price": "199.99",
    "product_id": 7513594,
    "quantity": 1,
    "requires_shipping": true,
    "sku": "IPOD-342-N",
    "title": "IPod Nano",
    "variant_id": 4264112,
    "variant_title": "Pink",
    "vendor": "Apple",
    "name": "IPod Nano - Pink",
    "gift_card": false,
    "properties": [
      {
        "name": "custom engraving",
"value": "Happy Birthday Mom!"
      }
    ],
    "taxable": true,
    "tax_lines": [
      {
        "title": "title of tax line",
"rate": "10",
"price": "18"
      }
    ],
    "applied_discount": [
      {
        "title": "title of the discount",
"description": "Description of discount!",
"value": "10",
"value_type": "percentage",
"amount": "19.99"
      }
    ]
  }
]

Product variant line item or custom line item associated to the draft order. Each draft order must include at least one line_item. Each line_item object has the following properties:

  • custom: Indicates if this is a product variant line item, or a custom line item. If set to true indicates a custom line item. If set to false indicates a product variant line item. Read only field
  • id: The id of the line item.
  • variant_id: The id of the product variant corresponding to the line item. Null if custom line item. Required if product variant line item.
  • product_id: The id of the product corresponding to the line item’s product variant.
  • name: The name of the product.
  • variant_title: The title of the product variant. Defaults to "Custom" for custom line items created via the API.
  • vendor: Vendor.
  • quantity: The number of products that were purchased.
  • gift_card: Indicates if the product is a gift card. Valid values are true or false.
  • fulfillment_service: Service provider responsible for fulfillment. Valid values are either manual or the name of the provider. eg amazon, shipwire, etc. Defaults to manual for custom line items.
  • properties: An array of custom information for an item that has been added to the draft order, often used to provide product customization options. Copied to created order when draft order is completed.
  • applied_discount: Discount which will be applied to the line item or the overall order. Applied discount documentation
  • tax_line: Specifies rate and amount of tax to be charged. Tax lines documentation
  • title: The title of the product or variant. Can only be specified if this is a custom line item, in which case it is mandatory.
  • price: The price of the item before discounts have been applied. Can only be specified if this is a custom line item, in which case it is mandatory.
  • grams: Weight in grams. Can only be specified if this is a custom line item. If not specified, defaults to 0.
  • requires_shipping: States whether or not the fulfillment requires shipping. Can only be specified if this is a custom line item. Valid values are true or false.
  • sku: A unique identifier of the item in the fulfillment. Can only be specified if this is a custom line item.
  • taxable: States whether or not the product is taxable. Can only be specified if this is a custom line item.

shipping_line
"shipping_line": [
  {
    "handle": "shopify-Standard%20Shipping-8.00",
    "price": 0.0,
    "title": "Free Shipping"
  }
]

A shipping_line object, which details the shipping method used. A shipping_line object has the following properties:

  • custom: Indicates if this is a regular shipping line or custom shipping line.
  • handle: The handle of the shipping rate which was selected and applied. Required for regular shipping lines.
  • title: The title of the shipping method. Required for custom shipping lines.
  • price: The price of the shipping method. Required for custom shipping lines.

tags
"tags": "tagsational"

Tags are additional short descriptors, commonly used for filtering and searching, formatted as a string of comma-separated values. For example, if an order has three tags: tag1, tag2, tag3. Each individual tag is limited to 40 characters in length.

taxes_exempt
"taxes_included": false

Sets whether or not taxes are exempt for this draft order. If this value is false, Shopify will honor the taxable setting for each line_item. However, if a customer is applied to the draft order using customer object id, the customer's tax_exempt settings take precedence. Further, when a customer's tax_exempt field is set to true it is not possible to set draft order tax_exempt to false.

tax_lines
"tax_lines": [
  {
    "price": 11.94,
    "rate": 0.06,
    "title": "State Tax"
  }
]

An array of tax_line objects, each of which details the total taxes applicable to the order. Each tax_line has the following properties:

  • price: The amount of tax to be charged.
  • rate: The rate of tax to be applied.
  • title: The name of the tax.
When creating an order through the API, tax lines may be specified on the order or the line items but not both. Tax lines specified on the order are split on the taxable line items in the created order.

applied_discount
"applied_discount": [
  {
    "title": "Title of the discount",
    "description": "Description",
    "value": "10",
    "value_type": "fixed_amount",
    "amount": "10"
  }
]

Discount which will be applied to the line item or the overall order. A draft order line_item can have one discount. A draft order can have one order-level discount. It has the following properties:

  • title: Title of the discount.
  • description: Reason for the discount.
  • value: The value of the discount. If the type of the discount is fixed_amount, then this is a fixed dollar amount. If the type is percentage, then this is the percentage.
  • value_type: The type of discount. Valid values: percentage, fixed_amount.
  • amount: The applied amount of the discount, based on the setting of value_type.

    When value_type is set to fixed_amount discount amount = quantity * value

    When value_type is set to percentage discount amount = floor(price * quantity * value) / 100

    where floor() is the usual round down function.

taxes_included
"taxes_included": false

States whether or not taxes are included in the order subtotal. Valid values are true or false.

total_tax
"total_tax": "11.94"

The sum of all the taxes applied to the order (must be positive).

subtotal_price
"subtotal_price": 398.0

Price of the order before shipping and taxes

total_price
"total_price": "409.94"

The sum of all the prices of all the items in the order, taxes and discounts included (must be positive).

completed_at
"completed_at": "2012-08-24T14:02:15-04:00"

Date at which order is created and the draft order changes to completed status. The API returns this value in ISO 8601 format.

created_at
"created_at": "2008-01-10T11:00:00-05:00"

This auto-generated property is the date and time when the order was created in Shopify, in ISO 8601 format.

updated_at
"updated_at": "2012-08-24T14:02:15-04:00"

The date and time when the order was last modified. The API returns this value in ISO 8601 format.

status
"status": "authorized"

Once a draft order is set to status completed the only further draft order modifications that can be made are adding tags or metafields. No other draft order actions are permitted.

  • open: Draft order is open.
  • invoice_sent: Invoice has been sent for the draft order.
  • completed: Draft order has been set to completed status.

Endpoints

POST /admin/draft_orders.json
Create a new draft order.
Using the Draft Orders API you can create orders in draft state using product variant line items, or your own custom line items. This enables you to create one-off products that exist outside of your regular inventory management system. To create a product variant draft order, simply specify a variant_id, quantity and discount (if applicable). Create a custom line item by supplying title, price, taxable and quantity.

About Custom Shipping Lines

The Draft Orders API provides you with the flexibility of sending orders to your customers using custom shipping lines. A custom shipping line includes a title and price with handle set to Nil. A shipping line with a carrier provided shipping rate (currently only set via the admin) includes the shipping rate handle.

Applying Discounts

Using the Draft Orders API you can apply discounts to entire draft orders or specific line items. Both draft orders and line items can only have one discount object each. Using the value_type field of applied_discount you can specify either a fixed_amount discount or a percentage discount.


About Fixed Amount and Percentage Discounts:

Calculations for discounts are based on the setting of the value_type field, which can be one of either fixed_amount or percentage. The value field represents either the fixed dollar amount for fixed_amount discounts, or the percentage for percentage discounts. For line item discounts, this value is applied per individual unit of the item. The final total value of the calculated discount is represented by the amount field, taking into account quantity for line item discounts.


Calculating 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.


Note that for non-fractional currencies, this formula needs to use round() instead of floor():


amount = round(price * quantity * value / 100)


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 }


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 }

use_customer_default_address

Optional boolean that you can send as part of a draft order object to load customer shipping information. Valid values: true or false.

Create a simple draft order with only a product variant id.

POST /admin/draft_orders.json
{
  "draft_order": {
    "line_items": [
      {
        "variant_id": 447654529,
        "quantity": 1
      }
    ]
  }
}
View Response
HTTP/1.1 201 Created
{
  "draft_order": {
    "id": 1069920477,
    "note": null,
    "email": null,
    "taxes_included": false,
    "currency": "USD",
    "subtotal_price": "199.00",
    "total_tax": "0.00",
    "total_price": "199.00",
    "invoice_sent_at": null,
    "created_at": "2017-09-05T15:47:35-04:00",
    "updated_at": "2017-09-05T15:47:35-04: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",
        "price": "199.00",
        "grams": 567,
        "quantity": 1,
        "requires_shipping": true,
        "taxable": true,
        "gift_card": false,
        "fulfillment_service": "manual",
        "tax_lines": [
        ],
        "applied_discount": null,
        "name": "IPod Touch 8GB - Black",
        "properties": [
        ],
        "custom": false
      }
    ],
    "shipping_address": null,
    "billing_address": null,
    "invoice_url": "https:\/\/checkout.local\/690933842\/invoices\/5426c2742572bd291772497eb7e361bc",
    "applied_discount": null,
    "order_id": null,
    "shipping_line": null,
    "tax_lines": [
    ],
    "tags": "",
    "note_attributes": [
    ],
    "customer": null
  }
}

Create custom draft order

POST /admin/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": 1069920478,
    "note": null,
    "email": "bob.norman@hostmail.com",
    "taxes_included": false,
    "currency": "USD",
    "subtotal_price": "40.00",
    "total_tax": "0.00",
    "total_price": "40.00",
    "invoice_sent_at": null,
    "created_at": "2017-09-05T15:47:37-04:00",
    "updated_at": "2017-09-05T15:47:37-04: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,
        "price": "20.00",
        "grams": 0,
        "quantity": 2,
        "requires_shipping": false,
        "taxable": true,
        "gift_card": false,
        "fulfillment_service": "manual",
        "tax_lines": [
        ],
        "applied_discount": null,
        "name": "Custom Tee",
        "properties": [
        ],
        "custom": true
      }
    ],
    "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:\/\/checkout.local\/690933842\/invoices\/78e60b8a526537e2d5037e49f6e82fdc",
    "applied_discount": null,
    "order_id": null,
    "shipping_line": null,
    "tax_lines": [
    ],
    "tags": "",
    "note_attributes": [
    ],
    "customer": {
      "id": 207119551,
      "email": "bob.norman@hostmail.com",
      "accepts_marketing": false,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:16-04:00",
      "first_name": "Bob",
      "last_name": "Norman",
      "orders_count": 1,
      "state": "disabled",
      "total_spent": "41.94",
      "last_order_id": 450789469,
      "note": null,
      "verified_email": true,
      "multipass_identifier": null,
      "tax_exempt": false,
      "phone": null,
      "tags": "",
      "last_order_name": "#1001",
      "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
      }
    }
  }
}
PUT /admin/draft_orders/994118539.json
Change a draft order’s attributes

Add Note to draft order

PUT /admin/draft_orders/#{id}.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",
    "subtotal_price": "194.00",
    "total_tax": "0.00",
    "total_price": "206.25",
    "invoice_sent_at": null,
    "created_at": "2017-09-05T15:47:16-04:00",
    "updated_at": "2017-09-05T15:47:36-04: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,
        "price": "199.00",
        "grams": 567,
        "quantity": 1,
        "requires_shipping": false,
        "taxable": true,
        "gift_card": false,
        "fulfillment_service": "manual",
        "tax_lines": [
        ],
        "applied_discount": null,
        "name": "IPod Nano - 8gb - green",
        "properties": [
        ],
        "custom": false
      }
    ],
    "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:\/\/checkout.local\/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",
      "price": "12.25",
      "custom": false,
      "handle": "ups-3-12.25"
    },
    "tax_lines": [
    ],
    "tags": "Wholesale",
    "note_attributes": [
    ],
    "customer": {
      "id": 207119551,
      "email": "bob.norman@hostmail.com",
      "accepts_marketing": false,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:16-04:00",
      "first_name": "Bob",
      "last_name": "Norman",
      "orders_count": 1,
      "state": "disabled",
      "total_spent": "41.94",
      "last_order_id": 450789469,
      "note": null,
      "verified_email": true,
      "multipass_identifier": null,
      "tax_exempt": false,
      "phone": null,
      "tags": "",
      "last_order_name": "#1001",
      "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/draft_orders/#{id}.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",
    "subtotal_price": "179.10",
    "total_tax": "0.00",
    "total_price": "191.35",
    "invoice_sent_at": null,
    "created_at": "2017-09-05T15:47:16-04:00",
    "updated_at": "2017-09-05T15:47:41-04: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,
        "price": "199.00",
        "grams": 567,
        "quantity": 1,
        "requires_shipping": false,
        "taxable": true,
        "gift_card": false,
        "fulfillment_service": "manual",
        "tax_lines": [
        ],
        "applied_discount": null,
        "name": "IPod Nano - 8gb - green",
        "properties": [
        ],
        "custom": false
      }
    ],
    "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:\/\/checkout.local\/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",
      "price": "12.25",
      "custom": false,
      "handle": "ups-3-12.25"
    },
    "tax_lines": [
    ],
    "tags": "Wholesale",
    "note_attributes": [
    ],
    "customer": {
      "id": 207119551,
      "email": "bob.norman@hostmail.com",
      "accepts_marketing": false,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:16-04:00",
      "first_name": "Bob",
      "last_name": "Norman",
      "orders_count": 1,
      "state": "disabled",
      "total_spent": "41.94",
      "last_order_id": 450789469,
      "note": null,
      "verified_email": true,
      "multipass_identifier": null,
      "tax_exempt": false,
      "phone": null,
      "tags": "",
      "last_order_name": "#1001",
      "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
      }
    }
  }
}
GET /admin/draft_orders.json
Retrieve a list of draft orders
fields

A comma-separated list of fields to include in the response

limit

Amount of results

(default: 50) (maximum: 250)
page

Page to show

(default: 1)
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
  • open - All open orders (default)
  • invoice_sent - Show only closed orders
  • completed - Show only cancelled orders
fields

comma-separated list of fields to include in the response

List all draft orders

GET /admin/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",
      "subtotal_price": "398.00",
      "total_tax": "11.94",
      "total_price": "409.94",
      "invoice_sent_at": null,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:16-04: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,
          "price": "199.00",
          "grams": 567,
          "quantity": 2,
          "requires_shipping": true,
          "taxable": true,
          "gift_card": false,
          "fulfillment_service": "manual",
          "tax_lines": [
          ],
          "applied_discount": null,
          "name": "IPod Nano - 8gb - green",
          "properties": [
          ],
          "custom": false
        }
      ],
      "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:\/\/checkout.local\/690933842\/invoices\/f945c7e2b158dbb69fa642cb8d79171f",
      "applied_discount": null,
      "order_id": 450789469,
      "shipping_line": null,
      "tax_lines": [
      ],
      "tags": "",
      "note_attributes": [
      ],
      "customer": {
        "id": 207119551,
        "email": "bob.norman@hostmail.com",
        "accepts_marketing": false,
        "created_at": "2017-09-05T15:47:16-04:00",
        "updated_at": "2017-09-05T15:47:16-04:00",
        "first_name": "Bob",
        "last_name": "Norman",
        "orders_count": 1,
        "state": "disabled",
        "total_spent": "41.94",
        "last_order_id": 450789469,
        "note": null,
        "verified_email": true,
        "multipass_identifier": null,
        "tax_exempt": false,
        "phone": null,
        "tags": "",
        "last_order_name": "#1001",
        "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",
      "subtotal_price": "826.00",
      "total_tax": "0.00",
      "total_price": "836.00",
      "invoice_sent_at": null,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:16-04: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,
          "price": "199.00",
          "grams": 567,
          "quantity": 1,
          "requires_shipping": true,
          "taxable": true,
          "gift_card": false,
          "fulfillment_service": "manual",
          "tax_lines": [
          ],
          "applied_discount": null,
          "name": "IPod Nano - 8gb - green",
          "properties": [
          ],
          "custom": false
        },
        {
          "variant_id": null,
          "product_id": null,
          "title": "IPod Nano Engraving",
          "variant_title": null,
          "sku": "IPODENGRAVING",
          "vendor": null,
          "price": "30.00",
          "grams": 0,
          "quantity": 1,
          "requires_shipping": false,
          "taxable": true,
          "gift_card": false,
          "fulfillment_service": "manual",
          "tax_lines": [
          ],
          "applied_discount": null,
          "name": "IPod Nano Engraving",
          "properties": [
          ],
          "custom": true
        },
        {
          "variant_id": 457924702,
          "product_id": 632910392,
          "title": "IPod Nano - 8gb",
          "variant_title": "black",
          "sku": "IPOD2008BLACK",
          "vendor": null,
          "price": "199.00",
          "grams": 567,
          "quantity": 3,
          "requires_shipping": true,
          "taxable": true,
          "gift_card": false,
          "fulfillment_service": "manual",
          "tax_lines": [
          ],
          "applied_discount": null,
          "name": "IPod Nano - 8gb - black",
          "properties": [
          ],
          "custom": false
        }
      ],
      "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:\/\/checkout.local\/690933842\/invoices\/f1df1a91d10a6d7704cf2f0315461api",
      "applied_discount": null,
      "order_id": null,
      "shipping_line": {
        "title": "custom shipping",
        "price": "10.00",
        "custom": true,
        "handle": null
      },
      "tax_lines": [
      ],
      "tags": "",
      "note_attributes": [
      ],
      "customer": {
        "id": 207119551,
        "email": "bob.norman@hostmail.com",
        "accepts_marketing": false,
        "created_at": "2017-09-05T15:47:16-04:00",
        "updated_at": "2017-09-05T15:47:16-04:00",
        "first_name": "Bob",
        "last_name": "Norman",
        "orders_count": 1,
        "state": "disabled",
        "total_spent": "41.94",
        "last_order_id": 450789469,
        "note": null,
        "verified_email": true,
        "multipass_identifier": null,
        "tax_exempt": false,
        "phone": null,
        "tags": "",
        "last_order_name": "#1001",
        "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",
      "subtotal_price": "398.00",
      "total_tax": "11.94",
      "total_price": "409.94",
      "invoice_sent_at": "2016-12-31T19:00:00-05:00",
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:16-04: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,
          "price": "199.00",
          "grams": 567,
          "quantity": 1,
          "requires_shipping": true,
          "taxable": true,
          "gift_card": false,
          "fulfillment_service": "manual",
          "tax_lines": [
          ],
          "applied_discount": null,
          "name": "IPod Nano - 8gb - green",
          "properties": [
          ],
          "custom": false
        }
      ],
      "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:\/\/checkout.local\/690933842\/invoices\/56dd92fb7adc1a2c38402b1aab15b2f4",
      "applied_discount": null,
      "order_id": 450789469,
      "shipping_line": {
        "title": "UPS Ground",
        "price": "12.25",
        "custom": false,
        "handle": "ups-3-12.25"
      },
      "tax_lines": [
      ],
      "tags": "",
      "note_attributes": [
      ],
      "customer": {
        "id": 207119551,
        "email": "bob.norman@hostmail.com",
        "accepts_marketing": false,
        "created_at": "2017-09-05T15:47:16-04:00",
        "updated_at": "2017-09-05T15:47:16-04:00",
        "first_name": "Bob",
        "last_name": "Norman",
        "orders_count": 1,
        "state": "disabled",
        "total_spent": "41.94",
        "last_order_id": 450789469,
        "note": null,
        "verified_email": true,
        "multipass_identifier": null,
        "tax_exempt": false,
        "phone": null,
        "tags": "",
        "last_order_name": "#1001",
        "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",
      "subtotal_price": "194.00",
      "total_tax": "0.00",
      "total_price": "206.25",
      "invoice_sent_at": null,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:16-04: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,
          "price": "199.00",
          "grams": 567,
          "quantity": 1,
          "requires_shipping": false,
          "taxable": true,
          "gift_card": false,
          "fulfillment_service": "manual",
          "tax_lines": [
          ],
          "applied_discount": null,
          "name": "IPod Nano - 8gb - green",
          "properties": [
          ],
          "custom": false
        }
      ],
      "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:\/\/checkout.local\/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",
        "price": "12.25",
        "custom": false,
        "handle": "ups-3-12.25"
      },
      "tax_lines": [
      ],
      "tags": "Wholesale",
      "note_attributes": [
      ],
      "customer": {
        "id": 207119551,
        "email": "bob.norman@hostmail.com",
        "accepts_marketing": false,
        "created_at": "2017-09-05T15:47:16-04:00",
        "updated_at": "2017-09-05T15:47:16-04:00",
        "first_name": "Bob",
        "last_name": "Norman",
        "orders_count": 1,
        "state": "disabled",
        "total_spent": "41.94",
        "last_order_id": 450789469,
        "note": null,
        "verified_email": true,
        "multipass_identifier": null,
        "tax_exempt": false,
        "phone": null,
        "tags": "",
        "last_order_name": "#1001",
        "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",
      "subtotal_price": "826.00",
      "total_tax": "0.00",
      "total_price": "836.00",
      "invoice_sent_at": null,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:16-04: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,
          "price": "199.00",
          "grams": 567,
          "quantity": 1,
          "requires_shipping": true,
          "taxable": true,
          "gift_card": false,
          "fulfillment_service": "manual",
          "tax_lines": [
          ],
          "applied_discount": null,
          "name": "IPod Nano - 8gb - green",
          "properties": [
          ],
          "custom": false
        }
      ],
      "shipping_address": null,
      "billing_address": null,
      "invoice_url": "https:\/\/checkout.local\/690933842\/invoices\/f1df1a91d10a6d7704cf2f0315461noaddressapi",
      "applied_discount": null,
      "order_id": null,
      "shipping_line": null,
      "tax_lines": [
      ],
      "tags": "",
      "note_attributes": [
      ],
      "customer": null
    }
  ]
}
GET /admin/draft_orders/994118539.json
Retrieve a specific draft order
fields

A comma-separated list of fields to include in the response

Get a representation of a single draft order

GET /admin/draft_orders/#{id}.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",
    "subtotal_price": "194.00",
    "total_tax": "0.00",
    "total_price": "206.25",
    "invoice_sent_at": null,
    "created_at": "2017-09-05T15:47:16-04:00",
    "updated_at": "2017-09-05T15:47:16-04: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,
        "price": "199.00",
        "grams": 567,
        "quantity": 1,
        "requires_shipping": false,
        "taxable": true,
        "gift_card": false,
        "fulfillment_service": "manual",
        "tax_lines": [
        ],
        "applied_discount": null,
        "name": "IPod Nano - 8gb - green",
        "properties": [
        ],
        "custom": false
      }
    ],
    "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:\/\/checkout.local\/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",
      "price": "12.25",
      "custom": false,
      "handle": "ups-3-12.25"
    },
    "tax_lines": [
    ],
    "tags": "Wholesale",
    "note_attributes": [
    ],
    "customer": {
      "id": 207119551,
      "email": "bob.norman@hostmail.com",
      "accepts_marketing": false,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:16-04:00",
      "first_name": "Bob",
      "last_name": "Norman",
      "orders_count": 1,
      "state": "disabled",
      "total_spent": "41.94",
      "last_order_id": 450789469,
      "note": null,
      "verified_email": true,
      "multipass_identifier": null,
      "tax_exempt": false,
      "phone": null,
      "tags": "",
      "last_order_name": "#1001",
      "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
      }
    }
  }
}
GET /admin/draft_orders/count.json
Retrieve a count of all the draft orders
fields

A comma-separated list of fields to include in the response

limit

Amount of results

(default: 50) (maximum: 250)
page

Page to show

(default: 1)
since_id

Restrict results to after the specified ID

ids

Filter by list of ids

status
  • open - All open orders (default)
  • invoice_sent - Show only closed orders
  • completed - Show only cancelled orders

Count all draft orders

GET /admin/draft_orders/count.json
View Response
HTTP/1.1 200 OK
{
  "count": 5
}
POST /admin/draft_orders/994118539/send_invoice.json
Send an invoice for the draft order

Send the default invoice

POST /admin/draft_orders/#{id}/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": [
    ]
  }
}

Send a customized invoice

POST /admin/draft_orders/#{id}/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"
    ]
  }
}
DELETE /admin/draft_orders/994118539.json
Delete a draft order

Permanently delete a draft order

DELETE /admin/draft_orders/#{id}.json
View Response
HTTP/1.1 200 OK
{}
PUT /admin/draft_orders/994118539/complete.json
Complete a draft order

Using the Draft Orders API 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 (with taxes and totals) and send an invoice to the customer.
  • Use Draft Orders API in conjunction with the Checkouts API by creating a Checkout object based on a draft order (Sales Channel SDK only). This enables a highly customizable experience for channels.
payment_pending
  • true - Sets payment pending to true.
  • false - Sets payment pending to false. default value.

Complete a draft order, marking it as paid

PUT /admin/draft_orders/#{id}/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",
    "subtotal_price": "194.00",
    "total_tax": "0.00",
    "total_price": "206.25",
    "invoice_sent_at": null,
    "created_at": "2017-09-05T15:47:16-04:00",
    "updated_at": "2017-09-05T15:47:32-04:00",
    "tax_exempt": false,
    "completed_at": "2017-09-05T15:47:32-04:00",
    "name": "#D2",
    "status": "completed",
    "line_items": [
      {
        "variant_id": 39072856,
        "product_id": 632910392,
        "title": "IPod Nano - 8gb",
        "variant_title": "green",
        "sku": "IPOD2008GREEN",
        "vendor": null,
        "price": "199.00",
        "grams": 567,
        "quantity": 1,
        "requires_shipping": false,
        "taxable": true,
        "gift_card": false,
        "fulfillment_service": "manual",
        "tax_lines": [
        ],
        "applied_discount": null,
        "name": "IPod Nano - 8gb - green",
        "properties": [
        ],
        "custom": false
      }
    ],
    "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:\/\/checkout.local\/690933842\/invoices\/ba8dcf6c022ccad3d47e3909e378e33f",
    "applied_discount": {
      "description": "$5promo",
      "value": "5.0",
      "title": null,
      "amount": "5.00",
      "value_type": "fixed_amount"
    },
    "order_id": 1073459964,
    "shipping_line": {
      "title": "UPS Ground",
      "price": "12.25",
      "custom": false,
      "handle": "ups-3-12.25"
    },
    "tax_lines": [
    ],
    "tags": "Wholesale",
    "note_attributes": [
    ],
    "customer": {
      "id": 207119551,
      "email": "bob.norman@hostmail.com",
      "accepts_marketing": false,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:33-04:00",
      "first_name": "Bob",
      "last_name": "Norman",
      "orders_count": 1,
      "state": "disabled",
      "total_spent": "41.94",
      "last_order_id": 450789469,
      "note": null,
      "verified_email": true,
      "multipass_identifier": null,
      "tax_exempt": false,
      "phone": null,
      "tags": "",
      "last_order_name": "#1001",
      "default_address": {
        "id": 1053317288,
        "customer_id": 207119551,
        "first_name": "Bob",
        "last_name": "Norman",
        "company": null,
        "address1": "Chestnut Street 92",
        "address2": "",
        "city": "Louisville",
        "province": "Kentucky",
        "country": "United States",
        "zip": "40202",
        "phone": "555-625-1199",
        "name": "Bob Norman",
        "province_code": "KY",
        "country_code": "US",
        "country_name": "United States",
        "default": true
      }
    }
  }
}

Complete a draft order, marking it as pending

PUT /admin/draft_orders/#{id}/complete.json?payment_pending=true
View Response
HTTP/1.1 200 OK
{
  "draft_order": {
    "id": 994118539,
    "note": "rush order",
    "email": "bob.norman@hostmail.com",
    "taxes_included": false,
    "currency": "USD",
    "subtotal_price": "194.00",
    "total_tax": "0.00",
    "total_price": "206.25",
    "invoice_sent_at": null,
    "created_at": "2017-09-05T15:47:16-04:00",
    "updated_at": "2017-09-05T15:47:38-04:00",
    "tax_exempt": false,
    "completed_at": "2017-09-05T15:47:38-04:00",
    "name": "#D2",
    "status": "completed",
    "line_items": [
      {
        "variant_id": 39072856,
        "product_id": 632910392,
        "title": "IPod Nano - 8gb",
        "variant_title": "green",
        "sku": "IPOD2008GREEN",
        "vendor": null,
        "price": "199.00",
        "grams": 567,
        "quantity": 1,
        "requires_shipping": false,
        "taxable": true,
        "gift_card": false,
        "fulfillment_service": "manual",
        "tax_lines": [
        ],
        "applied_discount": null,
        "name": "IPod Nano - 8gb - green",
        "properties": [
        ],
        "custom": false
      }
    ],
    "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:\/\/checkout.local\/690933842\/invoices\/ba8dcf6c022ccad3d47e3909e378e33f",
    "applied_discount": {
      "description": "$5promo",
      "value": "5.0",
      "title": null,
      "amount": "5.00",
      "value_type": "fixed_amount"
    },
    "order_id": 1073459965,
    "shipping_line": {
      "title": "UPS Ground",
      "price": "12.25",
      "custom": false,
      "handle": "ups-3-12.25"
    },
    "tax_lines": [
    ],
    "tags": "Wholesale",
    "note_attributes": [
    ],
    "customer": {
      "id": 207119551,
      "email": "bob.norman@hostmail.com",
      "accepts_marketing": false,
      "created_at": "2017-09-05T15:47:16-04:00",
      "updated_at": "2017-09-05T15:47:38-04:00",
      "first_name": "Bob",
      "last_name": "Norman",
      "orders_count": 1,
      "state": "disabled",
      "total_spent": "41.94",
      "last_order_id": 450789469,
      "note": null,
      "verified_email": true,
      "multipass_identifier": null,
      "tax_exempt": false,
      "phone": null,
      "tags": "",
      "last_order_name": "#1001",
      "default_address": {
        "id": 1053317289,
        "customer_id": 207119551,
        "first_name": "Bob",
        "last_name": "Norman",
        "company": null,
        "address1": "Chestnut Street 92",
        "address2": "",
        "city": "Louisville",
        "province": "Kentucky",
        "country": "United States",
        "zip": "40202",
        "phone": "555-625-1199",
        "name": "Bob Norman",
        "province_code": "KY",
        "country_code": "US",
        "country_name": "United States",
        "default": true
      }
    }
  }
}