About Services Tools Blog Contact us

Card Hold Statement Cleanup

Finds card payment holds that already have a matching release and are unmatched in Xero, then deletes only those complete pairs from the statement screen.

  • Browser & Desktop Automation
  • Professional services
  • Tool
  • Productised
  • Local/private
  • 2026

The problem

A PayPal feed fills with holds and their releases, and each pair cancels out. Xero's connection cannot delete statement lines, so someone has to clear them by hand on the statement screen. That is slow, and a wrong click can remove a hold that is still open.

What it does

The script reads the statement lines loaded in Safari and pairs each hold with a release of the same amount and reference. It ignores holds that are still open or already matched. A test run lists the pairs. A live run ticks those rows, presses delete and confirms the prompt.

Outcomes

  • Complete hold and release pairs are listed before anything is deleted.
  • Open holds stay on the statement.
  • A live run removes only the pairs on the loaded page.

Simplified mockup

Interactive preview with sample data. Nothing is sent to a server.

Statement lines

Loaded
4
Complete pair
1
Still open
1
Reconciled
1

Yellow rows are a hold and its reversal: same reference, same amount, both unreconciled. The blue row is still waiting for a reversal. The grey row is already reconciled. Apply stays off until someone confirms on the live page.

Harbour card feed · GBP
DateDetailReferenceAmountStatus
2 Oct 2026 Authorisation hold R441 £64.20 spent Unreconciled
3 Oct 2026 Reversal of R441 R441 £64.20 in Unreconciled
6 Oct 2026 Authorisation hold R508 £22.00 spent Unreconciled
28 Sep 2026 Authorisation hold R390 £15.40 spent Reconciled
Dry run only. Apply is not armed.

Pairing

A pair needs the same reference and the same amount, and both lines still unreconciled. Anything else is left alone.

Leave these
ReferenceAmountReason
R508£22.00No reversal yet
R390£15.40Already reconciled

Apply

A live delete needs an explicit confirm. This preview will not tick the rows, press delete, or confirm the dialog.

On a real run, apply ticks only the complete pair on the loaded page, then asks before anything is removed.

Kept open
R508
£22.00 with no reversal
Kept reconciled
R390
£15.40 already cleared

How it works

  1. Open the Xero statement page for one account in Safari.
  2. Read the lines loaded on the page.
  3. Pair each hold with a release of the same amount and reference.
  4. Leave unmatched and already matched lines alone.
  5. Print the pairs on a test run, or delete only those rows on a live run.

Pipeline

flowchart LR
  A[Statement] --> B[ReadLines]
  B --> C[Pair]
  C --> D[IgnoreOpen]
  C --> E[DryRun]
  E --> F[Apply]
  F --> G[Deleted]