Solved

How to fetch customer details who have ordered more than once

gajenderdh947
Shopify Partner
4 0 0
Dear all i am trying to fetch my customer details based on number of orders  using following query Please help
 
{"query""query { customers(first: 5, query: {number_of_orders > 1}) { edges { node { id, firstName, lastName, email, phone, createdAt, updatedAt } } }}"}
 
This gives me following error 
{
    "errors": [
        {
            "message""syntax error, unexpected invalid token (\">\"), expecting COLON at [1, 54]",
            "locations": [
                {
                    "line"1,
                    "column"54
                }
            ]
        }
    ]
}
Accepted Solution (1)

SBD_
Shopify Staff
1829 269 407

This is an accepted solution.

Hey @gajenderdh947 

 

You'll need to format the query like this:

 

query {
  customers(first: 5, query: "orders_count:>10") {
    edges {
      node {
        id
        firstName
        lastName
        email
        phone
        createdAt
        updatedAt
      }
    }
  }
}

 

Scott | Developer Advocate @ Shopify 

View solution in original post

Reply 1 (1)

SBD_
Shopify Staff
1829 269 407

This is an accepted solution.

Hey @gajenderdh947 

 

You'll need to format the query like this:

 

query {
  customers(first: 5, query: "orders_count:>10") {
    edges {
      node {
        id
        firstName
        lastName
        email
        phone
        createdAt
        updatedAt
      }
    }
  }
}

 

Scott | Developer Advocate @ Shopify