AUTOMATE NOW

Shopify API 2026 – How to create a draft order using postman

Table of Contents

This article will discuss how to create a draft order using Postman in Shopify API.

The draft order is a draft version of an order that the owner can create when the customer wants to buy some products, but they don’t pay yet. It is an order you create for your customer instead of by themselves. 

The draft order is converted to an order when the owner accepts payment. The draft order is created in the cases below. 

 

Note: After you mark a draft order as paid, pending, or paid using a customer’s billing information, you can’t change it.

Now, let’s dive into the article to learn how to create a draft order using Postman in Shopify API.

With Shopify API, you can create a draft order with only a product variant ID, a discount, a discounted line item, percent discount on a line item. But in this article, Beehexa will show how to create a draft order with only a product variant ID. 

Step 1: Generate API credentials from the Shopify admin

If this is the first time you make a call in the Postman, you must generate API credentials from the Shopify admin. Follow the process of How to build a custom app for Shopify in 2022? To know how to access Shopify API. 

 

After generating API credentials from the Shopify admin. Let’s go to the draft order. In the Admin dashboard, choose orders, and click draft orders. 

drafts

As you can see, there is no draft order created today.

Step 2: Create a draft order using Postman with only a product variant ID

Before creating a draft order, you need to determine the product variant ID that you want to create a draft order. 

Example: In this article, Beehexa will get a product variant ID from 2 product variants of the Beehexa T-Shirt 2021 New Version 01 product. 

 

In this case, product variant ID = 39593985409087

After that, we will create a draft order with only a product variant ID. 

 

https://{API_key}:{admin_API_access_token}@{shop}.myshopify.com/admin/api/{api-version}/{resource}.json

Or you can copy this example in the Shopify Admin, remember to change {resource} to {draft_orders}:

https://{api_key}:{admin_api_access_token}@{shop}.myshopify.com/admin/api/2021-10/draft_orders.json

 

create a draft order

In the body section, click raw → Choose JSON, then enter the code

{
    "draft_order": {
        "line_items": [{
            "variant_id": 39593985409087,
            "quantity": 1
        }]
    }
}

body

Then click Send

Response:

The API will return the data like this

{
    "draft_order": {
        "id": 878336999487,
        "note": null,
        "email": null,
        "taxes_included": false,
        "currency": "AUD",
        "invoice_sent_at": null,
        "created_at": "2022-02-28T13:14:48+09:00",
        "updated_at": "2022-02-28T13:14:48+09:00",
        "tax_exempt": false,
        "completed_at": null,
        "name": "#D68",
        "status": "open",
        "line_items": [
            {
                "id": 57264082845759,
                "variant_id": 39593985409087,
                "product_id": 4916307230783,
                "title": "Beehexa T-Shirt 2021 New Version 01",
                "variant_title": "Yellow",
                "sku": "",
                "vendor": "hexasync",
                "quantity": 1,
                "requires_shipping": true,
                "taxable": true,
                "gift_card": false,
                "fulfillment_service": "manual",
                "grams": 0,
                "tax_lines": [],
                "applied_discount": null,
                "name": "Beehexa T-Shirt 2021 New Version 01 - Yellow",
                "properties": [],
                "custom": false,
                "price": "1.00",
                "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/57264082845759"
            }
        ],
        "shipping_address": null,
        "billing_address": null,
        "invoice_url": "https://hexasync.myshopify.com/25322618943/invoices/41bbf11edd5d004800023891e48ae843",
        "applied_discount": null,
        "order_id": null,
        "shipping_line": null,
        "tax_lines": [],
        "tags": "",
        "note_attributes": [],
        "total_price": "1.00",
        "subtotal_price": "1.00",
        "total_tax": "0.00",
        "payment_terms": null,
        "admin_graphql_api_id": "gid://shopify/DraftOrder/878336999487",
        "customer": null
    }
}

response_draft order

Step 3: Verify the result

In the admin dashboard, go to the orders.

Click on draft orders.

after creating a draft order

As you can see, the draft order has been created successfully. 

Above are all steps to create a draft order using Postman with Shopify API. If you have any questions, please comment below or refer to our blog: What is an API?. Besides, you can see more Shopify API documentation in the developer docs.

If you still do not understand the tutorial’s content, you can watch the video below for a more overview.

Hopefully, you can do it!

Last updated: