Retrieving Staff Who Helped with Sale

Greg_Kujawa
Shopify Partner
1020 83 262

Does anyone know how to retrieve the "Staff who helped with sale" value via the API? Have looked in the REST API and the GraphQL API and so far I'm not seeing it. 

 

I'm looking here (https://help.shopify.com/en/api/graphql-admin-api/reference/object/lineitem#fields) and here (https://help.shopify.com/en/api/reference/orders/order). 

 

Our company is considering using Shopify POS to replace our current POS. Although we have more than the occasional sale split between two salepeople. And commissions are based upon reporting out on this. The canned Shopify admin report of "Staff who helped with sale" doesn't suffice. It lacks the underlying transactional detail, also referencing the other salesperson. Hence my need for an API query to get at these details.

Replies 29 (29)
Greg_Kujawa
Shopify Partner
1020 83 262

So far after posting here, as well as contacting Shopify support and Shopify Partner support, I haven't heard anything back. So I can only assume that unfortunately this field isn't exposed as any existing Shopify API endpoint. Still hoping/wondering if this is on some future roadmap for future API releases...

Josh
Shopify Staff
Shopify Staff
1134 82 213

Hey Greg, 

 

The only way that I can think of to get this information currently would require being on a Shopify Plus subscription, since that grants access to the User API.

 

The order object has a user_id attached to it that is populated when POS orders are placed, and it could be used with the User API to grab the details on the person that was responsible for a particular order.

Josh | 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 the Shopify Help Center or the Shopify Blog

Greg_Kujawa
Shopify Partner
1020 83 262

Thanks for the reply. I see that the user_id is passed back when I query the API endpoint for these orders and their line items. And I realize that I would need to subscribe to Shopify Plus in order to correlate a particular user_id with a user's name. But that's not my question.

 

I'm not looking to determine the user who logged into Shopify POS to ring an order. I'm looking as any user identified as "Staff who helped with sale." I don't see this optional secondary value anywhere in any API documentation.

Greg_Kujawa
Shopify Partner
1020 83 262

Here is where the front-end Shopify POS client is discussed --> https://help.shopify.com/en/manual/sell-in-person/transactions/cart/sales-attribution. All I need to know is where this data is accessible via any API consumer. And if it's not accessible, are there any future plans to expose it via an API.

David_Muzi
Shopify Staff (Retired)
Shopify Staff (Retired)
95 3 9

You can access the staff member who helped with the sale using the GraphQL API, by accessing the staffMember field on the lineItem of the order. For ex,

{
  orders(first: 10, sortKey: CREATED_AT, reverse: true) {
    edges {
      node {
        lineItems(first: 10) {
          edges {
            node {
              staffMember {
                name
              }
            }
          }
        }
      }
    }
  }
}

Hope this helps!

Greg_Kujawa
Shopify Partner
1020 83 262

I tried this using the Shopify GraphiQL app. Using either 2019-04 or 2019-07 versioning. Both came back as below.

 

