Skip to content

Instantly share code, notes, and snippets.

View j-norwood-young's full-sized avatar

Jason Norwood-Young j-norwood-young

View GitHub Profile
@j-norwood-young
j-norwood-young / tenants.js
Last active January 27, 2020 13:36
Retrieve all tenants from Xero
const tenants = (await axios.get("https://api.xero.com/connections", {
headers: {
"Authorization": `Bearer ${ exchange.data.access_token }`
}
})).data;
for(let tenant of tenants) {
let organisation = (await axios.get(`https://api.xero.com/api.xro/2.0/Organisation`, {
headers: {
Authorization: `Bearer ${exchange.data.access_token}`,
"xero-tenant-id": tenant.tenantId