New Shopify Certification now available: Liquid Storefronts for Theme Developers

Filter an order via GET by using flags or note_attributes

1 0 0


i am currently importing orders using REST, once imported I am marking them as imported by updating them with a flag and a note attribute.

Now I am trying to only GET the orders that don't have my flag/note attribute set.


How can I set the Parameter in my GET so that those orders get ignored?

Replies 2 (2)
Shopify Partner
284 42 89


Well, I don't think there is any order api request that let's you filter orders by flag/note attribute.

What you can do is a combination of filters like created_at_min, created_at_max, since_id etc into your order request to filter out the orders that you have already imported.[version]=2020-07

Shopify Partner
1033 86 282

For defining flags I typically use tags, as opposed to the note field. Since you can have multiple tags, and the note field is a one-shot deal. 

Here's a GraphQL example where I am pulling the 5 most recent orders that don't have imported defined in the tag values. The minus sign in the query specifies that I don't want the tag value to be imported. Should work fine!

  orders(first: 5, reverse: true, query: "-tag:imported") {
    edges {
      node {