This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |