TrustPager Docs

← Help Center

Integrations

How to Create and Send Invoices via Xero

Create and send invoices with Xero connected: every invoice goes into Xero first, Send to Xero for older invoices, how the Xero contact is found, card payments, payment plans, repeat invoices and payment sync, and connecting several Xero organisations to one workspace.

When Xero is connected to your workspace, you can raise invoices directly from an opportunity and have the payment status on each product line update automatically as Xero processes them. You can also set up recurring invoices: these use Xero's native Repeating Invoice feature so Xero generates the next invoice automatically on your chosen schedule. This article covers both flows. For the underlying status concept and manual tracking (which works whether or not you use Xero), see https://www.trustpager.com/help-center/track-payment-status.

Every invoice goes into Xero first

With Xero connected, every TrustPager invoice is put into Xero before it is emailed, however it is sent: from the app, by the API or Claude, by an automation, a recurring invoice or a visit. Xero gives the invoice its number. The one exception is an invoice your customer already has (paid or emailed): it keeps its TrustPager number, for example TP-0003, so nothing they hold changes.

One switch controls this. Open https://app.trustpager.com/settings/invoices and find Put TrustPager invoices into Xero. It is on by default. Turn it off and TrustPager invoices stay in TrustPager only. Your workspace's AI or the API can also change it with update_crm_settings; see https://docs.trustpager.com/reference#invoices for the exact field name.

The Create invoice and Send invoice windows tell you when the invoice is going into Xero, so you always know before you press the button.

Send to Xero on an existing invoice

Any TrustPager invoice that is not in Xero yet shows a Send to Xero button on the invoice. If payments are already recorded on it, you choose the Xero bank account the money went into, and the payments are recorded in Xero too, so the invoice shows as paid there. A payment is never recorded twice.

How TrustPager finds the Xero contact

  1. It looks for the customer in Xero by email first, then by exact name.
  2. A business name match is reused.
  3. A person's name match is reused only when the email or phone agrees. Otherwise you are asked to pick the Xero contact on the opportunity's Xero card, so two different people with the same name are never mixed up.
  4. If the Xero contact is archived, the send stops with a clear message. Restore the contact in Xero, or pick another one, and try again.

The ABN rule. When Xero already has a contact with the same name, and both the account in TrustPager and the Xero contact have an ABN, the ABN decides. The same ABN means the same business, so the invoice goes to that contact. A different ABN means a different business that happens to share the name, so the send stops with a message showing the Xero contact's ABN. You can then correct the ABN (on the account in TrustPager, or in Xero), pick the right Xero contact on the opportunity's Xero card, or rename one of the two contacts in Xero.

When only one side has an ABN, the name rules above apply as before. A new Xero contact made by TrustPager now carries the account's ABN (the ABN field on the account in TrustPager), so later matches can use it.

If nobody on the record has an email address, the Send invoice window has an Another email option so you can type one in.

Connect more than one Xero organisation

If you run a group of companies, each with its own Xero, you can connect them all to one workspace. Open https://app.trustpager.com/settings/invoices, find the Xero tile and press Add another account to connect another company's Xero. Workspaces with one Xero see no change at all.

Once two or more are connected, the same page shows one block per company with three settings:

Choosing the company on an invoice

Customers are linked per company

A Xero contact exists only inside one company's Xero, so the same customer needs a contact in each company you bill them from. On a customer's page (Companies), the Invoices card shows Billed in <company> as for each connected company, each with Link contact, Change and Unlink.

After the invoice is made

Payments, PDFs, reminders and syncs all follow the company each invoice was made in, so nothing needs choosing twice.

Create and send from the Invoice Builder

In a workspace with Xero connected, the Invoice Builder is the main way to invoice. Start from an opportunity (it must have a contact), pick a design or the standard invoice page, and the builder opens. See Design Invoices and Set Up Invoice Settings for the builder itself.

