Ecommerce Shopify WordPress Discussion

Shopify: Adding array of images to Product Variant Metafield using REST API

I want to achieve following: "I am getting a url for a pdf file from user. I am supposed to convert that PDF file to list of JPEG images. Then, I am supposed to store all those JPEG images to the metafield under Product Variant of Shopify." I am done with PDF file to list of JPEG images conversion part. I am getting the list of images in following both formats: List<System.Drawing.Image> List<string> (Images converted to String with Base64). I have created a Metafield named 'concept_list' under Product Variant. It is of type 'List of files'. So, now I am having trouble adding list of images which I have using REST API calls. I can easily add images to 'Product Images' or 'Product Variant Images' giving attachment in the form of string with base 64. But, I think, I can not use similar attachment while adding image files to Product Variant Metafield. If you know any way with which I can achieve this using attachment in the form of string with base 64, please let me know in the answer.
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.