{
"errors": [
{
"message": "Field 'staffMember' doesn't exist on type 'LineItem'",
"locations": [
{
"line": 8,
"column": 15
}
],
"path": [
"query",
"orders",
"edges",
"node",
"lineItems",
"edges",
"node",
"staffMember"
],
"extensions": {
"code": "undefinedField",
"typeName": "LineItem",
"fieldName": "staffMember"
}

 

I'm wondering if this property is exposed?

David_Muzi
Shopify Staff (Retired)
Shopify Staff (Retired)
95 3 9

My apologies, you're right, this property is not exposed to public clients.  I will create an issue on our internal tracker to see if this could be exposed.

Greg_Kujawa
Shopify Partner
1020 83 262

Appreciate the follow-up. That'd be great if you could. And please let me know the feedback. It would be a big advantage to be able to get at this information. The workarounds we have developed aren't nearly as clean. 

 

Thanks!

 

Greg_Kujawa
Shopify Partner
1020 83 262

Any feedback through your internal tracker about this? For long-term planning this would be helpful to know. Thanks!

Greg_Kujawa
Shopify Partner
1020 83 262

Pinging this again. I have a feeling that otherwise this might get lost in the shuffle. Can someone please me know if there was any movement on this in your internal tracker?

Josh
Shopify Staff
Shopify Staff
1134 82 213

Hey again Greg, 

 

Feel free to continue pinging to make sure this doesn't fall through the cracks, not a problem at all. There is still some ongoing discussion internally about exposing this data and how to do it in the best way, but no final decision yet. 

Josh | 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 the Shopify Help Center or the Shopify Blog

Greg_Kujawa
Shopify Partner
1020 83 262

Pinging again. Any status update on this gap? Please let me know when you get a chance. Thanks!

Josh
Shopify Staff
Shopify Staff
1134 82 213

Hey @Greg_Kujawa , 

 

Sorry for the delay here - I haven't heard about this for a while now. I'll check back in today!

Josh | 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 the Shopify Help Center or the Shopify Blog

Josh
Shopify Staff
Shopify Staff
1134 82 213

Hey again @Greg_Kujawa , 

 

Just wanted to let you know that this is still an ongoing conversation here, it hasn't been forgotten but there's a lot of complexity involved when it comes to what information should be surfaced, as well as our ability to even be selective about what information is made available to begin with. Hopefully something that we're able to get taken care of sooner rather than later, I just didn't want you to think that nobody is looking into it right now.

Josh | 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 the Shopify Help Center or the Shopify Blog

Greg_Kujawa
Shopify Partner
1020 83 262

Pinging this again, since we are close to having our ducks in a row enough to launch Shopify POS. The "sales split" being reported via the API is a stumbling block we'd like to see removed if possible 🙂 

Josh
Shopify Staff
Shopify Staff
1134 82 213

Hey @Greg_Kujawa , 

 

Good on you for keeping up with this. Nothing new that I can share as of this time, but there is a chance of progress being made in the near future. I can't make any promises yet though so don't get too excited, but stay tuned! 

Josh | 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 the Shopify Help Center or the Shopify Blog

Greg_Kujawa
Shopify Partner
1020 83 262

Thanks for the info @Josh . This sounds promising. The other stumbling block we have involves the POS salesperson creating a new special order for product we haven't carried before. I currently have an Edit Cart function where the salesperson populates a form --- specifying the vendor, the vendor's style number, and a brief item description. When the form is submitted then the new product is created in Shopify. 

 

The issue is that there is a delay between when the product is created and when the product is visible in POS. Since to simplify things I am automatically adding the new product to the POS cart. After some discussions with Shopify staff, apparently there is a 60 second polling cycle between POS and the cloud. I have asked on here if there is a way to configure a shorter polling interval or if there's some sort of API method I can invoke the refresh things --> https://community.shopify.com/c/Shopify-APIs-SDKs/Refresh-POS-Products-List/m-p/611359#M41526

 

Any idea about this? Having the user waiting up to 60 seconds to complete the Add to Cart is a little clumsy.

Josh
Shopify Staff
Shopify Staff
1134 82 213

Hey @Greg_Kujawa , 

 

Sorry for the slow reply to this - a role change has given me a lot less time to spend on our forums. 

 

There's no way to speed up the polling time for new products, it's always the same speed and I've never heard of any way to modify it. However, we do have a new version of the POS app coming next year and perhaps when it launches it'll be faster than it is now. 

Josh | 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 the Shopify Help Center or the Shopify Blog

Greg_Kujawa
Shopify Partner
1020 83 262

Thanks for the feedback! I have heard that the new POS release next year should provide some helpful new features and functionality. Our workaround for this is rather than create a product in the Edit Cart function we just create a quick sale item. Since this populates immediately. Overall it doesn't prevent us from doing what we need to do in our general workflow.