Automated reports

If Thomas doesn’t mind, I have 3 other potential solutions.

First solution requires what I consider as moderate programming knowledge with understanding the APIs and how they work. Use a python script to acquire the data your looking for. You would be using the code Thomas provided. There is a way, to connect an API and upload to google sheets Google Sheets API 개요  |  Google for Developers. I have successfully uploaded information to a google sheet. So it is do-able.

Second Solution is simpler in concept, but more difficult in finding the information on how to do it. In fact, at this time I don’t have a link, however I have successfully pulled information from shiphero. Below is a snippit of my google sheets code. In the google sheets scripting, you can write a connection shiphero directly. In my code, I am just taking the order number and retrieving the shopify order link. Another potential problem is the timing and waiting for the data.

Last solution may be the least amount of programming needed. You still have to understand your webhooks and or APIs. You will need 2 paid data companies. One I called stitch I have never used, but they claim they can connect to Shiphero, the second it Zapier which has many integrations and is well known. I’ve dabbled in thier software, but I’m cheap, so I have never done anything paid with them. anyways, you can use stitch to connect to Zapier and Zapier to connect to google sheet.s You may be able to go from stitch to google sheets, but I didnt see it.

Anyways, Good luck! ~Justin

Link for Stitch: https://www.stitchdata.com/
Link for Zapier : www.zapier.com
Link for google API in solution #1 Google Sheets API 개요  |  Google for Developers

Code in Google Sheets for solution #2
Code.gs:

function myFunction(ordID) {
var strI =“{"query":"query {\n\t\n orders(order_number: \"#” + ordID
var str2 = ‘\" shop_name: \"valley-beasts.myshopify.com\") {\n request_id\n complexity\n \n data(first: 1) {\n\n edges {\n node {\n id\n\t\t\t\t\ttags\n\t\t\t\t\tfulfillment_status\n\t\t\t\t\t\n\t\t\t\t\tshipping_address{\n\t\t\t\t\t\tcountry\n\t\t\t\t\t}\n }\n }\n }\n }\n}"}’

var options = {
“muteHttpExceptions”: true,
“method”: “POST”,
“headers”: {
“Authorization”: “Bearer = YOUR TOKEN”,
“Content-Type”: “application/json”},

“payload”: strI+str2}

Logger.log(strI+str2)
var response = UrlFetchApp.fetch(“https://public-api.shiphero.com/graphql”,options)
Logger.log(response.getContentText())
var jdata = JSON.parse(response.getContentText())
Logger.log(jdata)

if (jdata.data.orders.data.edges[0] != null) {
Logger.log(jdata.data.orders.data.edges[0].node.id)
var banka=Utilities.base64Decode(jdata.data.orders.data.edges[0].node.id,Utilities.Charset.UTF_8)
var blob = Utilities.newBlob(banka)
var name = blob.getDataAsString(‘Windows-1252’)
var oNum = name.split(‘:’)
Logger.log(oNum[1])
return oNum[1]

}
if (jdata.data.orders.data.edges[0] == null){
Logger.log(“Why did we get here?”)
return “bad”
}

}

2 Likes