Covers all questions related to inventory management, order fulfillment, and shipping.
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 🙂
Hello Michael!
Thanks for posting : ) At the present time our API doesn't provide access to the timeline. However, we may open this up at some point in the future to allow developes to build integrations as you mentioned above. No ETA on when this may happen but keep an eye on our API page here:
If access to timeline becomes available you'll find details on it there.
Thanks!
To learn more visit the Shopify Help Center or the Community Blog.
Hi,
Can I in some way access the timeline through an API and add entries in the timeline?
This really needs to be a feature already, what's the hold up?
Wow - Was looking at other comments and I noticed they were from 3 years back...
I stand corrected: It's been 6 YEARS since people wanted this feature and it's still lacking. Surely it's not that hard to implement
Another vote for seeing API for Timeline
Another vote for seeing API for Timeline
Another vote for seeing API for Timeline
Another vote for seeing API for Timeline
Hey all,
This is something we are currently looking into.
Please subscribe to the API Announcement forums for upcoming announcements regarding new API functionality.
To learn more visit the Shopify Help Center or the Community Blog.
Are you though? Because it's been 6 years...
Yes, please add this to the API. Really surprised it's not available to developers!
Another vote for this!
After convincing my gf to switch over to Shopify POS I just realised that orders taken using that app only store the email address (when a receipt is sent to the customer) in the timeline and thus it's impossible to get at from an automation viewpoint.
With the (awfully dated) old application, at least the sent customer receipts got placed in the sent items of her mailbox so I could write code to parse them, extract the customer email and add to our mailing list.
Currently though with the POS app, it's back to manually copy and pasting.
Fingers crossed sometime for this comes soon!
Please add timeline access, especially the ability to post comments.
Another vote to expose the timeline via the API. Would be incredibly useful
You can read timeline comments using GraphQL API, but not write them.
We need both on REST as well.
+1 to expose access to order comments through the REST API
Another vote for seeing API for Timeline
Another vote for seeing API for Timeline
Another vote for seeing API for Timeline
is this feature implemented or not yet ?
+1 this would be amazing.
Please add timeline access by API
Another vote for seeing API for Timeline
+1 for Timeline API access ??
+1 for this. Would be really useful!
+1 for the timeline access ! I will use it in order to push message into our slack channels, so every one in my team will have the info, but it will be stored exactlly at the good place.
+1 please, planning to upload photos of my fulfilled packages using the API.
+1 as well 🙂
+ 1 for Timeline API access.
+1
+1
+1
+1
+1
+1 really need
This has now been requested for two years. Fair to say that it would be good with a response from an admin on what the status of this is.
Alright, so as this thread is successfully being ignored by Shopify I went ahead and researched this deeper.
There are two ways of achieving this:
Solution #1:
Shopify has in Beta a new API called GraphQL. The documentation is really sub par, but it is possible to get the timeline comments using this: https://help.shopify.com/api/graphql-admin-api/reference/object/commentevent
Below is a working Python Script for doing this:
`
import requests
import re
import sys
import json
#Getting the date out of an individual comment
def getdate(s):
pattern = r'(?<=createdAt"\:").+?(?=\"})'
date = re.findall(pattern, s)
return date[0]
#Getting the message out of an individual comment
def getmessage(s):
pattern = r'(?<=message"\:").+?(?=\"\,\"createdAt")'
message = re.findall(pattern, s)
return message[0]
def readsettings():
#Reading AUTH token (API Password in Shopify) and the name of your shop from settings.txt. First line should contain key, while the second one should contain name
f = open("get_order_comments_settings.txt", "r")
lines = f.read().splitlines()
url = "https://" + lines[1] + ".myshopify.com/admin/api/graphql.json"
auth = lines[0]
#print("auth: " + auth + "'\n url: " + url)
return (url, auth)
#Main function
def gql():
#You should use the script with 1 command-line argument (order id), you can get this order ID by going to the url of your order and copying the last part
if len(sys.argv) < 1 or len(sys.argv) >2:
print("Invalid usage of the command! \n Correct usage: python bot.py <order_id>")
return
#Getting all the order events
query = r'{ order(id: "gid://shopify/Product/' + sys.argv[1] + '"){events(first: 100){edges{node{__typename message createdAt }}}}}'
#Getting settings
(url, api_token) = readsettings()
#Commented out hard-coded values
#url = r'https://tester35353.myshopify.com/admin/api/graphql.json'
#api_token = "51d157d4ff8ef92bdd65e7011b52c14e"
headers = {'X-Shopify-Access-Token': api_token, 'Content-Type' : "application/graphql"}
#posting the request to GraphiQL Shopify API
r = requests.post(url=url, data=query, headers=headers)
#searching for the right events from the response
pattern = r'typename":"CommentEvent".+?(?=\{)'
found = re.findall(pattern, r.text)
#basic error handling, should be expanded on/changed if you need to feed the output to another script
if len(found) < 1:
print("No matches, details: \n" + r.text)
dictionary = {}
index = 0
#forming a dictionary to dump into json
for i in found:
dictionary["Comment " + str(index)] = (getmessage(i), getdate(i))
index+=1
#print("message: " + getmessage(i))
#print("date: " + getdate(i))
#printing out the result to STDOUT
print(json.dumps(dictionary))
#print("order id: " + sys.argv[1])
if __name__ == '__main__':
gql()
`
Solution #2:
You can just crawl the shopify web front end and perform a login. Below is an UNVERIFIED solution to this. I paid a developer to do this before I created the solution above, and as such I haven't tested the code. Use at your own risk:
`
#sudo apt-get install python-pip
#sudo pip install selenium
from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import sys
import json
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
vendor_name='jaipur09' ########## Enter your vendor name
dict={}
order_id=sys.argv[1]
email = sys.argv[2]
password = sys.argv[3]
options = webdriver.ChromeOptions()
options.add_argument("headless")
browser=webdriver.Chrome(executable_path="/home/mukul/Downloads/chromedriver",chrome_options=options)
#login page
browser.get("https://"+vendor_name+".myshopify.com/admin/auth/login")
time.sleep(3)
print("Logging In")
emailObj = browser.find_element_by_xpath('//*[@id="Login"]')
passwordObj = browser.find_element_by_xpath('//*[@id="Password"]')
emailObj.send_keys(email)
passwordObj.send_keys(password)
login_attempt = browser.find_element_by_xpath('//*[@id="LoginSubmit"]')
login_attempt.submit()
element = WebDriverWait(browser, 100).until(EC.presence_of_element_located((By.XPATH, '//*[@id="AppFrameNav"]/nav/div[2]/div/ul[1]/li[2]/a/span')))
print("LogIn done")
#order_id page
browser.get('https://'+vendor_name+'.myshopify.com/admin/draft_orders/'+str(order_id))
time.sleep(3)
print("Scraping data")
#extracting comments and time
comments=browser.find_elements(By.CLASS_NAME,'timeline__comment-body')
times=browser.find_elements(By.CLASS_NAME,'timeline__time-link')
for num in range(0,len(comments)):
comment=comments[num]
time=times[num]
dict['comment'+str(num+1)]=comment.text
dict['time'+str(num+1)]=time.text
print (json.dumps(dict))
`
I have solution #1 in production and it's working like a charm.
... and I'm back to this thread. Because now, I need to post to the timeline. And, I can't find any solution. Seems GraphiQL api doesn't support that either.
Please shopify?
In GraphQL for events.
query {
order(id: "gid://shopify/Order/790544056435") {
events(first:5, sortKey: CREATED_AT, reverse: true) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
node {
__typename
id
message
createdAt
appTitle
attributeToApp
attributeToUser
criticalAlert
}
cursor
}
}
}
}
More basic in REST
GET /admin/events.json?filter=Order
or for specific Order
GET /admin/orders/915566133363/events.json
There are some requests or queries that are buggy and some event types that don't seem to be retrievable via APIs, but it is there. Am I missing something?
+1
Badly needed endpoint.
+ 1
+1
3 years for a simple addition like this with no resolution is unacceptable for a paid product
Agreed. Our business is looking to implement Shopify POS for our front-end. I've had to build some supplemental SQL DB tables to manage partial-payment transactions. In our world these would be layaways of on-hand items and special orders for getting items we don't stock. Using the API, I can port out the details and get at tight reporting, tracking, and analysis.
So far so good, although being able to track the status of these "special orders" would be more effective if I was able to interact with the comments timeline from the Rest API's Orders endpoint.
The only saving grace is that I can at least query this via the GraphQL API. See https://community.shopify.com/c/Shopify-APIs-SDKs/Using-the-order-timeline-on-the-admin-API/td-p/439... for details. Can't write to them, but this is better than nothing!
Wow, this is truly pathetic that it's not available. Even 4 years after requesting it! Hello!!!! Shopify!!! Anybody??
Did you see my post just prior to yours? This data is exposed in the GraphQL API. You cannot add comments via an API, but you can pull the existing ones that were created in the GUI. If this doesn't suit your requirements then I hear you. Enhancements like these are really just building out what should be existing functionality in a standard cloud-based POS.
+1
Add export ability for timeline to your standard customer data exports. Make it easy for Merchants to own their data!
Another vote for seeing API for Timeline
+1
Add ability to export Timeline data as part of the standard Orders export function.
Another vote for seeing API for Timeline