Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Getting Started >

Trouble linking clients to their individual Xero account via integration

Started by Dax Giornandi -   in Getting Started

Hi all,

Feel like we're missing a piece of the puzzle with our integration into Xero.

We have a SAAS platform with multiple clients. We've created a Xero app integration so that our clients can sync invoicies created in our software with their xero accounts. As the SAAS provider we do not want or need any access to the clients xero account.

Currently the app is in internal testing and we are able to link one client account with one xero account. However, when we go to test with other client accounts they all link back to the same main xero organisation. Clearly this won't work in the real world - could anyone point us in the direction of a solution so that each client can link to their own xero account.

Thanks in advance for any assistance!
Hiya Dax.

Might need a bit more context to understand your issue. if you are using the OA2 auth flow correctly the "user" who is authenticating your integration plugs in their login credentials, and it returns to your application a valid token_set.

Each token set has the permissions only to write to that specific user's Xero organisation.

> https://developer.xero.com/documentation/oauth2/auth-flow

If you want to expand on your context I can try and point you in right direction. We also have a set of SDK's which should make your integration a bit simpler to implement: https://developer.xero.com/documentation/libraries/overview

Christopher Knight (Xero Staff)  

Thanks Christopher,

I think our issue is not understanding the organisation / account structure with in Xero and how to link that - could you clarify?

At the moment we are linking separate client accounts to Xero accounts within one organisation, which would mean that all out clients would end share a single Xero account - clearly not possible.

We are trying to link our client account to their own Xero account (not organisation).


Dax Giornandi  

Hi Dax - our docs on the OA1 to OA2 migration might actually help explain this better (even if you are starting fresh with OA2)


It will show the structure and relationships that our tokens work in. Let me know if you have other specific questions and I can find some more helpful code samples for you.

Christopher Knight (Xero Staff)  

Thanks Chris - I think we have it sorted now!

Dax Giornandi  

Always great to hear :)

Christopher Knight (Xero Staff)