Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

get order by name/number with graphQL

Solved

get order by name/number with graphQL

iozyigit
Shopify Partner
29 2 4

I have old custom app that finds order detail by entering order number from customer.

Seems like this is not working anymore. Did Shopify disable this? I see new admin graphQL api allows to query by id(internal id) but customers only know order number.

 

How should I get order ID by using order name/number?

Any idea?

https://www.linkedin.com/in/ismailozyigit/
Accepted Solution (1)

ocastx
Shopify Partner
31 6 12

This is an accepted solution.

Hi Iozyigit,

 

to find an order by order number using the GraphQL Admin API you can use the following query: 

 

 

{
  orders(first:10, query:"name:1010") {
    edges {
      node {
        id
        name
      }
    }
  }
}

 

 

In this case, the query runs for order number #1010 and replies the ID and order name.

 

Hope this helps!

View solution in original post

Replies 3 (3)

ocastx
Shopify Partner
31 6 12

This is an accepted solution.

Hi Iozyigit,

 

to find an order by order number using the GraphQL Admin API you can use the following query: 

 

 

{
  orders(first:10, query:"name:1010") {
    edges {
      node {
        id
        name
      }
    }
  }
}

 

 

In this case, the query runs for order number #1010 and replies the ID and order name.

 

Hope this helps!

iozyigit
Shopify Partner
29 2 4

Thank you very much.

Seems like this was my problem, need to update my app. api was version 2022-01.

https://shopify.dev/docs/apps/store/data-protection/protected-customer-data

https://www.linkedin.com/in/ismailozyigit/
kevinkumar234
Visitor
1 0 0

can you provide the same for the order number (query) in json format(payload) and the respective URL (api) for requesting the data, kindly provide the requested data as soon as possible