Filter Order

Solved
Highlighted
Shopify Partner
21 0 0

Hello,

 

I want to filter of orders based on tags like whether order is placed from ios app or android app and also if order is placed from online store of shopify then How can I automatically add tag when order will create.

Here I have shopify app in Android as well as in IOS.

So What I'm wanting is that if order is placed from ios app then in order details in shopify store I can see automcatically added app_ios tag in tag field. Please see: http://prntscr.com/ti6yku

So how can I get it?

Thank you !

 

0 Likes
Highlighted
Shopify Partner
351 24 75

If you are talking about filtering orders in the Shopify web admin, then it's just another additional filter option off to the far right. See screen shots below!

 

Order Test Tag.jpgOrders Filter.jpg

 

Here is a discussion thread as well as the REST API docs for this endpoint. While you can't necessarily filter a query based on tags via the API that I am aware of, you can retrieve the tags for each order in the range you are pulling.

 

 https://community.shopify.com/c/Shopify-APIs-SDKs/REST-API-Orders-tags-field-used-for-filtering-and-... 
https://shopify.dev/docs/admin-api/rest/reference/orders/order?api[version]=2020-07 

0 Likes
Highlighted
Shopify Partner
21 0 0

Ok Thanks for your replay.

Here my question is that how can I add tag when user placed order from store as well as from android app or Ios app.

So I can see in tags like if order placed from online store then tag should be added online_store tag and if order placed from android app then tag should be added app_and like wise.

 

0 Likes
Highlighted
Shopify Partner
351 24 75

This is an accepted solution.

There was a recent thread on here regarding determining the sales channel for orders. The most direct way to get this by its specific name value (e.g. - Online Store) is to use the Shopify GraphQL API. Here is the thread that discusses this --> https://community.shopify.com/c/Shopify-APIs-SDKs/Way-to-find-sales-channel-of-an-order/m-p/811843#M....

Once you have that sales channel value and you have the order number, here below is a GraphQL sample payload that you'd have in the body of a request to add a note to the order. The only tricky part is regarding which Shopify POS app version was used --- iOS versus Android. I believe the sales channel is just listed as Point of Sale.

{
  "order": {
    "id": {the_order_id},
    "note_attributes": [
        {
          "name": "Note",
          "value": "{your_value}",          
        }
    ]
  }
}

 

1 Like