Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: How to add TimeLine Comment to Customers using REST APIs?

How to add TimeLine Comment to Customers using REST APIs?

Abdul_Qayyum
Shopify Partner
9 0 10

I am looking to add comments using REST API on customer object, and I am able to add these comments from front-end easily requests are hitting https://admin.shopify.com/api/shopify/store-name?operation=TimelineCommentCreate&type=mutation with message and other variables but when I read the documentation it tells that mutation timelineCommentCreate doesn't exist on the 'Mutation' type.

 

How can we achieve this?

Replies 5 (5)

Liam
Community Manager
3108 344 911

Hi Abdul_Qayyum,

 

The timelineCommentCreate mutation is not available in Shopify's public API. If you want to store extra data about a customer, one workaround could be to use Metafields. You can create a new metafield for a customer and store your comment there. You can use the metafieldCreate mutation in the GraphQL API, or you can use the /admin/api/#{api_version}/customers/#{customer_id}/metafields.json endpoint in the REST API to do this.

 

Hope this helps,

Liam | Developer Advocate @ 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

Abdul_Qayyum
Shopify Partner
9 0 10

Is there any way i can create the activity using REST API?
I just want to create a timeline activity programmatically in Shopify using REST API or something else if Comment APIs are not available!

Abdul_Qayyum_0-1698135371487.png

 

 

Thomas_Lang1
Shopify Partner
241 6 56

same here, is it on the backlog to add this to the api rest or graphql? would be great if we can add events to the timeline for specific orders through the api

 

Software Developer | Owner of Tom IT - We build shopify apps
Marketplace Order Connector | sell on Amazon, bol.com, kaufland and more
Crewcart | Shop with friends!
Stock Info - Inventory List | Location based inventory information
mikaockerman
Shopify Partner
2 0 9

After two large archived threads, and multiple more requests, you would think this would become a priority. Is this going to be added any time soon?

We need to be able to log internal communication per order, and the time stamp helps. There are quite a few use cases for us. And for now it means I have to use my scripts to notify someone who then has to do it manually. Why is this not a thing? Shopify, let us COMMENT!

Paul_Adams
Tourist
7 1 8

As an alternative to using the Metafield technique to add a comment, I thought I'd share another 'hack' to accomplish a timeline post.  

I learned from another discussion on this topic (https://community.shopify.com/c/fulfillment-and-inventory/expose-the-timeline-through-an-api/m-p/762...) that if you add an order note, it adds that change to the timeline (including what was added).  So...   

1) Get the current Order Note 

2) Change the Note to what you want to communicate in the Timeline

3) Change the Note back to the original Order Note.  

Paul_Adams_0-1714512009230.png

 

This does require expanding the timeline post to actually see the comment, but hey, this is a hack so what do you expect?!?!  🤣