Get timeline events for given customer

Solved
bbarr
Shopify Partner
6 0 0

Hi all,

 

I have a client that wants to be able to fetch timeline events that relate to a specific customer. So far, all I can tell from the docs is that you can access ALL events for the shop, or filter by associated resource, etc. I see that the data is available for a query like this, as the timeline UI exists on the customer page.. but is there a way to get it from the API?

 

Thanks,

Brendan

0 Likes
hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 134

This is an accepted solution.

Hi @bbarr ,

 

You can do this easily with the Shopify GraphQL Admin API:

 

query {
	customer(id: "gid://shopify/Customer/1352698232854") {
        id
        events (first: 100) {
          edges {
            node {
              id
              message
            }
          }
        }
  }
}

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution