Data sources pull extra information into your invoice template beyond standard ConnectWise Manage line items. This page covers how to turn on built-in ConnectWise sources, connect a custom HTTPS endpoint, and use the returned data in your Liquid template.
For the broader picture of what kinds of data MSPs put on ConnectWise invoices — and why — see What MSPs Put on ConnectWise Invoices Beyond Line Items.
Need a hand getting set up? Custom endpoints have a few moving parts. Contact us and we’ll help you get your data sources working on your invoices.
Turn on a built-in ConnectWise source
Two ConnectWise Manage endpoints are available as built-in data sources. They use your existing ConnectWise API connection — no extra credentials.
- Open the template editor for the template you want to modify.
- In the sidebar, go to Data Sources.
- Turn on the toggle next to the source you want:
- Company Details — the full company record for the invoiced company (phone, website, address, custom company fields).
- Company Finance — the finance record for the invoiced company (billing settings, finance-tab custom fields).
- Select Save.
Add a custom endpoint
Custom endpoints let you pull data from any external HTTPS API — IT Glue, Hudu, n8n webhooks, your own internal services. You can add up to five custom endpoints per template.
-
In the 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 itglue makes 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 Example:
https://your-n8n.app/webhook/itglue?company_id={{ company.id }} -
Turn on the Enabled toggle.
-
Select Save.
Use source data in your template
All data returned by a source is available under sources.<name> in your Liquid template. Wrap custom sources in a conditional so your invoice still renders if the endpoint is unavailable.
{% if sources.company %}
Phone: {{ sources.company.phoneNumber }}
Website: {{ sources.company.website }}
{% endif %}
{% if sources.companyFinance %}
{{ sources.companyFinance.customFields.0.value }}
{% endif %}
{% if sources.itglue %}
Primary Contact: {{ sources.itglue.primaryContact }}
{% endif %}
Copy Liquid tags from the Preview panel
You don’t have to type tag paths by hand.
- In the template editor, load an invoice.
- In the Data Sources panel, select Refresh.
- In the Preview panel, select any field. The Liquid tag (e.g.,
{{ sources.company.phoneNumber }}) copies to your clipboard.
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 through the URL (an API key as a query parameter or a signed webhook URL).
How failures are handled
Data sources are fetched in parallel every time an invoice is rendered. Failure behavior depends on the source type.
- 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 skips any{% if sources.<name> %}blocks for that source. - Built-in ConnectWise sources are required. If a built-in source is enabled and fails, the invoice render is blocked with an error. These endpoints use your existing ConnectWise connection and are expected to be reliable.
For best results, aim for responses under one second. Built-in ConnectWise sources typically respond in about 130 ms.
Example: display IT Glue data 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) 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 ID mapping between ConnectWise and IT Glue, so you don’t need to maintain a separate lookup table.