Solved

Getting tags from the order API

nstolos
Shopify Partner
2 0 0

I am trying to pull tags in a web service from Salesforce to filter various items. It appears the tags are associated with line items but the API documentation is related to an order. Anyway, I get no data from the Web Service for tags. The Service pull back all data as expected. 

Accepted Solution (1)

awwdam
Shopify Staff
249 42 36

This is an accepted solution.

Hey @nstolos,

While I was unable to find an efficient solution using the REST Admin API (using a single request), this functionality could be achieved through the GraphQL Admin API - Orders Object. This would be possible with connections via lineItems and product , and I have included an example query below that you are welcome to use as a starting point!

{
orders(first: 10) {
 edges {
  node {
   id
   lineItems(first: 5) {
    edges {
     node {
      product {
       id
       title
       tags
       }
      }
     }
    }
   }
  }
 }
}

 

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Reply 1 (1)

awwdam
Shopify Staff
249 42 36

This is an accepted solution.

Hey @nstolos,

While I was unable to find an efficient solution using the REST Admin API (using a single request), this functionality could be achieved through the GraphQL Admin API - Orders Object. This would be possible with connections via lineItems and product , and I have included an example query below that you are welcome to use as a starting point!

{
orders(first: 10) {
 edges {
  node {
   id
   lineItems(first: 5) {
    edges {
     node {
      product {
       id
       title
       tags
       }
      }
     }
    }
   }
  }
 }
}

 

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog