I'm managing a large inventory of products between warehouse systems and Shopify.
The products are added by API initially and the Shopify Product ID is stored in the warehouse product database. The variant, image and option IDs are not stored as we have not found a good way to match them on creation (Shopify appears to re-order them etc). Products Images are uploaded via src field and Shopify downloads them automatically. We have not found a way yet to tie the product image to the variant as we are attempting to keep API calls to a minimum and add Product with Variants, Options and Images in a single call.
The products often have updates (changes to descriptions, additional variants, updated variants, new images etc).
Could anyone suggest a good strategy for managing this please? The dirty way is to delete the Product and treat the update as a new Shopify Product however that has issues with referential integrity our end and flags the product as new which it isn't on the Shopify end.
The VariantInput type takes an imageSrc value, which will download and apply the image to the variant at the time of creation. ...
I'm having no joy in this. The GraphQL interface does accept the imageSrc ... but ignores it. When I query the database for images or look at it using the shopify paroduct page, these images do not exist.
Please advise ... is there a better / different way to add variants AND images AND assign the images to the variants to a product in one shot?
Thanks and best regards, jb
My input code: