Xero oAuth2.0 Authentication Workflow and Configuration

Article author
Sam Wood
  • Updated


To setup your meddbase chamber with an integration to your Xero accountancy application, you need to authenticate using oAuth2.0. This article will talk you through how to setup a brand new Xero integration, or to change an existing integration from the old oAuth1.0 authentication method to the new oAuth2.0 method.

Setup and Prerequisites

For the Xero integration to work correctly, you will need a Xero account to which you admin access, and the Accountancy Interface chargeable feature enabled in Meddbase. 

To enable the Accountancy Interface, login to your Meddbase account and navigate to Admin > Configuration > Chargeable Features, and tick Accountancy Interface:


oAuth2.0 Authentication

The next step is to link your Meddbase chamber with your Xero instance. To do this, first navigate to Admin > Configuration > Accountancy, and note that a new field, External Application has become available:


(N.B. if you are changing your interface from the old Xero authentication route to oAuth2.0 your screen will instead look like this:)


First, change the dropdown labelled Application to Xero oAuth2.0, which will give you some new options:


Next, click Login to Xero, which will open a new tab and ask you to login to your Xero account.


You'll be asked to choose an organisation to link your meddbase account to as below:


Once you select an organisation and Proceed, you'll get a confirmation and success message:


You can now continue to configure the integration.


Configuring Accounts and Nominals

In Xero, go to ‘https://go.xero.com’. Click ‘Settings’, ‘Chart of Accounts’ to setup following required chart of accounts to categorise Meddbase transactions (use ‘Add Account’ button at top to do this except for the ‘Bank Current Account’, for which you need to use ‘Add Bank Account’): 

  • MedDBase Prepayment’ – Must be set to account type Prepayment 
  • MedDBase VAT’ – Revenue Type 
  • **Bank current account – Create this as a Bank Account (‘Add Bank Account’) 
  • MedDBase VAT Exempt – Revenue Type 
  • MedDBase VAT Creditor Exempt (you will only need this if Meddbase option ‘Use creditor invoice contra accounts’ is ticked) 
  • MedDBase VAT Creditor (only need this if Meddbase option ‘Use creditor invoice contra accounts’ is ticked) 
  • Once all of these are setup, the ‘Save then test’ option in Meddbase configuration should now be working correctly, and the integration should be up and running 

Testing and finalising configuration

  • Try testing generating an invoice in Meddbase; an Invoice will only send over to Xero once it is marked as ‘Sent’ 
  • In Xero, a ‘Contact’ is equivalent to an ‘Account’, patient or insurance company 
  • The ‘Item Code on the Bill in Xero takes the form of {Meddbase Service Code}{Service Id}, or ‘SRV’{Service Id} if the service has no Service Code in Meddbase 
  • So, if you successfully can see your above invoice in Xero, now match/apply a payment to that invoice in Meddbase 
  • **IN Meddbase, every payment is a prepayment and then a match; every payment, no matter even if you apply the payment directly to the invoice. It records a prepayment and then a match. 
  • So, given the above, in Xero, every payment comes through as what is called a Prepayment, and then an Allocation is made for that prepayment to an invoice; shows as ‘Less’ 
  • In Xero, you can then look at specific Contact for invoices, or you can just look at Accounts/ ‘Sales’ to see Paid Invoices