Data sources let you pull additional information into your invoice templates beyond standard ConnectWise Manage line items. Use them to display company phone numbers, custom finance fields, IT Glue configuration data, Hudu details, or anything else your team needs on an invoice.
Better Invoice supports two types of data sources:
- Built-in ConnectWise sources — toggle on Company Details or Company Finance to access their fields
- Custom external endpoints — connect to any HTTP endpoint (IT Glue, Hudu, n8n webhooks, your own services) and use the returned data in your template
Need help setting this up? Custom endpoints are powerful but can involve moving parts. Contact us and we’ll help you get your data sources configured and working on your invoices.
Built-in ConnectWise sources
Two ConnectWise Manage endpoints are available as built-in data sources. Turn them on in the Data Sources section of the template sidebar.
- Company Details — Returns the full company record for the invoiced company, including phone number, website, address, and any custom fields on the company record.
- Company Finance — Returns the finance record for the invoiced company, including billing settings and custom fields from the Finance tab in ConnectWise Manage.
These sources use your existing ConnectWise API connection automatically. No additional configuration is needed.
Use built-in sources in your template
All data returned by a source is available under sources.<name> in your Liquid template. Select any field in the Preview panel to copy the Liquid tag to your clipboard.
{% if sources.company %}
Phone: {{ sources.company.phoneNumber }}
Website: {{ sources.company.website }}
{% endif %}
{% if sources.companyFinance %}
{% comment %} Alternate Billing Company Name {% endcomment %}
{{ sources.companyFinance.customFields.0.value }}
{% endif %}
Custom external endpoints
Custom endpoints let you pull data from any external HTTPS API — including IT Glue, Hudu, n8n webhooks, or your own internal services. You can add up to five custom endpoints per template.
Add a custom endpoint
-
In the template sidebar, go to Data Sources > Custom Endpoints.
-
Select Add Endpoint.
-
In the Name field, enter a Liquid-safe identifier (letters, numbers, and underscores only). This becomes the variable name in your template — for example, entering
itgluemakes the data available as{{ sources.itglue }}. -
In the URL field, enter the full HTTPS URL for your endpoint. You can include tokens that Better Invoice replaces automatically before each request:
Token Replaced with {{ company.id }}ConnectWise company ID {{ company.identifier }}ConnectWise company identifier {{ invoice.id }}ConnectWise invoice ID {{ invoice.number }}Invoice number For example:
https://your-n8n.app/webhook/itglue?company_id={{ company.id }} -
Turn on the Enabled toggle.
Use custom source data in your template
Custom endpoint data works the same way as built-in sources. Wrap it in a conditional so your invoice still renders if the endpoint is unavailable:
{% if sources.itglue %}
Primary Contact: {{ sources.itglue.primaryContact }}
Contract Type: {{ sources.itglue.contractType }}
{% endif %}
Requirements for custom endpoints
- The URL must use HTTPS.
- The endpoint must return valid JSON.
- The response must be under 1 MB.
- No authentication headers are sent — your endpoint must handle auth via the URL (e.g., an API key as a query parameter or a signed webhook URL).
Timing and reliability
Data sources are fetched in parallel every time an invoice is rendered. For the best experience, keep these guidelines in mind:
- Target under one second. Custom endpoints should respond in under one second. Built-in ConnectWise sources typically respond in around 130 ms.
- Custom endpoints fail gracefully. If a custom endpoint times out (10-second limit), returns an error, or returns invalid JSON, Better Invoice logs a warning and sets that source to null. Your invoice still generates — the template simply skips any
{% if sources.<name> %}blocks for that source. - Built-in sources are required. If a built-in ConnectWise source is enabled and fails, the invoice render is blocked with an error. These endpoints are expected to be reliable since they use your existing ConnectWise connection.
Preview your data
To see what a data source returns before using it in a template:
-
Load an invoice in the template editor.
-
In the Data Sources panel, select Refresh.
The Preview panel displays the full JSON response from each enabled source. Select any value to copy its Liquid tag (e.g., {{ sources.company.phoneNumber }}) to your clipboard, ready to paste into your template.
Example workflows
Display IT Glue data on invoices using n8n
Use MSP Copilot Link for n8n to bridge ConnectWise company IDs to IT Glue and return the data Better Invoice needs.
-
In n8n, create a new workflow with a Webhook trigger. Set the HTTP method to GET.
-
Add an MSP Copilot Link node. Configure it to look up the IT Glue organization ID from the ConnectWise company ID passed in the webhook query string.
-
Add an IT Glue node to fetch the data you need (configurations, contacts, flexible assets, etc.) using the organization ID from the previous step.
-
Add a Respond to Webhook node. Map the fields you want on the invoice into a JSON response.
-
In Better Invoice, add a custom endpoint with the n8n webhook URL:
https://your-n8n.app/webhook/itglue-invoice-data?company_id={{ company.id }} -
Use the returned data in your template:
{% if sources.itglue %} {% for config in sources.itglue.configurations %} {{ config.name }} — {{ config.type }} {% endfor %} {% endif %}
MSP Copilot Link handles the ID mapping between ConnectWise and IT Glue, so you don’t need to maintain a separate lookup table.