> ## Documentation Index
> Fetch the complete documentation index at: https://support.visualcare.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration troubleshooting

> Common issues and fixes for Xero, KeyPay, and other integration exports

<Info>
  This section is being expanded. If you're experiencing an issue not covered here, contact the Visualcare helpdesk.
</Info>

## Xero invoicing errors

### Export summary errors

These errors appear on the export summary pop-up when the set up is incomplete.

| Error                                  | How to resolve                                                                                                                                                                                                                         |
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **No agreement payer accounting code** | Go to **Maintenance** → **Payers**, search for the payer missing an accounting code, click on it, and select an **Accounting Code** from the drop-down. If the contact isn't listed, click **sync contacts** in the top-right corner.  |
| **No client payer accounting code**    | Same resolution as above.                                                                                                                                                                                                              |
| **Client missing accounting code**     | Go to the client profile and select a code in the **Accounting Code** drop-down, or select a **Payer** if applicable.                                                                                                                  |
| **Service missing accounting code**    | Go to **Maintenance** → **Services**, search for the service missing an **Accounting Code**, click on it, and select the code from the drop-down. If the code isn't listed, click **Sync Xero Invoice Items** in the top-right corner. |

### Export status errors

If you get an error on the export status page before clicking **Start Import**, it means the payer, client, or service does not have an accounting code selected. See the resolutions above.

| Error                                                         | How to resolve                                                                                                                                                                                                                      |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Accounting code missing in Visualcare - try syncing again** | Go to **Settings** → **Data Export** → **XERO** and click all the sync buttons, then try the export again.                                                                                                                          |
| **Missing code in Xero** (service-related)                    | Make sure the inventory item is set up and active in Xero.                                                                                                                                                                          |
| **Missing code in Xero** (kilometre-related)                  | Go to **Settings** → **Finance** → **Kilometre** and make sure the codes are entered. Also check the client agreement to see if override has been ticked. If so, make sure a code is selected or untick override if not applicable. |
| **Error: To update fields on a paid invoice line item**       | Go to **Settings** → **Data Export** → **Accounting Software** and update the **Next Invoice Number**. This happens when the next invoice number has already been created in Xero.                                                  |
| **Invoice not of valid status for modification**              | Same resolution as above.                                                                                                                                                                                                           |

## Xero payroll errors

### Export summary errors

| Error                                 | How to resolve                                                                                                                                    |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **No support worker accounting code** | Go to **Worker Profile** → **Finance** and select an **Accounting Code** in the worker profile.                                                   |
| **No service payroll code**           | Go to **Maintenance** → **Services**, search for the service, click on it, and select a payroll code for the level you were attempting to export. |

### Export status errors

#### Issue: FAIL undefined or Array no session

**Symptoms:** The export status page shows "FAIL undefined" or "Array no session" after attempting a payroll export.

**Cause:** The Xero API token has expired or become invalid.

**Fix:** Go to **Settings** → **Data Export** and click the pink **Clear Xero Token**. Navigate back to the same page and click **Authorise Xero**. Log into your Xero to re-establish the connection. Sync pay items, then try the export again.

#### Issue: Employee doesn't have a pay run calendar

**Symptoms:** The export fails with "Employee doesn't have a pay run calendar".

**Cause:** The worker doesn't have a pay calendar assigned in Xero.

**Fix:** Open the employee record in Xero and assign a pay calendar.

#### Issue: FAIL! Null

**Symptoms:** The export shows "FAIL! Null" when exporting payroll.

**Cause:** Too many first aid allowances are included in the export batch.

**Fix:** Select fewer items for export and process in smaller batches.

#### Issue: Employee name not found in Xero

**Symptoms:** The export fails with "Employee name not found in Xero. Please make sure Worker Accounting Code match Employee name in Xero".

**Cause:** Either the worker profile doesn't have an accounting code selected, or there is an apostrophe in the employee name on Xero that prevents the data from being read.

**Fix:**

