Skip to main content
Xero → SegmentIntegration guide

Connecting Xero to Segment

Xero holds the invoice and the reconciliation, which makes it the definitive revenue record for many service and trade businesses. Segment is a customer data platform rather than an ad network, so sending to it is not about matching a conversion — it is about putting one clean event where every other destination can read it. The join between them succeeds or fails on one thing: whether the userId and anonymousId reaches the Xero invoice before the conversion happens, because Segment can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Xero via Segment: invoice payments as one clean revenue event

Use Segment when Xero is one of several billing sources: map the Xero contact ID to your userId or a group account ID, then send a track call on payment, not issue, with revenue, invoice currency and messageId set to the Xero payment ID. Send credit notes as refund events, and filter out supplier bills from the invoices endpoint.

Segment fits when Xero is one of several billing sources and downstream tools should see one revenue event, whether the customer paid by card on your site or by bank transfer against a Xero invoice. Xero's webhooks or API supply the payment; Segment's job is to forward it with a consistent name and a consistent identity.

Identity first: Xero contacts are companies or people entered by staff, with no userId. Keep a mapping from Xero contact ID to your userId, or to an account ID sent with a group call, and only send an event once the mapping exists. Send the track call on payment, not issue, with revenue, currency and messageId set to the Xero payment ID. Click IDs were captured on the lead and attached at identify; do not bolt them onto the Xero event.

Credit notes should flow as a separate refund event so downstream tools can reverse revenue. Multi-currency organizations should send the invoice currency, not the converted base amount, unless every destination expects one currency. Filter out bills at the source: Xero's invoices endpoint returns both sales invoices and supplier bills, and one supplier bill forwarded once reaches every destination.

Xero → Segment · what breaks

Why this join usually fails — Xero → Segment

  1. 01

    The userId and anonymousId never reaches Xero

    Like any accounting system, Xero has no marketing context of its own. The identifier must be written onto the contact record by whatever creates it, and in many businesses that is a manual step which will be applied inconsistently unless it is automated.

  2. 02

    Payment terms separating the sale from the money

    An invoice issued in March and paid in May is one sale and two dates. Which one the conversion uses has to be a decision rather than an accident.

  3. 03

    One bad event multiplied across every destination

    Segment's value is fan-out, which is also its risk. An inconsistent identity or a duplicated event does not break one report — it breaks every connected tool simultaneously, and tracing it back is harder than debugging a direct integration.

  4. 04

    Nothing reconciles afterwards

    Segment's debugger shows events arriving and which destinations accepted them. Arriving is not the test — check a destination you care about and confirm the event landed there with the identity intact, then reconcile against your own records.

Xero → Segment · the fix

What working looks like — Xero → Segment

  • The userId and anonymousId on every invoice

  • Conversions arriving in Segment

    Events land in Segment and forward to every connected destination, warehouse included, on one shared definition.

  • Reconciled against the source

Xero → Segment · architecture

How Xero and Segment actually connect

  1. 1

    Xero holds the truth

    Xero's bank reconciliation is what makes it unusually trustworthy as a source of truth — an invoice marked paid and reconciled is money that actually arrived, which is a stronger guarantee than most systems offer.

  2. 2

    Segment needs a click to match

    Segment needs a consistent identity model — the same userId everywhere, an alias when an anonymous visitor becomes known, and event names that follow one spec. Feeding it inconsistent identities pushes the mess to every connected destination at once.

  3. 3

    The identifier is the bridge

    The userId and anonymousId, captured at the visit and carried into the Xero invoice.

  4. 4

    The event source decides reliability

    Fire on payment, not on invoice issue. Trade businesses on thirty-day terms will otherwise report revenue a month before it exists.

  5. 5

    Deduplication at the destination

    Segment deduplicates on messageId within a window. Because it fans out to many destinations, a duplicate here becomes a duplicate everywhere, which makes idempotent messageIds more important than in any single-destination integration.

Xero → Segment · normal or broken

