Integrate live inventory to shop

charlcole
New Member
2 0 0

Hi,

I have a live feed (updates every hour) and I was looking to integrate it to my shop. 

The feed is in XML format and I know how to parse it to be in the csv format for shopify. Looking on the admin section there is no place to write scripts or execute cron jobs, so was wondering if this is a feature that can be got for a plain shop? 

I could also write this and have it run on my own server but looking at the API docs I don't see any endpoints that accept csv files. Is there an endpoint that I could do a bulk upload/update to?

If this is a no to both my questions, what is the best way around my problem?

0 Likes

Hey there @charlcole ,

As far as I know it's not possible to schedule cron jobs directly on your Shopify store so you'll need to run them on your own server or use a Shopify app.

When using the Shopify API, I also don't think there's a way to pass in the CSV data directly to an API endpoint, you'll need to pass it the values for the required parameters.

With the REST Admin API, for instance, you'll need to use the InventoryLevel API endpoint and send a POST request to it, passing in the required parameters for each product variant you'd like to update.

To set/overwrite the quantity, you'll need to provide the following to the endpoint /admin/api/2021-04/inventory_levels/set.json:

  1. inventory_item_id - You can find this value by querying either the Product or Product Variant endpoint.
  2. location_id - You can find this via the Location endpoint (I believe the location ID also shows up in the URL in the Shopify Admin when viewing an inventory location).
  3. available - The new quantity.

Note that with the REST API, you can't query the Product/Variant endpoints by SKU or Barcode directly so you might need to pull down your entire product data first and write the code on your end to retrieve the inventory_item_id based on the SKU/Barcode or another product identifier attribute that your XML feed uses.  The GraphQL API might be more flexible with this.

If you're open to using an app, we have an app EZ Inventory that might be able to take care of this for you as well.  I can't say for sure if it will work for you without seeing your XML feed as some XML feeds have quite unusual structures (like very nested data or data grouped in a certain way) that might not be supported by our app.

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
0 Likes
charlcole
New Member
2 0 0

Hi @Jonathan-HA ,

That's annoying that the shopify app doesn't have an editor and allow me to schedule cron jobs. Seems like this is something pretty basic to have!! 

Sounds like to get a life feed of products into my store is something that is not very easy.

I like the sound of your app tho, it seems like it could do what I need. Reading the description EZ Inventory just focuses on the inventory, i.e. I need to have the products added already and then I provide whatever information is needed to the app so the inventory will be updated. Am I right with that description? 

The feed comes from a URL and a sample would be in the format;

<CatalogueExport>
  <Product>
    <CustomerType/>
    <Category>Sample Category</Category>
    <Sub_Cat_1/>
    <Sub_Cat_2/>
    <Product_Code>ABC123</Product_Code>
    <Temperature_Range>-18/-24</Temperature_Range>
    <Refrigerant>ABC</Refrigerant>
    <Defrost>Manual</Defrost>
    <Shelves/>
    <Int_Finish>White</Int_Finish>
    <Ext_Finish>White</Ext_Finish>
    <Power>13 Amp</Power>
    <kWh_x002F_24hr>4.90</kWh_x002F_24hr>
    <Watts>411</Watts>
    <Noise_Level_dB>48</Noise_Level_dB>
    <Max_Ambient>25°C at 60% RH</Max_Ambient>
    <Reversible_Door/>
    <Climate_Class>3</Climate_Class>
    <Ext_H>780</Ext_H>
    <Ext_W>2500</Ext_W>
    <Ext_D>960</Ext_D>
    <Weight_KG>125.0</Weight_KG>
    <Int_H>620</Int_H>
    <Int_W>1135</Int_W>
    <Int_D>790</Int_D>
    <Pack_H>840</Pack_H>
    <Pack_W>2590</Pack_W>
    <Pack_D>1030</Pack_D>
    <Packed_Weight_KG>200.0</Packed_Weight_KG>
    <Diagram_Caption/>
    <PDF_Page_No/>
    <Catalogue_Supplier_Name>Sample Supplier</Catalogue_Supplier_Name>
    <Next_Day_Delivery>N</Next_Day_Delivery>
    <Delivery_Group>4</Delivery_Group>
    <Special_Installation>No</Special_Installation>
    <Site_Survey>No</Site_Survey>
    <Net_Price/>
    <Net_Service_Price>0.00</Net_Service_Price>
    <Net_Service_Price_2>0.00</Net_Service_Price_2>
    <Special_Offer_Price>0.00</Special_Offer_Price>
    <New>No</New>
    <Amps>3.1</Amps>
    <Energy_Efficiency_Class/>
    <Energy_Class_Image/>
    <kWh_annum>1,789</kWh_annum>
    <Net_Volume/>
    <GTIN_EAN_Number/>
    <Stock>✓ in stock</Stock>
    <Due_Date/>
    <Thumbnail/>
    <Image>image_url</Image>
    <Packed_Image/>
    <Diagram/>
    <PL1_Price>100</PL1_Price>
    <SP1_Price>0.00</SP1_Price>
    <RRP>100</RRP>
    <Capacity_Ltr>1000</Capacity_Ltr>
    <Capacity_Cuft>36.4</Capacity_Cuft>
    <Features></Features>
    <Comments_Notes/>
    <Image_Caption>1100CHV</Image_Caption>
    <Order/>
    <Product_Title>1100CHV WH</Product_Title>
    <Sub_Title>sub title</Sub_Title>
    <Product_Price_Description/>
    <Refrigerant_Charge>2 x 95</Refrigerant_Charge>
    <Sales_Description/>
  </Product>
</CatalogueExport>

Needless to say there will be multiple products but that is the basic layout of a product. Do you think that your app will be able to support the feed?

0 Likes

Hey @charlcole ,

That's correct, our app is designed just for updating the inventory quantity of product variants that already exist in your Shopify store.  It won't be able to add new products or update other attributes.

Thanks for sending that sample XML, it looks like this would work with our app.

The one thing I noticed is the "Stock" field doesn't use an integer value, which the Shopify API requires.  Our app has an option to use a conditional formula to assign an integer value to it based on the text value.  For example, you can do something like this in the app:

100 if {{ Stock }} == "✓ in stock" else 10 if {{ Stock }} == "low stock" else 0 if {{ Stock }} == "out of stock" else "no match"

More info here on this: https://www.highviewapps.com/kb/using-a-formula-to-determine-inventory-quantity/

Feel free to contact us directly at support@highviewapps.com as well if you have any additional questions.

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
0 Likes
Anto_S
Excursionist
23 0 4

Hi @charlcole 

We've built multiple apps that auto update inventory from feeds to Shopify. We are happy to take a look at your feed and evaluate if we can build a flow where new products are can be seamlessly created as well. New product creation could be with an approve/reject step before the upload to Shopify.

Email me at anto@opstack.co

thanks

Anto

0 Likes