1. Go to the worker profile and make sure an **Accounting Code** is selected
2. If the code is already selected, check for an apostrophe in the employee name in Xero. Remove it, resync contacts in VCore, reselect the worker accounting code, and try the export again

#### Issue: Earnings rate does not exist or is not valid for timesheets

**Symptoms:** The export fails with "FAIL: Earnings Rate does not exist or is not valid for timesheets".

**Cause:** Something is incorrectly set up on the Xero pay item. Common causes include:

* The **Types of Units** for the pay item is not set to **Hours**
* The Xero pay item is not set up or not active
* The payroll code being exported is not in the pay template for that employee
* The pay item is set as an allowance rather than an earnings type
* An apostrophe exists in a pay item name

**Fix:** Check the pay item in Xero and make sure it is set up as OTE or Reimbursement with the Type of Units as Hours and is active. If you use pay templates, make sure the item has been added to the template for the worker with the issue. Find and remove any apostrophes in pay item names, resync with VCore, and try the export again.

#### Issue: TrackingItemID is required for each timesheet line

**Symptoms:** The export fails with "TrackingItemID is required for each timesheet line".

**Cause:** Timesheet tracking is enabled in Xero but not configured in Visualcare.

**Fix:** Either disable timesheet tracking in Xero, or contact [support@visualcare.com.au](mailto:support@visualcare.com.au) to set up timesheet tracking. Have your Xero category name and options ready, along with the Visualcare field you'd like to map to. If tracking is already set up but you're still getting this error, make sure the tracking fields have been filled in for the timesheets you're exporting.

#### Issue: FAIL A validation exception occurred

**Symptoms:** The export fails with "FAIL A validation exception occurred".

**Cause:** There is a mismatch between the kilometre pay type setting in Visualcare and how the KM pay codes are set up in Xero.

**Fix:** Go to **Settings** → **Finance** → **Kilometre** and check how your KM pay codes are set up in Xero. Then go to **Settings** → **Data Export** → **XERO** → **KM Pay Type** and select **pay item** if the codes are Ordinary Time Earnings, or **reimbursement** if they're reimbursements.

#### Issue: No pay runs found

**Symptoms:** The export fails with "No pay runs found" when exporting kilometres.

**Cause:** No pay run exists in Xero for the selected time period.

**Fix:** Create a pay run in Xero for the time period and try the KM export again.

#### Issue: No payslips found on payrun

**Symptoms:** The export fails with "No payslips found on payrun" when exporting kilometres or expenses.

**Cause:** The timesheets have not been approved in Xero yet.

**Fix:** Approve the timesheets in Xero, then try the export again.

#### Issue: Provided period doesn't correspond with a pay period

**Symptoms:** The export fails with "Provided period doesn't correspond with a pay period".

**Cause:** The worker's pay calendar in Xero doesn't match the export period.

**Fix:** Check the pay calendar set up in Xero for the employee and make sure it is correct.

## KeyPay errors

### Issue: Export summary shows items that won't export

**Symptoms:** The export summary window highlights items that won't be successful when exporting to KeyPay.

**Cause:** Worker or service payroll codes are not correctly mapped between VCore and KeyPay.

**Fix:**

1. Make sure the KeyPay connection is established under **Settings** → **Data Export**
2. Click **Sync Employees** and **Sync KeyPay Pay Items** under **Settings** → **Data Export** → **KeyPay** section to refresh the data from KeyPay
3. Check that each worker has the correct **Accounting Code** selected in their profile
4. Check that each service has a **Payroll Code** selected for the relevant pay level under **Maintenance** → **Services**

## MYOB errors

### Issue: No Session error when exporting to MYOB

**Symptoms:** The export fails with a "No Session" error when exporting invoices to MYOB Advanced.

**Cause:** A session handling issue on the server your organisation is connected to. Visualcare runs across multiple servers, and the session state can become invalid on a specific server.

**Fix:**

1. Note the error message and which export you were running
2. Contact the Visualcare helpdesk and report the "No Session" error
3. The team will identify which server your organisation is on and resolve the session issue

<Note>This error differs from the Xero "No Session" error, which is resolved by clearing the Xero token and re-authorising. MYOB session issues are resolved on the server side by the Visualcare team.</Note>

***

## SMS errors

### Issue: SMS messages failing to send

**Symptoms:** A "Failed to send" error appears when sending SMS messages from **Operations** → **SMS**.

**Diagnosis:** The underlying error does not display in the screen itself. To find it:

1. Go to **Operations** → **SMS** and send a test SMS
2. Open your browser's developer tools (usually F12, or right-click → **Inspect**)
3. Go to the **Network** tab
4. Click the request named `send_sms.php`, then open the **Response** tab

**Common errors:**

| Response                                                   | Cause and fix                                                                                                                                                                               |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Insufficient credits for request`                         | Your MessageMedia account is out of SMS credits. Log in to your MessageMedia portal and top up your credits                                                                                 |
| `AUTH_FAILED - The auth data you have provided is invalid` | The MessageMedia API credentials on your database are incorrect. Confirm your MessageMedia API Key and Secret, then send them securely to the Visualcare helpdesk to update the integration |
| `{"status":"fail","phone":[...]}`                          | The SMS failed to send to that phone number. Contact the Visualcare helpdesk for investigation                                                                                              |

See [MessageMedia integration](/integrations/messagemedia) for how the SMS integration is set up.

## General data export issues

### Issue: Export Care Management Fees stuck on Importing

**Symptoms:** The Care Management Fees export never progresses past "Importing".

**Cause:** No accounting code is selected on the client profile - either it was never set, or the Xero contact name changed and broke the link between Visualcare and Xero.

**Fix:**

1. Open the **Client Profile** in Visualcare and check whether an **Accounting Code** is listed
2. If not, check in Xero that an active Xero contact exists for the client - create one if needed
3. Back on the **Client Profile**, click **Sync contact from Xero**
4. Once the contact syncs, select the **Accounting Code** from the dropdown
5. Click **Save**

### Issue: Export summary shows errors for all items

**Symptoms:** Every item on the export summary page shows as a failure.

**Cause:** The accounting codes for payers, clients, or services are missing or out of sync.

**Fix:**

1. Go to **Settings** → **Data Export** → **XERO** and click all the sync buttons to refresh data from your accounting software
2. Check that payers have an **Accounting Code** selected (**Maintenance** → **Payers**)
3. Check that clients have either a **Payer** or an **Accounting Code** set on their profile
4. Check that services have an **Accounting Code** selected (**Maintenance** → **Services**)

<Tip>You can click **Show fails only** on the export summary page and download the failures as a CSV to review and correct the missing codes before re-exporting.</Tip>

### Issue: Xero connection lost or expired

**Symptoms:** Exports fail with session or authentication errors, or the **Authorise Xero** button reappears.

**Cause:** The Xero API token has expired. Xero tokens expire periodically and need to be re-established.

**Fix:** Go to **Settings** → **Data Export** → **Accounting Software**, click **Clear Xero Token** if visible, then click **Authorise Xero** and log in to re-establish the connection. After reconnecting, click all the sync buttons before retrying the export.

## Related articles

<CardGroup cols={2}>
  <Card title="Xero integration" icon="building-columns" href="/integrations/xero">
    Set up and configure the Xero integration
  </Card>

  <Card title="KeyPay integration" icon="credit-card" href="/integrations/keypay">
    Connect Visualcare to KeyPay for payroll export
  </Card>

  <Card title="Exporting payroll data" icon="file-export" href="/finance/exporting-payroll-data">
    How to export timesheets and payroll data from Visualcare
  </Card>

  <Card title="Invoicing and billing" icon="file-invoice-dollar" href="/finance/claiming-invoicing-overview">
    Overview of billing and claiming in Visualcare
  </Card>
</CardGroup>
