Create Shopify Order

Pankaj_Hungama
New Member
1 0 0

Hi everyone,

 

I am able to create an order but I am getting product id  null and product exist false. But that particular product exist in products section and even it's active product. please help me why I am not getting product id. 

 

 

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://hungama-digital-store.myshopify.com/admin/api/2021-04/orders.json',
  'headers': {
    'X-Shopify-Access-Token': 'b1a07e71f4a4aedee5410a3a49a3b3f9',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "order": {
      "line_items": [
        {
          "variant_id": 4258011971684,
          "quantity": 1,
          "price": 2400,
          "title": "Annabelle Comes Home - Hindi (2019)",
          "sku": 49327873
        }
      ],
      "email": "gaurav.kumar@hungama.com",
      "fulfillment_status": "fulfilled",
      "fulfillments": [
        {
          "location_id": 14871724132
        }
      ]
    }
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

 

 

And Response Is Here.

 

 

{
    "order": {
        "id": 4251294892225,
        "admin_graphql_api_id": "gid://shopify/Order/4251294892225",
        "app_id": 3047811,
        "browser_ip": null,
        "buyer_accepts_marketing": false,
        "cancel_reason": null,
        "cancelled_at": null,
        "cart_token": null,
        "checkout_id": null,
        "checkout_token": null,
        "closed_at": null,
        "confirmed": true,
        "contact_email": "gaurav.kumar@hungama.com",
        "created_at": "2022-01-18T14:55:20+05:30",
        "currency": "INR",
        "current_subtotal_price": "2400.00",
        "current_subtotal_price_set": {
            "shop_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            }
        },
        "current_total_discounts": "0.00",
        "current_total_discounts_set": {
            "shop_money": {
                "amount": "0.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "0.00",
                "currency_code": "INR"
            }
        },
        "current_total_duties_set": null,
        "current_total_price": "2400.00",
        "current_total_price_set": {
            "shop_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            }
        },
        "current_total_tax": "0.00",
        "current_total_tax_set": {
            "shop_money": {
                "amount": "0.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "0.00",
                "currency_code": "INR"
            }
        },
        "customer_locale": null,
        "device_id": null,
        "discount_codes": [],
        "email": "gaurav.kumar@hungama.com",
        "financial_status": "paid",
        "fulfillment_status": "fulfilled",
        "gateway": "",
        "landing_site": null,
        "landing_site_ref": null,
        "location_id": null,
        "name": "#74229",
        "note": null,
        "note_attributes": [],
        "number": 73229,
        "order_number": 74229,
        "order_status_url": "https://rewards.hungama.com/10472357988/orders/ec2d5fe62258644e52fedf73e9d1618a/authenticate?key=93f14e69ae990c402c86f8ad4288b7dd",
        "original_total_duties_set": null,
        "payment_gateway_names": [],
        "phone": null,
        "presentment_currency": "INR",
        "processed_at": "2022-01-18T14:55:20+05:30",
        "processing_method": "",
        "reference": null,
        "referring_site": null,
        "source_identifier": null,
        "source_name": "3047811",
        "source_url": null,
        "subtotal_price": "2400.00",
        "subtotal_price_set": {
            "shop_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            }
        },
        "tags": "",
        "tax_lines": [],
        "taxes_included": false,
        "test": false,
        "token": "ec2d5fe62258644e52fedf73e9d1618a",
        "total_discounts": "0.00",
        "total_discounts_set": {
            "shop_money": {
                "amount": "0.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "0.00",
                "currency_code": "INR"
            }
        },
        "total_line_items_price": "2400.00",
        "total_line_items_price_set": {
            "shop_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            }
        },
        "total_outstanding": "2400.00",
        "total_price": "2400.00",
        "total_price_set": {
            "shop_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "2400.00",
                "currency_code": "INR"
            }
        },
        "total_price_usd": "32.35",
        "total_shipping_price_set": {
            "shop_money": {
                "amount": "0.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "0.00",
                "currency_code": "INR"
            }
        },
        "total_tax": "0.00",
        "total_tax_set": {
            "shop_money": {
                "amount": "0.00",
                "currency_code": "INR"
            },
            "presentment_money": {
                "amount": "0.00",
                "currency_code": "INR"
            }
        },
        "total_tip_received": "0.00",
        "total_weight": 0,
        "updated_at": "2022-01-18T14:55:20+05:30",
        "user_id": null,
        "customer": {
            "id": 2559013322852,
            "email": "gaurav.kumar@hungama.com",
            "accepts_marketing": false,
            "created_at": "2019-10-14T22:36:35+05:30",
            "updated_at": "2022-01-18T14:55:21+05:30",
            "first_name": "Gaurav",
            "last_name": "Kumar",
            "orders_count": 33,
            "state": "enabled",
            "total_spent": "204400.00",
            "last_order_id": 4251294892225,
            "note": null,
            "verified_email": true,
            "multipass_identifier": null,
            "tax_exempt": false,
            "phone": null,
            "tags": "91415343",
            "last_order_name": "#74229",
            "currency": "INR",
            "accepts_marketing_updated_at": "2019-10-14T22:36:35+05:30",
            "marketing_opt_in_level": null,
            "tax_exemptions": [],
            "admin_graphql_api_id": "gid://shopify/Customer/2559013322852",
            "default_address": {
                "id": 6202713374913,
                "customer_id": 2559013322852,
                "first_name": "Gaurav",
                "last_name": "Kumar",
                "company": null,
                "address1": "B wing, Art Guild House",
                "address2": null,
                "city": "Mumbai",
                "province": "Maharashtra",
                "country": "India",
                "zip": "400063",
                "phone": "9930069671",
                "name": "Gaurav Kumar",
                "province_code": "MH",
                "country_code": "IN",
                "country_name": "India",
                "default": true
            }
        },
        "discount_applications": [],
        "fulfillments": [
            {
                "id": 3767339909313,
                "admin_graphql_api_id": "gid://shopify/Fulfillment/3767339909313",
                "created_at": "2022-01-18T14:55:21+05:30",
                "location_id": 14871724132,
                "name": "#74229.1",
                "order_id": 4251294892225,
                "receipt": {},
                "service": "manual",
                "shipment_status": null,
                "status": "success",
                "tracking_company": null,
                "tracking_number": null,
                "tracking_numbers": [],
                "tracking_url": null,
                "tracking_urls": [],
                "updated_at": "2022-01-18T14:55:21+05:30",
                "line_items": [
                    {
                        "id": 10752746193089,
                        "admin_graphql_api_id": "gid://shopify/LineItem/10752746193089",
                        "fulfillable_quantity": 0,
                        "fulfillment_service": "manual",
                        "fulfillment_status": "fulfilled",
                        "gift_card": false,
                        "grams": 0,
                        "name": "Annabelle Comes Home - Hindi (2019)",
                        "price": "2400.00",
                        "price_set": {
                            "shop_money": {
                                "amount": "2400.00",
                                "currency_code": "INR"
                            },
                            "presentment_money": {
                                "amount": "2400.00",
                                "currency_code": "INR"
                            }
                        },
                        "product_exists": false,
                        "product_id": null,
                        "properties": [],
                        "quantity": 1,
                        "requires_shipping": true,
                        "sku": "49327873",
                        "taxable": true,
                        "title": "Annabelle Comes Home - Hindi (2019)",
                        "total_discount": "0.00",
                        "total_discount_set": {
                            "shop_money": {
                                "amount": "0.00",
                                "currency_code": "INR"
                            },
                            "presentment_money": {
                                "amount": "0.00",
                                "currency_code": "INR"
                            }
                        },
                        "variant_id": null,
                        "variant_inventory_management": null,
                        "variant_title": null,
                        "vendor": null,
                        "tax_lines": [],
                        "duties": [],
                        "discount_allocations": []
                    }
                ]
            }
        ],
        "line_items": [
            {
                "id": 10752746193089,
                "admin_graphql_api_id": "gid://shopify/LineItem/10752746193089",
                "fulfillable_quantity": 0,
                "fulfillment_service": "manual",
                "fulfillment_status": "fulfilled",
                "gift_card": false,
                "grams": 0,
                "name": "Annabelle Comes Home - Hindi (2019)",
                "price": "2400.00",
                "price_set": {
                    "shop_money": {
                        "amount": "2400.00",
                        "currency_code": "INR"
                    },
                    "presentment_money": {
                        "amount": "2400.00",
                        "currency_code": "INR"
                    }
                },
                "product_exists": false,
                "product_id": null,
                "properties": [],
                "quantity": 1,
                "requires_shipping": true,
                "sku": "49327873",
                "taxable": true,
                "title": "Annabelle Comes Home - Hindi (2019)",
                "total_discount": "0.00",
                "total_discount_set": {
                    "shop_money": {
                        "amount": "0.00",
                        "currency_code": "INR"
                    },
                    "presentment_money": {
                        "amount": "0.00",
                        "currency_code": "INR"
                    }
                },
                "variant_id": null,
                "variant_inventory_management": null,
                "variant_title": null,
                "vendor": null,
                "tax_lines": [],
                "duties": [],
                "discount_allocations": []
            }
        ],
        "refunds": [],
        "shipping_lines": []
    }
}

 

 

Replies 0 (0)