Closed Philomath88 closed 4 months ago
In case anyone is wondering...
It worked for me but I had to use the API Node
const Shopify = require('shopify-api-node');
const product = { title: 'Burton Custom Freestyle 151', body_html: 'Good snowboard!', vendor: 'Burton', product_type: 'Snowboard', status: 'draft' };
shopify.product.create(product) .then(response => { console.log('Product created successfully...', response); }) .catch(error => { console.log('Error adding the product', error); });
Before opening this issue, I have:
Upgraded to the latest version of the relevant packages @shopify/admin-api-client package and version: 2.0.0 Node version: 16.13.0 Operating system: macOS 14.2.1 Set { logger: { level: LogSeverity.Debug } } in my configuration, when applicable Found a reliable way to reproduce the problem that indicates it's a problem with the package Looked for similar issues in this repository Checked that this isn't an issue with a Shopify API If it is, please create a post in the Shopify community forums or report it to Shopify Partner Support Expected behavior I expect to be able to add a product to my Shopify store using a Node.js script without encountering errors related to missing required parameters.
Actual behavior When attempting to add a product, I receive an error indicating that required parameters are missing.
Steps to reproduce the problem Initialize the Shopify Admin API client with the correct store details and API version. Define the product data in the script. Attempt to add the product using the restClient.post method. Observe the error indicating missing required parameters. Debug logs javascript Copy code // Relevant debug logs (if any) Error adding product: Required parameter missing Additional details Here is the Node.js script I am using:
Despite following the documentation and ensuring that all required parameters are included in the productData, I continue to receive errors. Any guidance or examples of a working script to add a product would be greatly appreciated.
Thank you!