Querying Xero Financial Data via the TrustPager API & MCP
Every Xero query type available in TrustPager - contacts, invoices, P&L, Balance Sheet, aged receivables and payables - with parameters, examples, and troubleshooting.
TrustPager connects directly to your Xero account and lets you pull live financial data into the CRM — via the API, the MCP server, or any automation that can call a webhook. This article covers every available Xero query type, the parameters each one accepts, and what to watch out for.
Prerequisites
- Xero must be connected to your TrustPager workspace. Head to https://app.trustpager.com/account/integrations and connect Xero if you have not done so already.
- You will need your
integration_id— copy it from the Xero tile on the integrations page after connecting.
How to run a query
Send a POST request to the TrustPager API:
POST https://app.trustpager.com/api/integrations/query
Authorization: Bearer <your_api_key>
Content-Type: application/json
{
"query_type": "xero_contacts",
"integration_id": "<your_integration_id>",
"params": {}
}
Your API key is available at https://app.trustpager.com/account/api. If you are using the TrustPager MCP server, call the query_integration tool with the same fields.
Available query types
xero_contacts
Returns your full Xero contact list — customers and suppliers.
No required params. Optionally pass { "search": "acme" } to filter by name.
xero_contact_detail
Returns full detail for a single Xero contact including addresses, phone numbers, and account details.
Required: contact_id — the Xero ContactID (UUID).
xero_invoices
Returns all invoices across your Xero organisation. Supports filtering by status, date range, and contact.
Optional params: status (e.g. AUTHORISED, PAID), from_date, to_date, contact_id.
xero_invoices_by_contact
Returns invoices for a specific Xero contact only.
Required: contact_id. Optional: status, from_date, to_date.
xero_accounts
Returns your Xero chart of accounts — account codes, types, and balances.
No required params.
xero_tax_rates
Returns all tax rates configured in Xero.
No required params.
xero_profit_and_loss
Returns the Profit & Loss report for a date range.
Optional params: from_date or fromDate, to_date or toDate, periods, timeframe (MONTH / QUARTER / YEAR), tracking_category_id, tracking_option_id, standard_layout, payments_only. Both snake_case and camelCase are accepted.
xero_balance_sheet
Returns the Balance Sheet report as at a given date.
Optional params: date (YYYY-MM-DD, defaults to today), periods, timeframe, tracking_option_id_1, tracking_option_id_2, standard_layout, payments_only. Both snake_case and camelCase are accepted.
xero_aged_receivables_summary
Returns outstanding receivables (money owed to you) bucketed by how overdue each invoice is — across all contacts.
Response shape: { as_at, totals: { total, current, days_1_30, days_31_60, days_61_90, days_90_plus }, contacts: [...] }. Contacts are sorted by total outstanding, largest first.
Optional param: date (YYYY-MM-DD). Defaults to today.
xero_aged_payables_summary
Same as above but for payables — money your organisation owes to suppliers.
Optional param: date (YYYY-MM-DD). Defaults to today.
xero_aged_receivables
Returns the detailed Xero aged receivables report for a specific contact.
Required: contact_id (Xero ContactID UUID). Optional: date, from_date, to_date, periods, timeframe.
If you need a summary across all contacts, use xero_aged_receivables_summary instead.
xero_aged_payables
Returns the detailed Xero aged payables report for a specific contact.
Required: contact_id (Xero ContactID UUID). Optional: date, from_date, to_date, periods, timeframe.
If you need a summary across all contacts, use xero_aged_payables_summary instead.
Finding a Xero ContactID
The Xero ContactID is a UUID like 3e776c4b-ea9e-4bb1-9bc9-f2c24f5e4c3a. The quickest way to find it is to run xero_contacts first — each record in the response includes a ContactID field.
Troubleshooting
- aged_receivables requires a contact_id — you called
xero_aged_receivableswithout acontact_id. Usexero_aged_receivables_summaryfor an across-the-board view, or pass a Xero ContactID. - P&L or Balance Sheet returns $0 — this usually means your Xero OAuth token was issued against a different Xero organisation (tenant). Reconnect Xero at https://app.trustpager.com/account/integrations and make sure you select the correct organisation during the OAuth flow.
- Date params being silently ignored — both
from_dateandfromDateare accepted. If you were using camelCase previously and values were being dropped, re-run your query — this has been fixed.