knut-otto
knut-otto

Reputation: 11

Shopify Python API and textiles inventory

We are a small-scale fair-trade textiles importer and recently made the internal switch to OpenERP for our inventory management. We have two shops on Shopify (in two different languages).

In a longer term, I have two goals: 1) to synchronise the inventory of the two shops and 2) to build a Shopify plugin for OpenERP that imports a sale upon reception of an email from Shopify. Since OpenERP itself is written in Python, I would like to work with the Shopify Python API. And since we're working with textiles wich usually have different styles and size, we're working with SKUs and variants in Shopify.

As a start, I would like to be able to sync the inventories between the two shops at midnight each day. If the inventory count of Shop A is lower than in Shop B, Shop B should get the count of Shop A, and the other way around.

My biggest problem in the moment seems to be to get a simple list of SKUs and inventory count with the Python API. Ideally, I would like to get two simple lists of SKUs and their inventory count, check if the variant from Shop A exists in Shop B and then check the inventory and propagate needed changes between the two.

However, I can't seem to get such a list and the documentation is extremely limited. Is the only possibility really to get all products first, then, for each product, to get the variants, and then to list these variants individually? So I would actually need to construct a whole database organisation around a task that I considered quite simple?

Does somebody have any experience with such a task? Is there any further documentation or examples that I could have a look at?

Thank you very much, Knut-Otto

Upvotes: 1

Views: 712

Answers (1)

Edward Ocampo-Gooding
Edward Ocampo-Gooding

Reputation: 2872

Your best bet is to start by pulling down all products and variants from each shop into a db on your side. After that, you can listen for products/update webhooks and orders/paid webhooks to be alerted of any changes you should make.

Upvotes: 1

Related Questions