Shopify order details based on the productId or lineItems id

Highlighted
Tourist
4 0 0

Hi Team,

We are trying to query a list of orders based on the productId that we published to Shopify using graphql.

However, I tried but couldn't get any relevant info on the API documents provided by Shopify forum.

Can I kindly get a quick assist on this?

0 Likes
Highlighted
Shopify Partner
585 92 134

Hello @Vamshi481

                                                   Visit this link

https://shopify.dev/docs/admin-api/rest/reference/products/product

 

I hope you will find your required results

 

Regards,

Wahab_Ahmad

 

Kindly mark my post as like and accept the solution 

1 Like
Highlighted
Tourist
4 0 0

Hi @Wahab_Ahmad 

actually, I'm trying to get orders by product id,

but whatever you shared link is for getting products by product id,

In my case, I want orders which are done for that particular product(i.e I want an API that will accept productid as input and list of orders made for that particular product as a response)

after doing some research GraphQL will do that trick, I want query to get the orders by productid using GraphQL

 

0 Likes
Highlighted
Shopify Partner
585 92 134

@Vamshi481  Try this

 

[Your store link]/admin/orders/search.json?query=variant_id:[Product Variant Id]

1 Like
Highlighted
Tourist
4 0 0

Hi @Wahab_Ahmad ,

can you please provide some more details of this API i.e GET or POST & sample request 

While I'm connecting to that API am getting below response

{
    "errors""Not Found"
}
0 Likes