Introduction

Xero integration allows users flexibility in billing their customers on a platform they prefer.

When you generate an invoice, the integration will cause an invoice to be generated in Xero for you to send to your customers.

Naverisk 2020r1 and later has implemented Oauth2.0 authentication for the integration with Xero. The following steps will outline configuring this

Setting up Naverisk Onsite keys for Xero Oauth2.0

Naverisk cloud partners can jump directly to the section “Setting up Xero Integration in Naverisk”. Naverisk onsite partners will be required to set up the Oauth2.0 keys for their instance.

For all Naverisk Onsite installations:

  1. Log in to Xero Develop Centre https://developer.xero.com/myapps/ with your Xero credentials. Naverisk must be added as an application under 'My App tab → New App'.

2. In the Add a new app pop up, set

0Auth 2.0 grant type: Auth code Web app

Company or application URL: <your naverisk instance URL>

0Auth2.0 redirect URI: <your naverisk URL>/OAuth/Xero/OAuth2/OAuth2Authentication/

Click Create App

Then click Now Generate A Secret

This will generate te Client Secret. Copy and save this, as you will not be able to see it after the next step. Also copy and save the Client id as this will be required

Once you have copied and saved the ID and Secret, click Save

3. Locate and backup the following files on your Naverisk server:

web.config (located in \%Program Files%\Naverisk Website\Website)

NaveriskSiteController.exe.config (Located in \%Program Files%\Naverisk\SiteController)

4. Take a copy of both of the backup files.

5. Edit both files.

6. The following keys are in both files, and are for Xero OAuth1.0. Do not remove or change these entries. The values (after value=) will be specific to your site, and may be different. These are retained for compatibility:

<!-- Consumer Key and Secret, taken from a public/partner application registered at http://api.xero.com -->

<add key="XeroApiConsumerKey" value="ABCKDYYQZWLVJOZ6JLG9AWZGSDWGNP" />

<add key="XeroApiConsumerSecret" value="HJUBWEALJFXURMRFZL2AQ7WIW6ZKA7" />

<!-- SignatureMethod. Use 'HMAC-SHA1' for public apps, 'RSA-SHA1' for private and partner apps. -->

<add key="XeroApiSignatureMethod" value="HMAC-SHA1" />

<!-- Xero API Endpoints -->

<add key="XeroApiBaseUrl" value="https://api.xero.com/api.xro/2.0/" />

7. The following keys are should be in both files, and are for Xero OAuth2.0. If you have upgraded your site from a Naverisk version prior to 2020r1, and retained your configuration files, you may need to manually add them.

The URI used for “XeroApiRedirectUrl” will match the URI you used in step 1 above for 0Auth2.0 redirect URI, but without the added /OAuth/Xero/OAuth2/OAuth2Authentication/

If you used

https://xerotest.naverisk.com/OAuth/Xero/OAuth2/OAuth2Authentication/

for the redirect URI, then the value for the key will be

https://xerotest.naverisk.com/

The value for “XeroApiClientId" will be the Client Secret that was created and copied in step 2 above.

The value for “XeroApiClientSecret” will be the Client Secret that was created and copied in step 2 above.

<!-- Xero OAuth2.0 Consumer Client Id and Client Secret from https://developer.xero.com/myapps/ -->

<add key="XeroApiClientId" value="0F41607DBDDB469395DDF4E7E7E2597A" />

<add key="XeroApiClientSecret"

value="d-O2QvkXTrS1PCHM87J28Z2gx4n3Gnldab8lXpmG13kKOPui" />

<!-- This URL should be https: and public, don't forget to include / at the end of the URL -->

<add key="XeroApiRedirectUrl" value="https://xerotest.naverisk.com/" />

8. The following keys should be in the NaveriskSiteController.exe.config file, and are for Xero OAuth2.0. If you they are not present you will need to manually add them.

In the NaveriskSiteController.exe.config

after </appsetting> <startup> </startup> <runtime>

add the following between <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> and </assemblyBinding>

but before ></runtime> </configuration>:

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<dependentAssembly>

<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />

<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />

</dependentAssembly>

<dependentAssembly>

<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />

<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />

</dependentAssembly>

</assemblyBinding>

</runtime>

9. Copy both of the edited files back to the appropriate directories

web.config will be located in \%Program Files%\Naverisk Website\Website. NaveriskSiteController.exe.config will be located in \%Program Files%\Naverisk\SiteController).

10. Restart both IIS and the Naverisk Site Controller Service.

Setting up Xero Integration in Naverisk

To create the connection to Xero via Naverisk, do the following.

  1. Under Settings > Xero Integration, choose the desired Client from the Client list and click on the 'Disconnect' button, make sure to tick the “Xero OAuth2 Enabled“.

2. An 'Edit User' box will pop up, click on the 'Connect' button for Xero.

3. A Xero Connect page is displaying and you can choose the organisation and click the “Connect“ button to access to your valid organisation(make sure you have at least one valid organisation in your account).

If you don’t have a valid organisation, login https://login.xero.com/ to set up one. Refer to the section Mapping the Xero Parameters in Naverisk

If you already had a valid organisation, you would see organisation name shown on the pop up page.

Xero has now been successfully integrated with Naverisk. So now you can see the disconnect status becomes “Connected”.

Mapping the Xero Parameters in Naverisk

  1. Set the Customer and line item information in the Xero side first. Go to https://go.xero.com/, go to [Contacts → All contacts], click the “Add contact“ button and fill in the information for the contact

Go to [Business → Products and Services] to config your line item information

2. In Naverisk Settings > Xero Integration, from the Client List select required Xero Customer.

3. Select from the Xero drop-downs

  • Customer Name
  • Tax ID
  • Default Item
  • Time Notes Item in the drop-down boxes provided and

4. Click Save (the names and items within these fields are created in Xero previously).

5. Once the Mapping is done an Invoice can be created via Reports > Invoice Job Details.

Creating a Naverisk Invoice

To create a Naverisk Billing Report that will append to your Xero instance, please do the following.

  1. Go to Reports > Billing
  2. Select Invoice Job Details.
  3. Select the client against which the Xero configuration is made.
  4. Tick "Include Invoiced History Notes in new Invoice"
  5. Select / update any other relevant options.
  6. Tick the "Create Invoice in Xero" checkbox to create an Invoice in Xero.

7. When 'Generate Report' is clicked the report will be generated and an invoice will be created in Xero under Sales > Invoices > Draft.

Did this answer your question?