Re: Expose the timeline through an API?

Expose the timeline through an API?

Michaël_G_
Shopify Partner
74 0 59

Hi Shopify :),

I can see in order now that there is a super nice timeline. However I didn't find any way for an app to interact with this timeline. It would allow some nice usages, especially here are some things that would be good:

* Being able to set a message.

* Being able to add a button that would return to the app and be signed by Shopify.

Have a nice day 🙂

Replies 88 (88)

leandrorar
Visitor
1 0 7

Wow! Four years...

 

We need to, at least, be able to write a new entry to leave a log.

Xardas
Shopify Partner
9 0 7

very interested too

bdd
Shopify Partner
11 0 5

+1 for accessing scope read_comment / write_comment

Pistika
Shopify Partner
6 1 8

+1
Yes, Admin API order timeline comment PUT please!

jakehe
Shopify Partner
12 1 7

+1. please add this feature

frontflip-ak
Visitor
2 0 4

+1 - I'm surprised this hasn't be addressed at all by Shopify. Write API access would help speed up fulfillment significantly. 

gorodezkiy
Shopify Partner
6 0 19

+1 for this feature in API

LukaszWiktor
Shopify Partner
314 24 120

The order timeline is available in GraphQL API as order events:

{
  order(id: "gid://shopify/Order/2607199682620") {
    events(first:10) {
      edges {
        node {
          createdAt
          message
        }
      }
    }
  }
}

 

I'm a software engineer. I make things happen automatically.
Check out my apps Exporteo, Fulfilleo, Stockeo, and Personal Discount.
Xardas
Shopify Partner
9 0 7

Thank you, is this something new?

Any idea if there's a way to write?

Gregarican
Shopify Partner
1033 86 287

@Xardas unfortunately I am pretty sure the GQL function is read-only. Where you can query an order to see it's comments timeline, but cannot programmatically add to it. Which is a shame, since there are more than a few use cases where API integrations should be able to leave an audit trail via this feature!

TyphonSolutions
Shopify Partner
4 0 5

+1 for accessing scope read_comment / write_comment

Tangkoko
Visitor
2 0 1

+1. We need add comments via the API.

OliOnline
Excursionist
11 0 2

+1 for accessing scope read_comment / write_comment

JosephGalleria
Visitor
1 0 1

+1 for accessing scope read_comment / write_comment

This seriously needs to be added Shopify.

David_Db
Excursionist
21 0 11

5 years later and no response from Shopify.

Seems like they could not care less.

alexherold
Visitor
1 0 1

How is this still not a feature? Get with it Shopify, this is an essential part of building any tool that makes changes to orders for keeping a log and record of what's happened.

Bob-bill
Visitor
1 0 2

6 years late and nothing. 😂😂😂 here we are in 2022 and people are still waiting for this feature.

it-jkboots
Shopify Partner
8 0 1

Another vote for getting an API for Timeline. The notes are not a great place to put automated information, especially for anything that isn't plain text

CharlyTalavera
Shopify Partner
31 1 9

Another vote for seeing API for Timeline

Brandon_Eley1
Tourist
4 0 10

I still can't find anything in the API docs but somehow Loop Returns has found a way to inject notes into the timeline. See attached image. Any idea how they are able to get around this limitation??

 

Screen Shot 2022-05-26 at 2.36.18 PM.jpg

CJWalker
Tourist
10 0 12

@Brandon_Eley1  I hate to be the bearer of bad tidings, but any edits to the note are marked on the timeline automatically. For example, I’ve built Flows that edit the note, and on the timeline it says “Shopify Flow added a note to this order….”, etc. 

 

I don’t think Loop Returns modified the timeline at all. 

TyphonSolutions
Shopify Partner
4 0 5

@CJWalker Although this method does the trick, I don't want to write to the note field, but juste leave a trace of an important step/information that was done by my app. But I do use the note field for the moment since there is no API available.

Brandon_Eley1
Tourist
4 0 10

Ah, I see. Dang, I got excited for a minute. It's so crazy to me that apps can't write back to the timeline to add notes on an order in ENTERPRISE e-commerce software (we are on Shopify Plus). A feature that would most likely take their developers a single scrum cycle to complete and roll out. 😩

Charlie-SLA
Tourist
7 0 4

Another vote for seeing API for Timeline!!

TJ_Biddle
Explorer
39 1 17

Bump... add this!

 

And no, "Use the Order Notes" is not a valid replacement. That field should be kept for the customer's input upon ordering, and it's also not timestamped.

ScottPDX
Shopify Partner
3 0 8

This is a crucial feature add for any serious store management through the Shopify Admin.  If I'm not mistaken this omission also makes it unavailable for Flow automations, which prevents it from being a useful log of automated events. 

dillerdev
Shopify Partner
5 0 3

Another vote for seeing API for Timeline!

Hariharan
Visitor
1 0 2

A crucial feature and much needed.


