get order image

752791128
Shopify Partner
3 0 0

I use this api get order
https://secret:password@shop_url/admin/api/2023-07/orders.json
How to get order->line_items images?

Replies 4 (4)

Liam
Shopify Staff
2731 302 783

There is a `line_items` field on the Order resource, which has properties for id and sku, title, etc, but the images don't appear to be exposed on the REST API. Images for line items are available in the GraphQL API, you can see the image field on the LineItem object in our docs here. Could you use this?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

752791128
Shopify Partner
3 0 0

Can you answer in Chinese or have other colleagues who understand Chinese answer me? 

I didn't see GraphQL API this api demo 

how to use this api? Do you have a demo example?

Look at my MP4 mouse   i just want to get this image

anonymous9
Visitor
1 0 0

i am facing the same issue what the solution to get the order image 

ShopifyDevSup
Shopify Staff
1415 231 484

Hey @anonymous9

 

To get the order line item image, you'll need to use our GraphQL API's. Liam has shared the resource here: https://shopify.dev/docs/api/admin-graphql/2024-04/objects/LineItem#field-lineitem-image 

 

Here's an example of an order query, with the line item image,: https://shopify.dev/docs/api/admin-graphql/2024-04/queries/order 

{
   order(id: "gid://shopify/Order/9749629992982") {
       lineItems(first: 10) {
           nodes {
               image {
                   id
                   src
               }
           }
       }
   }
}
 

Hope that helps 

 

- Kyle G. 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog