|
<< Click to Display Table of Contents >> User Guide |
![]() ![]()
|
HearAid–Xero Interface
User Guide
HAXAccIntf — Automated Invoice Creation for HearAid Practice Management
For use by practice administrators and IT staff. Note: installation and configuration of the interface requires a Windows administrator account with rights to install software, and HearAid must be accessed using SYSDBA credentials to save the interface settings.
1. Overview
The HearAid–Xero Interface (HAXAccIntf) is a background application that automatically creates invoices in Xero using billing data from your HearAid practice management system. Once configured, the interface runs silently and requires no day-to-day intervention from staff.
What the Interface Does
●Monitors HearAid for new invoice requests
●Retrieves billing details from the HearAid database
●Creates or locates the correct contact record in Xero
●Builds and submits the invoice to Xero via the Xero API
●Records the outcome (success or error) back into HearAid
What the Interface Does NOT Do
●It does not process payments — all payment handling remains within Xero
●It does not modify existing Xero invoices
●It does not run continuously as a Windows service — HearAid launches it automatically on startup and closes it on exit
Note: HAXAccIntf runs in the background. You will not see a window open when it is working. All activity is recorded in log files for review.
2. Before You Begin
Before the interface can be used, a one-time setup must be completed by your IT administrator. Staff who will use HearAid daily do not need to perform this setup.
Requirements
●Windows PC or server running HearAid
●A Xero organisation (single or multi-organisation setup supported)
●The HAXAccIntf executable placed in the same folder as HearAid7.exe
●firebird.ini configuration file placed in the same folder as the executable
●An active internet connection for Xero API communication
First-Time Xero Authorisation
The interface uses secure OAuth2 authorisation to connect to Xero. Each Windows user who opens HearAid after the interface is installed will be prompted to authorise their own access to Xero the first time they log in. A browser window will open asking them to log in to Xero and grant access. This only needs to be done once per Windows user account — the authorisation tokens are stored securely in that user’s Windows profile and reused automatically on subsequent logins.
To complete first-time authorisation:
1.Start HearAid. On first run, HearAid will launch HAXAccIntf.exe automatically and it will open a browser window to begin authorisation. If you need to run authorisation before HearAid is started, you can also launch HAXAccIntf.exe directly from Windows Explorer.
2.Your browser will open to a Xero login page.
3.Log in with your Xero credentials and click Allow Access.
4.The browser will confirm the connection. You can close it.
5.The interface is now authorised and will run automatically when HearAid needs it.
Note: Authorisation tokens are stored in each Windows user’s profile and are protected by Windows Data Protection (DPAPI). They are not accessible to other users on the same machine. Each Windows user account that runs HearAid will have its own independent set of tokens.
3. Configuration (firebird.ini)
All settings for the interface are stored in a file called firebird.ini, which sits in the same folder as HAXAccIntf.exe. This file is maintained automatically by HearAid — when a SYSDBA user saves settings via Tools | Options | Interfaces | Accounting Software, HearAid writes the changes to firebird.ini. The file should not normally be edited manually, as incorrect edits may prevent the interface from starting. Direct edits are only required in exceptional circumstances, such as correcting the database path before HearAid can be launched.
Interface settings can also be reviewed and changed from within HearAid by navigating to Tools | Options | Interfaces | Accounting Software. Boolean settings in firebird.ini use numeric values: 0 = False and 1 = True (e.g. DetailedBatchInvoices=1 means True). The checkbox controls in the HearAid Options screen correspond directly to these values.
Important: The interface configuration settings can only be saved by a user with SYSDBA privileges. When setting up or changing the configuration, you must log in to HearAid with the username SYSDBA and the SYSDBA password before navigating to Tools | Options | Interfaces | Accounting Software. Settings saved by any other user will not be written to firebird.ini.
Key Settings
Setting |
Description |
|---|---|
CompanyFile |
The Xero Organisation Display Name, exactly as it appears in Xero (Settings | Organisation Details). This value is case-sensitive and must match character for character — including spacing and punctuation. If it does not match exactly, the interface will be unable to connect to Xero and all invoice submissions will fail. This setting is mandatory whenever more than one Xero organisation is connected to the account, and is strongly recommended even for single-organisation setups. |
XeroInvoiceStatus |
Controls whether invoices are created as DRAFT (for review before approving) or AUTHORISED (approved immediately). DRAFT is recommended until you are confident the setup is correct. |
XeroSalesAccountCode |
The Xero chart-of-accounts code to use for invoice line items. Leave blank to allow the interface to detect it automatically: on startup HearAid retrieves the root (default) sales account code from Xero. This default is used when Xero inventory items have not been allocated to a specific active account. |
DetailedBatchInvoices |
Controls how Hearing Services Program batch invoices are built. When True (1), a detailed invoice is produced with one line per paid claim item, with taxable items split and device/service components separated. When False (0), a single summary line item is used containing the total payment amount. See Section 5 for full details. |
XeroIncludeItemCodes |
When True (1), the Xero inventory item number is prepended to the line item description on the invoice. This allows the item number to appear on the invoice even when the invoice template in Xero is not configured to display the item code column. Most practices leave this False (0). |
Show Interface |
When True (1), the interface console window is displayed while it is running. When False (0, the default), the interface runs hidden in the background. Enable this temporarily in HearAid via Tools | Options | Interfaces | Accounting Software to view live output for troubleshooting. |
Recommended Starting Configuration
For a new setup, these values are recommended until you have tested a few invoices:
[AccountsInterface]
XeroInvoiceStatus=DRAFT
DetailedBatchInvoices=1
XeroIncludeItemCodes=0
XeroSalesAccountCode=
CompanyFile=<Your Xero Organisation Name>
Note: Once you have confirmed invoices are being created correctly in Xero, you can change XeroInvoiceStatus to AUTHORISED so invoices are approved automatically.
4. Setting Up the Billing Map
The Billing Map tells the interface which Xero account to use when creating invoices for Agreements, Consumables, Notes, Repairs, Reports, and Summaries. Each service type must be mapped to an account that exists in your Xero Chart of Accounts.
The Billing Map is managed in HearAid via Lists | Billing Map.
Taxable and Non-Taxable Accounts
For service types that include taxable items, the Billing Map should include two Xero account names: one for GST-free (non-taxable) amounts and one for taxable (GST-inclusive) amounts. Items that are always GST-free only need a single account entry. By convention, HearAid appends the letter T to the non-taxable account name to form the taxable account name. For example:
Non-Taxable Account |
Taxable Account |
Typical Use |
|---|---|---|
PROFSERV |
PROFSERVT |
Professional services |
REPAIR |
REPAIRT |
Hearing aid repairs |
CONSUMABLE |
CONSUMABLET |
Consumable items / stock |
HS005 |
HS005T |
Hearing services (example) |
If your practice uses different naming conventions for taxable and non-taxable accounts, you can configure the mapping explicitly using the Account Map in HearAid (Tools | Browse, Account Map table) rather than relying on the automatic T-suffix convention.
What Account Names to Use
The account names entered in the Billing Map must exactly match the account names in your Xero Chart of Accounts. The easiest way to obtain the correct names is to export your Inventory Items from Xero as a CSV file and provide that file to HearSoft — HearSoft can then assist you in extracting and entering the correct account codes.
Note: Contact HearSoft support with a CSV export of your Xero Inventory Items and they will assist you in mapping the correct account codes to the Billing Map entries.
Sample Billing Map
The example below shows a typical Billing Map with non-taxable and taxable account pairs. Entries without a T-suffixed counterpart visible in this list may be non-taxable-only accounts or may have their taxable counterpart defined in the Account Map. For example, HS005 and HS006 are hearing services accounts, while DEVPRIVATE and DEVPRIVATET cover private device supply:
Accounts Inventory Service Item |
|---|
COCHLEAR |
CONSUMABLE |
CONSUMABLET |
DEV |
DEVPRIVATE |
DEVPRIVATET |
DEVT |
HS005 |
HS006 |
HSNC003 |
HSNC102 |
HSNC201 |
HSNC202 |
PROFSERV |
PROFSERVT |
REPAIR |
REPAIRT |
Using the Account Map for Custom Naming Conventions
By default, HearAid expects the taxable version of a Billing Map account to be named by appending the letter T to the non-taxable account name (e.g. PROFSERV → PROFSERVT). If your Xero Chart of Accounts uses a different suffix or naming convention, you can configure the mapping explicitly using the ACCOUNT_MAP table in HearAid.
The Account Map is managed in HearAid via Tools | Browse, selecting the Account Map table.
Each row in the Account Map defines a relationship between an internal HearAid processing code (Item), the corresponding Xero inventory item name (Maps To), and whether that Xero account represents a taxable item.
●Item — the internal code used in HearAid (matches the Billing Map entry).
●Maps To — the exact account or inventory item name as it appears in Xero.
●Taxable? — tick if this Xero account is used for GST-applicable items.
Example: A-Suffix Convention
In the example below, the practice uses an A suffix for taxable Xero inventory items rather than the default T suffix (e.g. 631A instead of 631T, 640A instead of 640T). Because HearAid would not find these accounts automatically using the T-suffix rule, each taxable account is listed explicitly in the Account Map with the Taxable checkbox ticked:
Item (HearAid Code) |
Maps To (Xero Account) |
Taxable? |
|---|---|---|
631 |
631 |
|
631T |
631A |
✓ |
635 |
635 |
|
635T |
635A |
✓ |
636 |
636 |
|
636T |
636A |
✓ |
640 |
640 |
|
640T |
640A |
✓ |
641 |
641 |
|
641T |
641A |
✓ |
700 |
700 |
|
700T |
700A |
✓ |
710 |
710 |
|
710T |
710A |
✓ |
HSC |
HSC |
|
HSCT |
HSCA |
✓ |
… |
… |
|
Note: Only the accounts that differ from the default T-suffix convention need to be listed in the Account Map. In this example, entries like 631T → 631A and HSCT → HSCA tell HearAid to look for 631A (not 631T) when invoicing a taxable item mapped to account 631. Non-taxable accounts (631, 635, etc.) that map to identically named Xero accounts are still listed for completeness but require no special handling.
5. Setting Up the Billing Table
The Billing table defines the set of codes available for invoicing in HearAid. It is managed via Lists | Billing.
Billing Code Fields
Each row in the Billing table represents one billable item or service. The fields are:
●Code — a short unique identifier for the billing item (e.g. PROFSERVT).
●Description — the full name of the item. This text is pushed directly into the invoice line item description in Xero.
●Billing Amount — the price charged for this item. If the item is taxable, this amount is treated as GST-inclusive (i.e. it already contains the 10% GST component).
●Taxable — tick this checkbox if GST applies to the item. When ticked, the interface will split the Billing Amount into its GST-free and GST components when building the Xero invoice line items.
●Maps to Accounts Item — the Billing Map account entry this code should use when invoicing (e.g. PROFSERVT or REPAIR). This must match an entry in the Billing Map exactly.
●Used for Invoice Type — optionally restricts this code to a specific invoice type. When populated, the code will only appear in the billing code selection list for that invoice type. For example, a code with NOTES in this field will appear only when billing a Note, not when billing a Consumable or Repair. Leave blank to make the code available across all invoice types.
Invoice Types
The following invoice types can be specified in the Used for Invoice Type field:
Invoice Type |
Used When Billing |
|---|---|
CONSUMABLES |
Consumable items and stock |
NOTES |
Consultation and service notes |
REPAIRS |
Hearing aid repair jobs |
QUOTES |
Approved quotes |
REPORTS |
Audiological reports and industrial screening |
Note: If the Used for Invoice Type field is left blank, the billing code will appear in the selection list for all invoice types.
Invoice Types That Do Not Use Billing Codes
The invoice types in the table above apply to service-based transactions where staff select billing codes when preparing an invoice. However, three invoice types are handled differently and do not require users to enter billing codes at all:
Invoice Type |
How the Amount Is Determined |
|---|---|
Claim |
The invoice amount is taken directly from the paid amount in the claim record. Inventory item codes are assigned from the claim data, checked against the Account Map. |
Batch |
The invoice amount is taken from the Hearing Services Program batch response. Inventory item codes are assigned from the batch item data, checked against the Account Map. |
Agreement |
The invoice amount is derived from the maintenance fee entered in the agreement record together with the billing code assigned to that agreement. Inventory item codes are allocated directly and checked against the Account Map. |
Note: For Claim, Batch, and Agreement invoices, inventory item codes are allocated directly from the record data and resolved through the Account Map. Users do not select billing codes from the Billing table for these invoice types.
GST and the Billing Amount
When the Taxable checkbox is ticked, the Billing Amount is assumed to be GST-inclusive (tax-inclusive pricing). The interface automatically extracts the GST component and creates two line items in the Xero invoice:
●A GST-free line for the net amount (Billing Amount ÷ 1.1)
●A taxable line for the GST component (Billing Amount − net amount)
For non-taxable items (Taxable unticked), the full Billing Amount is invoiced as a single GST-free line item.
Sample Billing Codes
The table below shows a representative set of billing codes. Note how taxable items map to the T-suffixed account entry in the Billing Map, and how the Used for Invoice Type column restricts codes to the appropriate invoice workflow:
Code |
Description |
Taxable? |
Maps to Accounts Item |
Used for Invoice Type |
|---|---|---|---|---|
ADULT |
Adult Hearing Assessment |
|
PROFSERV |
REPORTS |
BATTERIES |
Batteries |
|
CONSUMABLE |
CONSUMABLES |
CLEAN EARS |
Clean Ears |
✓ |
CONSUMABLET |
CONSUMABLES |
CONSULTLONG |
Long Consultation 40+ Minutes |
|
PROFSERV |
NOTES |
CONSULTSHORT |
Short Consultation Up To 20 Minutes |
|
PROFSERV |
NOTES |
CONSUMABLE |
Consumable/Non-Service Item |
|
CONSUMABLE |
CONSUMABLES |
CONSUMABLET |
Consumable/Non-Service Item - Taxable |
✓ |
CONSUMABLET |
CONSUMABLES |
DEV |
Device |
|
DEVPRIVATE |
CONSUMABLES |
DEVT |
Device - Taxable |
✓ |
DEVPRIVATET |
CONSUMABLES |
INDUSTRIAL |
Industrial Screening Test - Taxable |
✓ |
PROFSERVT |
REPORTS |
PROFSERVT |
Professional Service Taxable |
✓ |
PROFSERVT |
NOTES |
REPAIR |
Device Repair |
|
REPAIR |
REPAIRS |
REPAIRT |
Device Repair - Taxable |
✓ |
REPAIRT |
REPAIRS |
WCASSESSMENT |
Workcover - Hearing Needs Assessment |
|
HSNC102 |
NOTES |
WCREPAIR |
Workcover - Hearing Device Repairs |
|
HS005 |
REPAIRS |
Hearing Services Program Batch Invoices
When processing Hearing Services Program (HSP) claim batch responses with the Detailed Batch Invoice option enabled, a single invoice is prepared for the entire batch. The invoice lists each paid item in the batch as a separate line item. The following treatment is applied automatically:
●Taxable items are split into two line items — a GST-free component and a taxable component, so that Xero’s GST calculation produces the correct total.
●Device payments are separated from service payments — device components (e.g. hearing devices, ALDs) are mapped to device inventory items, while service components are mapped to service inventory items.
For this to work correctly, Xero must have a matching Inventory Item for each item number that appears in the batch response.
Required Xero Inventory Items
In addition to any item-number-specific inventory items, the following named inventory items must exist in Xero and be listed in the Billing Map before detailed batch invoicing can be used:
Inventory Item Code |
Taxable? |
Description |
|---|---|---|
DEV |
No |
Untaxed hearing device supply |
ALD |
No |
Untaxed Assistive Listening Device supply |
ALDT |
Yes |
Taxable Assistive Listening Device supply |
HSC |
No |
Maintenance agreement fee — untaxed component |
HSCT |
Yes |
Maintenance agreement fee — taxable component |
Note: These inventory item codes must be present in Xero and entered in the HearAid Billing Map before processing HSP batch invoices with the Detailed option enabled. If they are missing, the interface will not be able to match batch response items to Xero accounts and the invoice will fail or fall back to a summary line.
Summary Batch Invoices (Detailed Option Not Selected)
When the Prepare Detailed Batch option is not selected, the batch invoice is simplified to a single line item containing the total payment amount for the batch. If any portion of the payment is taxable, that amount is recorded separately so that GST is calculated correctly in Xero. No per-item breakdown or device/service separation is applied, and no Xero Inventory Items for individual item numbers are required.
Required Contact: Hearing Services Program
HSP batch invoices are raised against a single Xero contact representing the Hearing Services Program (the government payer), rather than individual clients. This contact must exist in Xero and its contact code must be entered in the HearAid Account Map (via Tools | Browse, Account Map table).
In the Account Map examples shown in this guide, the HSP contact code is entered as OHS. Your organisation may use a different code — use whichever code matches the contact as it is named in your Xero organisation.
Note: If the HSP contact cannot be found in Xero when a batch invoice is submitted, the interface will report an error. Ensure the contact exists in Xero and that the contact code in HearAid matches the Xero contact name or contact number exactly.
6. Day-to-Day Use
HAXAccIntf is launched automatically when HearAid starts up and closes when HearAid closes. In normal operation, practice staff do not interact with the interface directly — it runs silently in the background. Invoices are sent to Xero from within HearAid using the standard billing workflow. By default the interface window is hidden; if you need to see its activity for troubleshooting, enable the Show Interface option in Tools | Options | Interfaces | Accounting Software.
Sending an Invoice to Xero from HearAid
The exact steps depend on the record type, but the general process is:
6.In HearAid, open the relevant record (e.g., a client, claim, repair, or agreement).
7.Use the billing or export function to send the record to Xero (the exact button or menu item depends on your HearAid version).
8.HearAid will send the job to HAXAccIntf running in the background and wait for the result.
9.Within a few seconds, HearAid will display a confirmation message (success) or an error description.
10.Log in to Xero to view or approve the new invoice.
Supported Record Types
The interface can create invoices from the following HearAid record types:
Record Type |
What Gets Invoiced |
|---|---|
Agreement |
Maintenance agreements |
Batch |
Batch claims (groups of claim records) |
Claim |
Individual insurance or government claims |
Consumable |
Products issued from stock |
Note |
Consultation or service notes |
Quote |
Approved quotes |
Repair |
Hearing aid repair jobs |
Report |
Audiological reports |
Summary |
Industrial Screening (PTA) report summaries |
Note: The Client record type performs a contact check only — it verifies or creates the Xero contact for the client without creating an invoice.
7. How Client Contacts Are Managed in Xero
Before creating an invoice, the interface checks whether the client or billing party already exists as a contact in Xero. This process is automatic and happens in the following order:
11.Check existing link — If this client has been invoiced before, the interface looks up their Xero contact directly using the saved reference.
12.Search by name — If no link exists, the interface searches Xero for an active contact with a matching name.
13.Search by ID — If the name search fails, the interface searches using the HearAid client ID number.
14.Create new contact — If the client is still not found in Xero, a new contact is created automatically.
Once a contact is found or created, the link is saved in HearAid so future invoices for the same client are resolved instantly.
Note: You do not need to manually create contacts in Xero before sending invoices from HearAid. The interface handles this automatically.
8. Understanding Invoice Status in Xero
Invoices arrive in Xero as either DRAFT or AUTHORISED, depending on your XeroInvoiceStatus configuration setting.
Status |
What It Means |
|---|---|
DRAFT |
The invoice is created in Xero but not yet approved. Staff can review, edit, or delete it before approving. Recommended for initial setup and testing. |
AUTHORISED |
The invoice is immediately approved in Xero and ready to be sent to the client or recorded as due. Use this once you are confident the interface is working correctly. |
GST Handling
The interface correctly calculates GST (10%) on taxable items. For records that include a mix of taxable and GST-free amounts, two line items are created in Xero — one for each component — so that Xero's own tax calculation produces the correct total. You do not need to adjust these amounts manually.
9. Troubleshooting
Invoice Was Not Created in Xero
If HearAid reports an error after attempting to send an invoice, use the following steps to diagnose the problem.
●Check the error message — HearAid will display a description of the error. Common causes include: network/internet issues, Xero being offline, or an incorrect CompanyFile setting.
●Show the interface window — Enable Show Interface in Tools | Options | Interfaces | Accounting Software (set to True / tick the checkbox). This displays the interface console window so you can see live processing output, which can help identify where a problem is occurring.
●Check the log file — The interface writes detailed logs. See the Log Files section below for locations.
●Check the .err file — If an error occurred during processing, a file with a .err extension will be written to the queue folder containing the full error details.
●Check the .json file — The exact data sent to Xero is saved in a .json file in the queue folder. This can help identify data formatting issues.
Common Error Conditions
Error / Symptom |
Likely Cause and Action |
|---|---|
Invoice appears as DRAFT instead of AUTHORISED |
The XeroInvoiceStatus setting is DRAFT, or required account codes could not be resolved. Check the CompanyFile and XeroSalesAccountCode settings in firebird.ini. |
Contact not found in Xero |
The client name may differ between HearAid and Xero. The interface will create a new contact automatically, but check for duplicates in Xero afterward. |
Authentication error / token expired |
Xero tokens may have expired or been revoked. Restart HearAid to trigger re-authorisation via your browser. If HearAid is not available, launch HAXAccIntf.exe directly from the HearAid program folder. |
Wrong Xero organisation receives the invoice |
The Xero Organisation Display Name in HearAid (CompanyFile setting) does not match the organisation display name in Xero exactly. Check the name in Xero under Settings | Organisation Details and ensure it is copied character for character into the HearAid setting, including spacing, capitalisation, and punctuation. |
Invoice already exists |
HearAid records each successful export. If a record was already sent to Xero, the interface will not create a duplicate. Check HearAid's interface log for prior success. |
Log Files and Diagnostic Files
The following files can help diagnose problems:
File / Location |
Type |
Contents |
|---|---|---|
%LOCALAPPDATA%\<db> on <server>\HAXeroIntf.log |
Runtime log |
General startup, connection, and processing events |
Queue folder — <uuid>.err |
Error file |
Full exception and stack trace for a failed job |
Queue folder — <uuid>.json |
Xero payload |
The exact JSON data submitted to Xero for the job |
Queue folder — HAXAcc.txt |
Job log |
Per-job log entries (also written to HearAid database) |
The queue folder is located at: %LOCALAPPDATA%\<db> on <server>\HAIntfQueue\
Note: Replace <db> and <server> with the actual database name and server name as configured in your HearAid installation.
Note: Additional troubleshooting guidance is available in HearAid’s online help. Press F1 from within HearAid or use the Help menu to access context-sensitive help for the Accounting Software interface.
10. Viewing the Interface Log in HearAid
Every invoice export is recorded in the HearAid database in the interface log. You can review this log from within HearAid to see a history of all exports, their status, and any error messages. Refer to your HearAid documentation for details on how to access the interface log.
Each log entry includes:
●The date and time of the export
●The client or record that was exported
●The outcome (Success or Error)
●A descriptive message
●The time taken to process the job
11. Security Notes
The interface handles sensitive data and communicates with Xero on your behalf. The following security measures are in place:
●Xero authorisation tokens are encrypted and stored using Windows Data Protection (DPAPI) in the Windows user profile. They cannot be read by other users or applications.
●Sensitive configuration values in firebird.ini (such as database credentials) are encrypted before being stored in the file. The encryption is handled automatically by HearAid — you do not need to encrypt values manually.
●The interface does not store or transmit your Xero password — it uses the secure OAuth2 protocol so only Xero handles your login credentials.
●Xero access can be revoked at any time by logging in to Xero, going to Settings > Connected Apps, and disconnecting the HearAid integration.
Note: If the PC running HAXAccIntf is replaced or re-imaged, the Xero authorisation will need to be completed again by running the application and logging in to Xero when prompted.
12. Quick Reference
Normal Operation Checklist
●HearAid initiates all exports — no manual steps required from staff
●Check HearAid for a success or error message after each export
●Review new invoices in Xero (especially during initial DRAFT testing)
●If using AUTHORISED status, invoices are ready immediately in Xero
If Something Goes Wrong
15.Note the error message shown by HearAid
16.Check the HAXeroIntf.log file in %LOCALAPPDATA%
17.Check the .err and .json files in the HAIntfQueue folder for the failed job
18.If the issue is Xero authorisation, restart HearAid — it will launch HAXAccIntf and trigger re-authorisation via your browser. If HearAid is not available, you can also launch HAXAccIntf.exe directly from the HearAid program folder
19.Contact your IT administrator if the problem persists
Key File Locations
File or Folder |
Purpose |
|---|---|
HAXAccIntf.exe |
The interface executable — do not move or rename |
firebird.ini (same folder as .exe) |
Configuration file — edited by IT administrator |
%LOCALAPPDATA%\<db> on <server>\HAIntfQueue\ |
Job queue folder — contains .req, .rsp, .err, .json files |
%LOCALAPPDATA%\<db> on <server>\HAXeroIntf.log |
Main runtime log file |
%LOCALAPPDATA%\<db> on <server>\HAXAccIntf.cfg |
Encrypted Xero authorisation tokens (do not edit) |
13. For IT Administrators
Note: This section contains technical details intended for IT administrators, not general practice staff.
Deployment
●Place HAXAccIntf.exe and firebird.ini in the same folder as HearAid7.exe. The interface must be co-located with the HearAid executable — HearAid launches it automatically on startup from this location.
●The application must run under a Windows user account that has write access to %LOCALAPPDATA%.
●No Windows service installation is required — HearAid launches the executable automatically when it starts up and sends a shutdown signal when it closes.
●Ensure the machine has outbound HTTPS access to api.xero.com on port 443.
Queue Protocol
Communication between HearAid and HAXAccIntf uses a file-based queue in the HAIntfQueue folder. The files used are:
File |
Direction |
Purpose |
|---|---|---|
ready.sem |
Interface → HearAid |
Signals that the interface is running and ready for jobs |
<uuid>.req |
HearAid → Interface |
Job parameters in INI-style key=value format |
<uuid>.rsp |
Interface → HearAid |
Job result: STATUS, MESSAGE, PROCESS_TIME, and identifiers |
<uuid>.err |
Interface → HearAid |
Exception detail and stack trace on error |
<uuid>.json |
Interface → HearAid |
Pretty-printed Xero JSON payload for debugging |
Shutdown*.req |
HearAid → Interface |
Signals the interface to shut down gracefully |
HearAid Database Access (Firebird)
HAXAccIntf accesses the HearAid database directly using the Firebird database service. Firebird is the relational database engine that underlies HearAid. The interface connects to it to:
●Retrieve billing details, client records, and claim data needed to build each invoice.
●Write back the Xero invoice reference (INTERFACE_ID) to the originating record, enabling duplicate detection on retries.
●Write process log entries to the INTERFACE_LOG table, recording the outcome of every invoice job (visible in HearAid’s interface log).
The Firebird service must be running on the HearAid machine for the interface to operate. The database path and connection details are configured in firebird.ini under the [Connection] section (ServerName and Database).
Token Management
The interface uses the OAuth2 with PKCE (Proof Key for Code Exchange) authentication flow to connect to Xero. PKCE is a security extension to the standard OAuth2 browser-based login that eliminates the need for a stored client secret. In practical terms this means:
●No client secret needs to be stored in a configuration file, reducing the risk of credential exposure.
●Access and refresh tokens are issued after a one-time browser login. The refresh token is stored securely using Windows DPAPI and is used to obtain new access tokens automatically, so users are not prompted to log in to Xero again for as long as the refresh token remains valid (typically 60 days of inactivity).
●The interface proactively refreshes the access token before it expires (within 10 minutes of expiry), so invoice submission is not interrupted during normal use.
Idempotency and Duplicate Prevention
The interface tracks all successful Xero exports using the INVOICES table in the HearAid Firebird database. Before creating a new invoice, it checks whether the record has already been exported. This prevents duplicate invoices from being created if a job is retried after a transient failure.
Xero contacts are similarly de-duplicated: the ContactID returned by Xero is written back into the HearAid record so subsequent jobs resolve the contact immediately without a name search.