Register your interest: Tag @Cody, get an agent
BlogEngineering

Connecting Xero to Stripe: the invoice-led direction

Raising invoices in Xero and collecting through Stripe is the reverse of the usual flow. Payment links, part payments, fees against an invoice, and what reconciles.

Isha MagguIsha Maggu11 min read

Summarize with AI

Connecting Xero to Stripe: the invoice-led direction
On this page

Most writing about Stripe and accounting assumes a checkout: a customer pays, and the record follows into the books. Invoice-led businesses run the other way round — the invoice exists first, raised in Xero, and Stripe is how it gets paid. That reversal changes almost every detail.

The questions become how the payment attaches to the right invoice, what happens when somebody pays part of it, and where the processing fee goes when the invoice was raised for the full amount. None of those arise in a checkout business, and all of them decide whether receivables stay accurate.

What we'll cover

Why the direction changes the problem

The invoice is the origin, so the accounting record exists before any money moves.

Receivables are the live number, not revenue, and keeping them accurate is the point.

Matching is required. A payment has to find its invoice, which a checkout business never has to do.

Amounts may not match, through part payments, credit notes, currency, or a customer paying two invoices at once.

The fee is a new problem. An invoice raised for a sum, paid in full, settles for less — and the difference has to go somewhere without appearing as a shortfall.

Timing spreads out. An invoice may be paid weeks after it is raised, and across a period boundary routinely.

Getting the payment onto the right invoice

Use a payment link tied to the invoice, which is the reliable mechanism and removes most matching problems at source.

Carry the invoice reference through the payment metadata, so the match is a lookup rather than a guess.

Do not match on amount alone. Two customers owing the same round figure is common enough to cause real errors.

Handle the customer paying several invoices in one payment, which needs allocation across them rather than matching to one.

Flag the unmatched into a small queue rather than allocating them to a suspense account and forgetting.

Never guess. A misallocated payment produces a customer chased for an invoice they paid, which costs more than the reconciliation it saved.

Fees against an invoice

The invoice is raised gross and the money arrives net, which is the core of it.

Record the fee as an expense, not as a discount or a partial payment, or the invoice never marks as fully paid.

Do not reduce the invoice to match the received amount, which is the shortcut that corrupts receivables.

Bank rules or a fee account are the two common approaches, and the choice belongs to your accountant.

Surcharging the customer is a separate decision with legal constraints in several jurisdictions, and it is not a workaround for the accounting.

Report the effective fee rate against invoiced totals monthly, which is a number invoice-led businesses rarely look at and frequently find higher than expected.

Building it with CodeWords

CodeWords connects to more than 3,000 integrations, so Xero, Stripe and your notifications can meet in one automation.

  1. Open CodeWords and start a new automation.
  2. Describe what should happen in plain language to Cody, the automation builder: how payments match invoices, how fees are recorded, and what is escalated.
  3. Authorize the connections — Xero and Stripe.
  4. Describe the exceptions: a part payment, an overpayment, an unmatched payment, a refund against a paid invoice.
  5. Run it against a closed month and reconcile receivables before running it forward.

You describe the outcome; Cody builds it, connects it, and deploys it. The free plan covers light use, with Pro at $39 per month and Business at $100 per month as usage grows; details are on the pricing page.

Part payments and overpayments

A part payment leaves the invoice open for the balance, which is ordinary and needs supporting explicitly.

Decide the fee treatment on a part payment, since apportioning it is a choice rather than an obvious answer.

Overpayments need a home — a credit on the account, or a refund — and leaving them unallocated distorts receivables.

A payment for an invoice already settled usually means a duplicate, and it should reach a person rather than being recorded.

Refunds against a paid invoice need a credit note, not a deletion, so the history stays intact.

Small differences from currency conversion need a rounding rule, applied consistently, or invoices sit open for trivial amounts forever.

Payouts still batch

Stripe pays out in batches regardless of how the charges were originated, which invoice-led businesses frequently forget.

One payout covers several invoices, so the bank line does not correspond to any single invoice.

Use a clearing account for funds in transit, which is what makes the bank reconciliation work.

Reconcile the payout as a unit, with the invoice payments allocated underneath it.

Period boundaries bite. An invoice paid on the last day of a month settles in the next one, and both need representing.

The gross-to-net difference on each payout should equal the fees you recorded, which is a useful check that nothing is missing.

Chasing what is unpaid

Receivables accuracy is the point, and chasing on wrong data damages customer relationships quickly.

