Creating a timeline event

Hi, is it possible to create a order timeline event via the API?

I.e. I would like to attached a file/document to the order timeline via the API.

1 Like

Hey @Codeminds

There isn’t currently a direct mutation to create a timeline event, but certain API actions will automatically generate events in the order timeline. I’ve tested a few approaches with the orderUpdate mutation that you might find useful.

Adding custom attributes to an order does create a timeline event. Similarly, adding a note to the order also appears in the timeline. Both of these methods could work for attaching information about your file/document to the order. For the actual file attachment, you’d likely need to store it elsewhere (like a metafield) and reference it in your custom attribute or note, as the timeline itself doesn’t directly store files.

The BasicEvent object documentation provides more details on the types of events that appear in the timeline.

Hi Kyle, thanks for the reply. So is there a way to emulate the functionality of adding a comment (file attachment) to the timeline, by developing a custom app? So that I can add a file to the timeline via the API?

There isn’t an endpoint for adding timeline comments through the API. I’ll pass this feedback on as a feature request. I can see this would be really useful.