create new timeline events through admin api

Highlighted
Tourist
6 0 2

Hi,

Is it possible to create a new commentEvent in the admin order? I want to add additional details for the order. Like attache a invoice hyperlink or attache a file.

It seems it is not possible for REST API. Is it possible in graphQL? Can you please give me an example.

Thank you

Jake

0 Likes
Highlighted
Shopify Expert
4179 29 402

Orders have notes. You can therefore get a reference to the order you want, and attach notes. A link is fine. Attaching a file is not. If you have a file to attach to an order, upload it to some public file storage like AWS S3, and then save a link to that file in the order notes.

You can update order notes with the APIs as long as asked for permission to do so, write_orders. Note that there is really no other way of doctoring up an order like you want.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted
Tourist
6 0 2

I tried using notes. But how do you add a link? It does not take html tags. In additional to attaching an invoice. I want to record sync logs from my app. Like invoice is created, payment is synced with xero.

There is no way to create timeline comments in order?

0 Likes
Highlighted
Tourist
6 0 2

Is there away to add a hyper link to an order? Like <a href="link-to-invoice"> Invoice</a>

0 Likes
Highlighted
Shopify Partner
528 38 109

Try it :) That was how I gained most of my experience working with Shopify's API. Try adding HTML as a note as see how it looks on the Shopify web UI end. I would usually wind up posting a question here if I spun my wheels for an hour or so and couldn't wrap my head around something. 

0 Likes
Highlighted
Tourist
6 0 2

I did. It doesn't work. Maybe I should create a new thread. Thank you

0 Likes
Highlighted
Shopify Partner
71 12 24

Not sure if this is feasible for your use case. But orders do support metafields and thus you can use metafields to store additional details to an order.

0 Likes
Highlighted
Shopify Partner
528 38 109

What is interesting is that if I manually add an order comment and reference an URL (e.g. - https://www.google.com) then once I save the comment it automatically flags the HTML. Although I found through the REST API the only place I could add things similar to this was through making PUT request to the order and including adding a note in my request body:

 

{
	"order": {
    	"id": 1002221502526,    
    	"note": "Here is a test note."
	}
}

Although the HTML isn't honored if I try something like this:

{
	"order": {
    	"id": 1002221502526,    
    	"note": "Here is another test note, with a <a href=\"https://www.google.com\">link</a>."
	}
}

This is a good question for the Shopify staff to respond to. As if there is a different way to force the API request to instruct of HTML content it would be good to know :) 

 

0 Likes