Create a order using existing products in my shopify with a api

Shopify Partner
11 0 2

Hi, i want to make a order using json api, but if i want to add products it auto makes a new product. So how do i still make a order using json api but with existing products in my shopify store so i dont have to mannually put all the information.

Replies 2 (2)

Shopify Staff
42 8 13

Hi @DionCosina 👋


Using Admin GraphQL API, we can use the `draftOrderCreate` mutation and pass `` as a input variable under line items to load the existing product into the order:

mutation draftOrderCreate($input: DraftOrderInput!) {
  draftOrderCreate(input: $input) {
    draftOrder {

{ // input variables
    "input": {
        "lineItems": [{
            "variantId": "gid://shopify/ProductVariant/12345",
            "quantity": 1

 Then the resulting `` can be used with the `draftOrderComplete` mutation to create the order: 

mutation {
  draftOrderComplete(id: "gid://shopify/DraftOrder/67890") {
    draftOrder {


Similarly in Admin REST API, we can create a new `DraftOrder` then complete the `DraftOrder` as well. 


Hope that helps!

Umiko | API Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog

2 0 0

Hi @Umiko,


thanks for your explanation. I'm still not absolutely sure how to handle this. I'm in the same position as @DionCosina right now. I'm looking for a way to create order through the Shopify API without creating new products.


Is there any way to do this using simple JSON requests?


Kind regards,