I am successfully getting the count of Products from my Shopify store with GET request. But when I am trying to add the single product in with POST request "
admin/api/2020-07/products.json"
I am getting error " {“errors”:{“product”:“Required parameter missing or invalid”}}" .
I tried to add many different examples of JSON single product etc but could not get the results. Please check below my all the code. Help will be much appreciated. Thanks
const request = require(‘request’);
const Shopify = require(‘shopify-api-node’);
const shopify = new Shopify({
shopName: ‘XXXXX-com’,
apiKey: ‘XXXXXXXXXe4058de7a48’,
password: ‘XXXXXXXXXXXXXXXb58e58514’
});
shopify.on(‘callLimits’, (limits) => console.log(limits));
let new_product = {
product: {
title: ‘ARSLAN’,
body_html: ‘test’,
Price: ‘15.5’,
product_type: ‘customproduct’,
tags: ‘Customproduct’
}
};
const options = {
method: ‘POST’,
body: JSON.stringify(new_product),
url:
‘https://XXXXXXXXXXXXXXXXXXXXX@poolsthings-com.myshopify.com/admin/api/2020-07/products.json’,
headers: {
accept: ‘application/json’,
‘apiKey’: ‘XXXXXXXXXXXXXXX’,
‘password’: ‘XXXXXXXXXXXXXXXXXXXX’,
‘X-Shopify-Access-Token’:‘XXXXXXXXXXXXXXX’
},
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body)
});