Working vs. broken, side by side — Xero → Segment

Normal, not a fault

  • The userId and anonymousId present on the invoice

  • Sent from the Xero invoice payment webhook

  • Deduplicated correctly

    Segment deduplicates on messageId within a window. Because it fans out to many destinations, a duplicate here becomes a duplicate everywhere, which makes idempotent messageIds more important than in any single-destination integration.

  • Reconciles with the source

Actually broken

  • The userId and anonymousId missing on most records

    Like any accounting system, Xero has no marketing context of its own. The identifier must be written onto the contact record by whatever creates it, and in many businesses that is a manual step which will be applied inconsistently unless it is automated.

  • Sent from the browser

    An invoice issued in March and paid in May is one sale and two dates. Which one the conversion uses has to be a decision rather than an accident.

  • Counted twice, or not at all

    Segment's value is fan-out, which is also its risk. An inconsistent identity or a duplicated event does not break one report — it breaks every connected tool simultaneously, and tracing it back is harder than debugging a direct integration.

  • Nobody has reconciled it

Xero → Segment · diagnose

Diagnostic order — Xero → Segment

  1. 01

    Count invoices carrying the userId and anonymousId

  2. 02

    Follow one real conversion end to end

  3. 03

    Check whether the conversion fires on issue or on payment

    On terms-based businesses this single choice moves the numbers by a full billing cycle.

  4. 04

    Check identity resolution before checking anything downstream

    If anonymousId is never aliased to userId, every destination sees two people where there is one, and no downstream fix helps.

  5. 05

    Read the match rate, not the success message

    Segment's debugger shows events arriving and which destinations accepted them. Arriving is not the test — check a destination you care about and confirm the event landed there with the identity intact, then reconcile against your own records.

Xero → Segment · prove

How it gets proven — Xero → Segment

Source of truth

Xero's paid invoices by payment date, reconciled against the bank feed.

  • The userId and anonymousId confirmed present on a live invoice.
  • An anonymous session confirmed aliased to a known user, with the event visible in at least one downstream destination.
  • A paid invoice confirmed reconciled against the bank feed before being counted.

Xero → Segment · free audit

What we check in the free audit

  • Count invoices carrying the userId and anonymousId
  • Follow one real conversion end to end
  • Check whether the conversion fires on issue or on payment
  • Check identity resolution before checking anything downstream
  • Read the match rate, not the success message

Checked against

Xero's paid invoices by payment date, reconciled against the bank feed.

Get my free conversion tracking audit

Free30 minutesNo obligation

Xero → Segment · when not to buy

When you don't need this — Xero → Segment

  • Measure identifier coverage yourself first — pull your last hundred invoices and count how many carry the userId and anonymousId.
  • If your work is paid at point of sale with no invoicing, the accounting system is not where the conversion should come from.
  • If you send to one or two destinations, Segment is infrastructure you do not need — direct integrations are simpler and cheaper. It earns its place at genuine fan-out.

Xero → Segment · what we deliver

What gets built — Xero → Segment

  • Identifier capture into Xero

    Write the click identifier to a tracking category or a custom field on the Xero contact at creation, so subsequent invoices inherit the association.

  • Event source: the Xero invoice payment webhook

    Fire on payment, not on invoice issue. Trade businesses on thirty-day terms will otherwise report revenue a month before it exists.

  • Dispatch to Segment

    Server-side track and identify calls with a stable messageId, consistent userId, and the click identifier carried as a trait or property.

  • Reversals where they exist

    Credit notes reverse against the original invoice and should reduce the reported figure.

Written guarantee

95%+ tracking accuracy

Measured against Xero's paid invoices by payment date, reconciled against the bank feed.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Xero → Segment questions, answered

Check Segment's source catalog. Otherwise use Xero webhooks or the API with a Segment server library, mapping the Xero contact to your userId.

Free · 30 min

Get Xero and Segment joined properly

Free30 minutesNo obligation