Reputation:
Essentially I have a file with a list of products I would like to add to my shopify store, I'm fairly certain it's formatted correctly although if it isn't please tell me what to fix. I was wondering how using a POST request through a private app I could get these onto my store. The file looks like this:
{
"product": {
"title": "TITLE HERE",
"body_html": "DESCRIPTION HERE",
"vendor": "VENDOR HERE",
"product_type": "PRODUCT TYPE HERE",
"variants": {
"option1": "Default",
"price": "PRICE HERE"
},
"images": {
"src": "LINK TO IMAGE HERE"
}
},
"product": {
"title": "TITLE HERE",
"body_html": "DESCRIPTION HERE",
"vendor": "VENDOR HERE",
"product_type": "PRODUCT TYPE HERE",
"variants": {
"option1": "Default",
"price": "PRICE HERE"
},
"images": {
"src": "LINK TO IMAGE HERE"
}
},
"product": {
"title": "TITLE HERE",
"body_html": "DESCRIPTION HERE",
"vendor": "VENDOR HERE",
"product_type": "PRODUCT TYPE HERE",
"variants": {
"option1": "Default",
"price": "PRICE HERE"
},
"images": {
"src": "LINK TO IMAGE HERE"
}
},
and so on... This file is named "products.json". Is there any POST request that would allow me to just submit this file, or would I have to process and break it down somehow and feed it to the API using PHP or Ruby...I spent the greater part of a day extracting all 500+ products out of a corrupted MySQL CMS backup and getting them all cleaned up in JSON (using PHP and some regex), so a pain free solution would be much appreciated.
Upvotes: 1
Views: 2838
Reputation: 55
You can store these products in database and by creating a connection from database you can add multiple products at a time by defining one array and its value will be fetched from database.
Upvotes: 0
Reputation: 38578
You cannot submit multiple products to be created at once, they need to be submitted individually. The docs you already linked to explain all the available API endpoints and the format for the data.
Upvotes: 2