Open the design's Settings tab, then Preferences, and set How customers pay to Xero Invoice. (With Xero connected and no card payments set up in TrustPager, it is already the default.) A Xero Invoice is the designed email only, with no web page. The pay button opens Xero's own pay page, and Xero's PDF is attached by default.

  1. Press the create button. One window opens for the invoice and the email.
  2. Choose the Tax rate (from Xero). It lists your Xero revenue tax rates, for example GST on Income 10% or GST Free. GST is calculated at that rate.
  3. Choose Prices: exclude or include tax.
  4. Choose the Xero account. This is the revenue account every line posts to. It starts on 200 Sales.
  5. Choose the Status: Open (awaiting approval in Xero), approved, or Draft.
  6. Set the due date. The buttons under it set payment terms quickly: On receipt, 7, 14, 21, 30, 45 or 60 days.
  7. In the Email it section, check Sends to (from the opportunity's contact, with a Change link), Copy to (remembered for next time) and Subject (placeholders like {{invoice.number}} work). Attach the PDF is on by default.
  8. Press the button. TrustPager puts the invoice into Xero, Xero gives it its number, and the invoice is emailed. Choose Draft to create it without emailing.

The customer gets your designed email with a Pay by card button, and the line under it reads Pay via Xero. If Xero refuses the invoice, nothing is created and the reason is shown.

Create Invoice on https://app.trustpager.com/operations/invoices and Send Invoice on an opportunity both open the Invoice Builder, which makes the invoice in Xero too. The old Xero window is still on the opportunity's Actions menu as Xero Invoice, and Xero repeating invoices as Xero Repeating Invoice, both tagged Legacy. The old automation steps (Create Xero Invoice, Create Xero Contact & Invoice, Create Xero Repeating Invoice) keep working and carry the Legacy tag too. Invoices typed straight into Xero sync in as they always have and show under the Legacy invoices. If you write your own message when sending, the design stays and your words go in its message section.

Repeat invoices made from the Invoice Builder work the same way: each invoice the series makes goes to Xero before it is emailed. They also get an optional name and an Email each invoice automatically switch. (The Xero Repeating Invoice option further down is a separate method, run by Xero.)

Card payments and payment plans

A Xero Invoice is paid on Xero's own pay page, and Xero records the payment. If you want card checkout and payment plans through TrustPager, set How customers pay to TrustPager Invoice on the design (it reads TrustPager & Stripe Invoice once card payments are connected). The invoice still goes into Xero, and payments are recorded in Xero against it automatically.

  1. Connect card payments at https://app.trustpager.com/settings/invoices.
  2. On the same page, in the Xero card, choose Record card payments into. Pick the Xero bank account your card payouts land in, so payments match your bank feed.

Until a bank account is chosen, TrustPager card payments cannot be recorded in Xero. The most instalments allowed per invoice is set on the same page.

The old setting "TrustPager invoices for payment plans (Xero workspaces)" and the "TrustPager invoice (payment plan)" option, which kept an invoice out of Xero, have been retired. Invoices made on an invoice design can now be Xero invoices with payment plans.

Follow Up Emails

You can switch on an Overdue reminder and a Payment receipt in the design's Settings tab, under Follow Up Emails. They are sent automatically in the same design. Reminders copy the same people and attach the PDF. Receipts also go out when a Xero Invoice is paid on Xero's page. See Design Invoices and Set Up Invoice Settings.

Automations that create Xero invoices

Using Claude or the API

create_invoice numbers the invoice, works out GST from your Invoice Settings and uses your default design (template_id picks another, none means no design). send_invoice takes a subject, an HTML message and cc people. Recurring invoices take a page design and a GST mode. With several Xero organisations connected, create_invoice, create_recurring_invoice and update_invoice_template can name the company, update_xero_organisation sets a company's bank account, sales account code and default, and list_integrations shows each Xero connection's settings. See https://docs.trustpager.com/reference#invoices for exact field names.

Prerequisites

Legacy: the Xero invoice window

The steps below use the old Xero invoice window, now Xero Invoice (tagged Legacy) on the opportunity's Actions menu. It still works as it always has. For new invoices use Send Invoice, described above.

  1. Open the opportunity. The Invoices section sits just below the Products card.
  2. Click Actions → Xero Invoice (tagged Legacy). The Create Invoice modal opens.
  3. Choose the Invoice Portion at the top:
    • Full Payment: one invoice for the complete amount.
    • Deposit: an upfront portion based on each product's deposit percentage.
    • Final Balance: the remaining amount after a deposit has been raised.
    • Recurring: sets up a repeating schedule instead of a one-off invoice. See Recurring Invoices below.
  4. Review the line items. Tick or untick products to choose which go on this invoice, and add any custom line items you need (see below).
  5. Set the due date, Xero account, tax rate, and reference. Optionally enable email to the contact.
  6. Click Create Invoice. The invoice is created in Xero and appears in the Invoices section on the opportunity.

Smart Line-Item Defaults

The modal pre-selects which line items should go on this invoice based on the portion you picked and each product's current payment status:

The subtotal and total update live as you tick and untick items.

Adding Custom Line Items

Beneath the products table, an Add custom line button lets you add manual line items that aren't tied to any product on the opportunity, useful for one-off charges, adjustments, or anything not already tracked as a product. Each custom line has its own description, quantity, unit price, and an optional percentage discount.

Custom line items work on every invoice portion, Full Payment, Deposit, Final Balance, and Recurring, and sit alongside any selected products. They're included in the invoice subtotal and total just like product lines.

Recurring Invoices

Selecting Recurring as the invoice portion works differently to the one-off options above. Instead of sending a single invoice, TrustPager creates a Xero Repeating Invoice: a template in Xero that Xero uses to automatically generate and send invoices on your chosen schedule. TrustPager doesn't generate the individual invoices itself; Xero owns the cycle entirely.

You can also jump straight into this mode from the opportunity: the Xero Repeating Invoice action (tagged Legacy) (in the opportunity's Actions menu) opens the same Create Invoice modal already switched to Recurring, for any workspace with Xero connected.

Setting up a recurring invoice

  1. Click Actions → Xero Invoice and choose Recurring at the top (or use Actions → Xero Repeating Invoice to open straight into this mode). The modal layout changes: the due date and status grid are replaced by the schedule block, and the standard email composer is replaced by a two-button email picker.
  2. Select the line items you want on the recurring schedule. By default all non-Usage-Based products auto-check. Usage-Based products are excluded from auto-select but can be manually checked, though they're typically billed separately. You can also add custom line items here, the same as on a one-off invoice.
  3. Configure the schedule:
    • Weekly: Xero generates one invoice per week.
    • Monthly: Xero generates one invoice per month.
    • Yearly: TrustPager converts this to a monthly schedule repeating 12 times, since Xero's API only supports Weekly and Monthly natively.
  4. Set First invoice on to the date you want the first invoice to generate. This can be today or any future date, it no longer defaults silently to a full period from now.
  5. Set Ends to control how long the schedule runs:
    • Never: the schedule keeps generating invoices indefinitely, until you stop it in Xero.
    • On a date: pick an end date; no further invoices generate after it.
  6. Set the Xero account, tax rate, and reference as usual.
  7. Choose your email behaviour:
    • Auto-email each invoice: Xero emails the contact automatically when each invoice generates.
    • Don't auto-email: Xero does not email the contact.
  8. Click Create Repeating Invoice. The first invoice generates on the date you set in First invoice on.

How it works in Xero

TrustPager creates a single Repeating Invoice template in Xero. From that point, Xero takes over: it generates each individual invoice on schedule and handles all delivery. You can view and manage the repeating invoice in Xero at any time. If you need to stop the recurring cycle, do so directly in Xero.

Syncing Payment Status from Xero

After sending an invoice, click Actions → Sync Invoices any time to pull the latest from Xero.

Viewing and Editing an Invoice

Click any invoice card in the Invoices section to open it. Editable fields (status, due date, reference) write back to Xero. Locked Xero statuses (PAID, VOIDED, DELETED) appear read-only. The portion label (Full Payment / Deposit / Final Balance / Recurring) can be adjusted locally, it's metadata for display only, not sent to Xero.

If the invoice is in SUBMITTED or AUTHORISED state, a Send Invoice button appears to email the PDF to the contact via Xero.

Actions column

Each invoice card shows an Actions column with options based on the invoice's current state:

Mark as Paid

Use this to record a payment without leaving TrustPager. Click Mark as Paid on the invoice card. A confirmation dialog opens with two fields:

Click Record $<amount> to commit. Once recorded:

Individual product line payment statuses catch up on the next invoice sync, not instantly from this button. Run Actions → Sync Invoices if you need them to update right away.

Troubleshooting

No Actions → Xero Invoice item. Either Xero isn't connected (check https://app.trustpager.com/auto/integrations), or your role lacks invoices:write (check https://app.trustpager.com/settings/permissions).

The Invoices section shows no Xero contact. Click Add Contact → New Contact to create a Xero contact from the opportunity's linked account, or Link Existing to attach one that already exists in Xero.

Sync didn't update status to Paid. Make sure the invoice is marked PAID in Xero (not just AUTHORISED), then hit Sync Invoices again.

Sync filters out invoices I just created in Xero directly. Invoices raised in Xero (outside TrustPager) don't have the product mapping TrustPager needs for per-product status promotion. They still appear in the Invoices section, but payment status sync skips them. Set the status manually via the Edit Deal Product modal, or create the invoice from TrustPager next time.

I want the first invoice to go out today, not next period. Set First invoice on to today's date when configuring the schedule. The first invoice is no longer forced to wait a full period after setup, you're in full control of when it starts.

Mark as Paid fails with an error message. TrustPager shows Xero's own rejection message when one is available, otherwise the generic message "Failed to record payment." Common causes:

Product lines still show Invoiced after marking paid. This is expected, product line statuses update on the next sync, not instantly. Click Actions → Sync Invoices to pull the latest from Xero now.

Mark as Paid button is not visible. The button only appears on invoices in AUTHORISED or SUBMITTED state. Invoices that are already PAID, VOIDED, or DELETED will not show the option.

I don't use Xero, can I still track payment status? Yes. See https://www.trustpager.com/help-center/track-payment-status for the manual flow.

← Back to Help Center Open on trustpager.com ↗