Never chase an invoice with an unmatched payment against it, which is the most common cause of an angry email.

Automate the reminder, not the judgement. The decision to escalate a long-overdue account belongs to a person who knows the relationship.

Make paying trivial from the reminder, with the payment link in it.

Stop on partial payment and re-issue for the balance rather than continuing to chase the original figure.

Report ageing properly, and separate disputed invoices from merely late ones, since they need different handling entirely.

Getting paid faster, which is the actual objective

Reconciliation accuracy is the mechanism. The reason an invoice-led business builds this is cash arriving sooner, and a few things move that number more than the accounting does.

Put the payment link in the invoice, not in a separate email, since every additional step loses some proportion of payers.

Invoice immediately on delivery rather than in a monthly batch, which for many businesses is the single largest improvement available.

Send to the person who pays, not only to the person who bought, which is frequently a different mailbox entirely.

State the terms on the invoice in plain words, with the due date rather than a period, since "30 days" is calculated differently by different people.

Remind before the due date, not only after, which converts a proportion who simply had not noticed.

Offer the method they prefer. Some customers will never pay a card link and need a bank transfer reference, and insisting costs more in delay than the fee saves.

Making it survive

Make payment recording idempotent on the payment identifier, since a duplicated receipt is a real problem.

Handle Xero's rate limits, which are strict, particularly during a backfill.

Never modify a reconciled transaction, and post corrections as new entries.

Alert on anything unmatched rather than letting it accumulate in a suspense account.

Report the outcome: payments received, matched, part matched, unmatched, and the receivables position.

Limits worth knowing about

Xero's API is rate limited per tenant, and bulk operations are slow.

Multi-currency invoicing adds conversion differences that need a consistent rounding treatment.

Editing reconciled transactions is restricted, deliberately.

Stripe's fee structure varies by method and by region, so an assumed rate drifts from actual.

This is bookkeeping, not advice, and your accountant's instruction governs — particularly around fee treatment and surcharging, which has legal constraints in several places.

What to build first

Payment links tied to specific invoices, with the invoice reference in the payment metadata. It turns matching from a guessing exercise into a lookup, which removes the failure that costs most — a misallocated payment leading to a customer being chased for an invoice they have already paid.

Two habits make the difference. Record the processing fee as an expense rather than reducing the invoice, since reducing it corrupts receivables and leaves invoices that can never mark as fully paid. And never chase an invoice with an unmatched payment sitting against it, because that single rule prevents the most damaging error this system can make.

Frequently asked questions

How is invoice-led different from checkout Stripe accounting?

The invoice exists first, so the accounting record precedes the money. That makes matching a payment to its invoice necessary, makes receivables the live number, and creates the fee problem — an invoice raised gross settles net.

How should payments be matched to invoices?

Through a payment link tied to the invoice, with the reference carried in the payment metadata so matching is a lookup. Never match on amount alone — two customers owing the same round figure is common.

Where does the processing fee go?

Recorded as an expense, not as a discount or partial payment. Reducing the invoice to match the amount received corrupts receivables and leaves invoices that never mark as fully paid.

What about part payments?

The invoice stays open for the balance, which needs supporting explicitly, and the fee treatment on a partial payment is a decision rather than an obvious answer. Re-issue reminders for the balance rather than the original figure.

What should happen to an unmatched payment?

It goes to a small queue for a person, not into a suspense account. A misallocated payment produces a customer chased for an invoice they paid, which costs more than the reconciliation it saved.

Do payouts still batch for invoice payments?

Yes. One payout covers several invoice payments, so the bank line matches no single invoice. A clearing account for funds in transit is what makes the reconciliation work.

Can I surcharge customers for the card fee?

It is a separate decision with legal constraints in several jurisdictions, and it is not a workaround for the accounting treatment. Worth checking your position rather than assuming.

What is the most damaging error in this system?

Chasing an invoice that has an unmatched payment against it. It is the fastest way to damage a customer relationship, and one rule — never chase where a payment is unmatched — prevents it.

What most improves the time to get paid?

Invoicing immediately on delivery rather than in a monthly batch, putting the payment link in the invoice itself, sending it to the person who actually pays, and reminding before the due date rather than only after.

Should I require card payment?

No. Some customers will never pay a card link and need a bank transfer reference, and insisting costs more in collection delay than the processing fee saves.

Get started today

Your first workflow is free to build.

Describe what you need. Cody handles the build, the connections, and the deployment.