Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > SDKs >

xero.updateTenants() failing Node SDK

Started by Tomas Test -   in SDKs

Hi, I developed an integration using the Node SDK and it works fine with the Demo Company.

Once I move it into production (with a different CLIENT ID) and I try to authenticate using the same Demo company I get a "AuthorizationUnsuccessful" when executing updateTenants()

This is my code

await xero.setTokenSet({ access_token: req.headers.access_token });
await xero.updateTenants();

I am only requesting for these scopes


What scope the updateTenants require? and is there a better way then to know the tenantId that is associated with the access token?

Have in mind that this works without an issue in dev with the same settings just a different CLIENTID and SECRET

Found the issue.

When calling updateTenants make sure to pass false as a parameter await xero.updateTenants(false);

Otherwise it will try to make an extra API call to get details of each tenant (organization) and In my case I wasn't requesting scopes for that.

Tomas Test