Tonegolf71
Shopify Partner
11 0 6

We really need this one too! +1

fredrare
Shopify Partner
1 0 7

Almost 7 years now. This feature would most likely be really powerful for A LOT of merchants. And apps could make a very good use of it for automation. It surely can't be that hard, as the `timelineCommentCreate` and `timelineCommentDelete` mutations already exist on the core GraphQL schema for the web interface. It is just not exposed to the admin API via REST nor GraphQL.


If someone wants a workaround, you could just copy your session token cookie and reuse that same core api request by analyzing it in the devtools. It's pretty straightforward. However, having an almost 7-year-old issue and clients paying around $2k a month being unable to use such a simple entity and reaching for such methods seems like a weird move. I should be able to have my application posting the comment, not have it impersonating me in an insecure way and have the comments posted as myself.

 

Shopify should really give this issue the importance it deserves, as someone will have the same idea I am proposing and will end up with a session token getting stolen one day, which will not be good by any means.

dylanstoel
Visitor
1 0 0

Another vote for seeing API for Timeline, Almost 7 years later and no sign of it yet.

ShopifyDevSup
Shopify Staff
1451 238 497

Hi @dylanstoel 👋


We really appreciate the interest in accessing order timeline events with our Admin API. I'd recommend testing out the `Order.events` connection to see if it would suit your use-case. The query would look as follows and you can also further fragment on the implemented types `BasicEvent` and `CommentEvent`:

 

 

query ($id: ID!){
    order (id :  $id){
        events (first:10){
            nodes {
                id
                appTitle
                attributeToApp
                attributeToUser
                criticalAlert
                createdAt
                message
            }
        }
    }
}

 

 

Here is a sample response detailing the timeline events:

 

 

{
    "data": {
        "order": {
            "events": {
                "nodes": [
                    {
                        "id": "gid://shopify/BasicEvent/88493829292150",
                        "appTitle": "test-order-app",
                        "attributeToApp": true,
                        "attributeToUser": false,
                        "createdAt": "2022-11-24T17:29:39Z",
                        "criticalAlert": false,
                        "message": "Order was placed on test-order-app."
                    },
                    {
                        "id": "gid://shopify/BasicEvent/88493829357686",
                        "appTitle": "test-order-app",
                        "attributeToApp": false,
                        "attributeToUser": false,
                        "createdAt": "2022-11-24T17:29:39Z",
                        "criticalAlert": false,
                        "message": "$5,000.00 CAD was authorized using a card."
                    }, ...
                    {
                        "id": "gid://shopify/BasicEvent/88493830733942",
                        "appTitle": "test-order-app",
                        "attributeToApp": true,
                        "attributeToUser": false,
                        "createdAt": "2022-11-24T17:29:43Z",
                        "criticalAlert": false,
                        "message": "test-order-app captured $200.00 CAD using a card."
                    },
                    {
                        "id": "gid://shopify/BasicEvent/88494962376822",
                        "appTitle": "test-order-app",
                        "attributeToApp": true,
                        "attributeToUser": false,
                        "createdAt": "2022-11-24T18:23:51Z",
                        "criticalAlert": false,
                        "message": "test-order-app changed the fulfillment location for 50 items."
                    },
                    {
                        "id": "gid://shopify/CommentEvent/89663059165302",
                        "appTitle": "Shopify Web",
                        "attributeToApp": true,
                        "attributeToUser": true,
                        "criticalAlert": false,
                        "createdAt": "2023-01-06T22:47:25Z",
                        "message": "some test comment"
                    }, ...

 

 

Hope that suits your needs!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

it-jkboots
Shopify Partner
8 0 1

Does this only work for getting order events or is there a way to post them to the timeline with this too?

TJ_Biddle
Explorer
39 1 17

This appears to only allow reading the timeline, correct?

Is it possible post to the timeline? That's the primary use-case I'm after, personally. I'd like my app to be able to log some data in the timeline as that's a wonderful place to put various information. 

_Kevin_A
Shopify Partner
8 0 3

This would be a valuable feature for the REST API.  Allowing read and write.  A Fulfillment  Service/3PL could provide additional info to the Merchant.

+1

tamirble
Shopify Partner
3 0 4

Still didn't find a way need to write a comment / event. Can anyone share a workaround?

marvyn
Shopify Partner
1 0 1

Almost 8 years and nothing, It's very disappointing.

They don't seem to understand how important this feature is.

sweetchilicrab
Shopify Partner
1 0 2

+1 for accessing scope read_comment / write_comment

Just got into using the Shopify API and this is something we SERIOUSLY need.

Can't believe this has been a request for 8 years now! 😳

Paul_Adams
Tourist
7 1 7

As an alternative to using the Metafields to add a comment, I thought I'd share with ya'll a 'hack' to accomplish a timeline post...  

I learned from this discussion (Brandon_Eley1 and CJWalker) that adding an order note adds that change to the timeline (including the note text).  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?!?!  🤣