It looks like you're new here. If you want to get involved, click one of these buttons!
function checkOrderStatus(orderId) {
const urlEndPoint = orderUrl + "/" + orderId;
const response = UrlFetchApp.fetch(urlEndPoint, {
method: "GET",
headers: {
"Authorization": "token " + apiKey + ":" + accessToken
}
});
return JSON.parse(response.getContentText()).status;
}