Shopify Admin Graphql API Order Search Query Syntax

Solved

Is there any page that lists what the search parameters mean and what the valid values would be?

 

I read the search syntax page @ https://help.shopify.com/en/api/getting-started/search-syntax but that's more for general syntax than specific parameters such as risk_level or fraud_protection_level

 

For some of them I can guess or retrieve valid values from the REST api docs. For the others like channel_id or location_id or sales_channel, I don't really know what it's expecting. Any docs I'm overlooking?

 

Supported filter parameters (https://help.shopify.com/en/api/graphql-admin-api/reference/queryroot):

  • cart_token
  • channel_id
  • chargeback_status
  • checkout_token
  • created_at
  • credit_card_last4
  • customer_id
  • discount_code
  • email
  • financial_status
  • fraud_protection_level
  • fulfillment_status
  • location_id
  • processed_at
  • reference_location_id
  • risk_level
  • sales_channel
  • source_name
  • status
  • tag
  • test
  • updated_at
Check out Store Recon on the app store.
0 Likes
Highlighted

Success.

Shopify Staff
Shopify Staff
297 32 63

Hey Gil,

 

This information is definitely available in our public GraphQL docs, it's just tied to the specific resource you're querying.

 

For example, the list of filter parameters which you provided are all associated with the Orders QueryRoot. To find the acceptable values of each parameter, you would have to navigate to the Order object itself. This is all hyperlinked in the docs as QueryRoot -> QueryRoot.Orders -> OrderConnection -> OrderEdge -> Order (identical to what the structure of your GraphQL query would look like).

 

In the Order object docs you will see a list of all the supported fields. The supported filter parameters will all be present in this list of fields, and the possible values for each filter parameter will be documented when you select the field you're interested in. 

 

For example, for the `risk_level` filter parameter, there is a corresponding `riskLevel` field on the Order object of type OrderRiskLevel, the documentation for this type shows that the possible values are HIGH, MEDIUM and LOW. Following similar steps for the other filter parameters such as `financial_status` will provide you with its acceptable values as well.

 

Hope this helps!

1 Like
Highlighted
Shopify Partner
43 2 5

Hi @Zameer , has this changed?

 


@Zameer wrote:

In the Order object docs you will see a list of all the supported fields. The supported filter parameters will all be present in this list of fields, and the possible values for each filter parameter will be documented when you select the field you're interested in. 

If I navigate to the Order object, I do not see filter parameters there. If you go to the QueryRoot reference, there is a list of "Supported filter parameters", but they don't list the available options for each parameter...i.e. fulfillment_status is a `filter parameter`, but what are the available filter values for that parameter?

 

So the net of my question is: where can you find the full list of filter parameters along with their valid values for each object?

Chad Richardson
Mozzo Software - Modular Software that grows with you from solopreneur to a 200 person mega team. Why keep outgrowing your Shopify Apps? Start with us, and just use the modules you need, then add more as you grow. http://MozzoERP.com
2 Likes
Highlighted
New Member
2 0 0

The fact that the graphQL documentation does not provide accurate information is a problem.

 

For instance, if you want to use graphQL to return orders, filtered by financial_status as described here: https://help.shopify.com/en/api/graphql-admin-api/reference/queryroot

The biggest challenge is this is not a returnable element in the query.  The query returns the element called "displayFinancialStatus".

Then the values for this filter have to be lowercase such as "paid" or "authorized".

 

Another great example is the filterable field "status", again listed in the first link above.  There is NOTHING that matches this if you use the same approach as above.  So what is "status"?  Who knows.

 

Finally, things are just wrong in the docs.  Again, the first link references a filter field "tag".  Its actually "tags".

 

GraphQL is not the most straightforward API, but having incorrect and or missing documentation makes it a real pita.

0 Likes