Bank Sync Setup (Reverse Sync)
Bank Sync is a powerful feature that monitors your Xero bank accounts for incoming payments and automatically creates corresponding payments in Blesta.
Overview
What Bank Sync Does
- Polls your Xero bank accounts for RECEIVE transactions
- Matches transactions to Blesta clients
- Identifies invoices from payment references
- Creates payments in Blesta automatically
- Flags exceptions for manual review
When to Use Bank Sync
- You receive payments directly to your bank (bank transfers, BACS, direct deposits)
- Payments don't come through a Blesta payment gateway
- You want to automate payment reconciliation
Enabling Bank Sync
Step 1: Navigate to Bank Sync Settings
Go to Tools → Xero Sync → Bank Sync Settings
Step 2: Configure Settings
| Setting |
Description |
| Enable Bank Sync |
Master on/off switch |
| Start Date |
Only process transactions after this date |
| Invoice Reference Pattern |
Regex to extract invoice numbers |
Step 3: Save and Enable
- Configure settings
- Click Save
- Toggle Enable Bank Sync on
Invoice Reference Pattern
The pattern extracts invoice numbers from bank transaction references.
Default Pattern
/(?:INV[#-]?|Invoice[# ]?)?(\d+)/i
This matches:
INV1234 → Invoice 1234
INV-1234 → Invoice 1234
Invoice 1234 → Invoice 1234
1234 → Invoice 1234
Custom Patterns
If your Blesta invoice format is FX-{year}-{num}:
/FX-\d{4}-(\d+)/i
This matches:
FX-2024-00123 → Invoice 123
Suggested Pattern
The settings page shows a suggested pattern based on your Blesta invoice format setting.
Bank Accounts
Selecting Accounts to Monitor
- Go to Tools → Xero Sync → Bank Accounts
- Click Refresh from Xero to fetch your accounts
- Enable/disable accounts using the toggle
Which Accounts to Enable
Enable accounts where you receive customer payments:
- Main business bank account
- PayPal bank feed
- Stripe bank feed
Do NOT enable:
- Credit card accounts
- Expense accounts
- Internal transfer accounts
Processing Schedule
Automatic Processing
The cron task runs hourly when enabled:
- Go to Settings → Automation in Blesta
- Find "Process Xero Bank Transactions"
- Ensure it is Enabled
Manual Processing
Trigger processing immediately:
- Go to Bank Sync Settings
- Click Process Bank Sync Now
- Results are displayed on completion
How Matching Works
Step 1: Transaction Retrieved
Bank Sync fetches RECEIVE transactions from enabled accounts.
Step 2: Payee Matching
The transaction's Xero contact is matched to a Blesta client:
- Check existing payee mappings
- Try matching by email address
- If no match, create exception
Step 3: Invoice Matching
The payment reference is parsed to find an invoice:
- Apply reference pattern regex
- Look up invoice in Blesta
- Verify invoice belongs to matched client
- If no match, apply as credit or create exception
Step 4: Payment Creation
If all matches succeed:
- Payment created in Blesta
- Applied to matched invoice (if found)
- Transaction marked as synced
Statistics
The Bank Sync Settings page shows:
| Stat |
Description |
| Transactions Synced |
Successfully processed |
| Pending Exceptions |
Require manual review |
| Total Amount Synced |
Sum of synced payments |