FROM CACHE - en_header

How to attach Image thumbnails to Draft Order w/ custom line items?

Ben_Hart
New Member
1 0 4

hi there,

I've created an app that uses the shopify draft order api to create a number of custom items based on interactions in the app, so that the customer can checkout their items using shopify.

I'd like to add image thumbnails to the items, ideally just by supplying a URL to the image file,  yet I can't seem to find a way to do this in the API reference.  (https://help.shopify.com/en/api/reference/orders/draftorder)

when Creating a draft order via API call using custom line items, rather than existing products, is there a way to add thumbnail images on those custom line items?

Reply 1 (1)
weidox
New Member
5 0 0

It is possible. Need to attach image to product (ProductImage API), create product variant with image_id (ProductVariant API), and then create draft order (DraftOrder API) based on variant_id (option1 is mandatory) and not product_id. Otherwise if draft order is being created directly from product without variant, it seems Shopify is internally creating a variant which does not get image linked.