New Shopify Certification now available: Liquid Storefronts for Theme Developers

How can I use the admin API to upload local images to products

luoooofei
Shopify Partner
4 0 0

We have a requirement to use local images on the product. Due to the high demand, we would like to upload product images using the rest amdin API, but I don't know how to generate "attachment" data.

luoooofei_0-1700193096567.png

 

Reply 1 (1)
SBD_
Shopify Staff
Shopify Staff
1671 235 346

Hey @luoooofei 

 

Attachment is a Base64 version of the image. https://base64.guru/converter/encode/image

Scott | Developer Advocate @ Shopify