Retrieving Staff Who Helped with Sale

Shopify Partner
94 2 10

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.

0 Likes
Shopify Partner
94 2 10

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...

0 Likes
Shopify Staff
Shopify Staff
1087 75 140

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.

0 Likes
Shopify Partner
94 2 10

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.

0 Likes
Shopify Partner
94 2 10

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.

0 Likes
Shopify Staff
Shopify Staff
91 3 8

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!

0 Likes
Shopify Partner
94 2 10

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?

0 Likes
Shopify Staff
Shopify Staff
91 3 8

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.

0 Likes
Shopify Partner
94 2 10

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!

 

0 Likes
Shopify Partner
94 2 10

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

0 Likes