How can I retrieve an image via the order API?

How can I retrieve an image via the order API?

sachiyablavant
Shopify Partner
29 0 3

Hello Friends, I am creating Shopify application named "Request for Quote",Is use for create quote for multiple products. in application I have added functionality to convert quote to order using order API provided by Shopify. I have got all data of product into the converted order but i haven't get image detail of order. So I am stuck in It Can anyone have idea about it or having solution of this problem, If yes then send me solution as soon as possible.
Thank You in Advance...

 

 

 

Replies 8 (8)

simon-skrod
Shopify Partner
150 12 31

Hi @sachiyablavant ,
Shopify doesn't store all information about the product on order entity.

It's quite common practice to simply copy product information while creating order, this is done for safety reasons (in case user delete product order would miss mandatory information if it would be simple reference to product).

Also order line items has tag which indicates if line item product still exist on shopify (it's called product_exists). You also get product_id and variant_id fields on each line item entity, so it's quite easy to get images of the product using images API.

Simonas Skrodenis
Developer of Feeds Bridge - Catalog Management System
Email: simonas@feedsbridge.com
sachiyablavant
Shopify Partner
29 0 3

https://prnt.sc/d70kkZp1_MY7

I have created order using order API.now you see above screen short i have got product_title,product_price etc.
but i can't get product image so how to get product_image using order api can you give any example of code...

simon-skrod
Shopify Partner
150 12 31

Seems like you created order with items which doesn't exist on shopify, that's why there are no images under each item.

Images can't be set on order, only products may have images, so when you create an order make sure you create it using items which actually exist on shopify in that case you will see images on order details page. But you can't assign image to order line item directly.

Simonas Skrodenis
Developer of Feeds Bridge - Catalog Management System
Email: simonas@feedsbridge.com
sachiyablavant
Shopify Partner
29 0 3

https://prnt.sc/rmzK0IDrvG7o

see....

This products exist on my  store .i create order which is product that's are available on my store.

 

simon-skrod
Shopify Partner
150 12 31

Did you provided variant id when you created order?

Simonas Skrodenis
Developer of Feeds Bridge - Catalog Management System
Email: simonas@feedsbridge.com
sachiyablavant
Shopify Partner
29 0 3

no,i provided product_id

simon-skrod
Shopify Partner
150 12 31

When you create order via API, provide variant_id like in my screenshot

Untitled.png

Simonas Skrodenis
Developer of Feeds Bridge - Catalog Management System
Email: simonas@feedsbridge.com
sachiyablavant
Shopify Partner
29 0 3

Thank you....