Sync settled Braintree payments into Xero every night
Every night, yesterday's settled Braintree payments post to Xero as receive-money entries tagged with their transaction IDs so the books reconcile themselves.
Every night at 1am, sync the prior day's settled Braintree payments into Xero so the books reconcile against the payment gateway without manual entry. This is a deterministic one-to-one export: one settled Braintree charge in equals one receive-money bank transaction out, one Xero entry per Braintree transaction.
Trigger this on a cron schedule, nightly at 1am, scoped to the previous calendar day. Use Braintree Search Transactions to pull every transaction whose status is settled or submitted for settlement with a settlement or submission date that falls within the previous day. Page through the full Relay-style connection (advance by endCursor until hasNextPage is false) so no transaction is missed. Exclude every other status, especially pending authorizations, so charges that have not captured are never booked as revenue.
For each matching transaction, create a matching receive-money entry with Xero Create Bank Transactions (type receive money). Map the Braintree amount and currency to the Xero line total, use the Braintree customer name as the contact, and put the Braintree transaction ID into the reference field so each Xero entry ties back to its source payment. Braintree amounts are decimal strings in the transaction's currency and Xero money fields are decimals, so pass the amount straight through. Create exactly one Xero bank transaction per Braintree transaction.
Post every entry to a single configured Xero bank account. Because each entry carries its Braintree transaction ID in the reference field, the export can skip any transaction that already has a matching Xero entry, so re-running the same day never double-books.
Additional information
What does this prompt do?
- Each night, gathers every Braintree payment that settled the day before and creates a matching money-in entry in Xero.
- Copies the exact amount and currency across, and tags every Xero entry with its Braintree transaction ID so each line ties back to the original payment.
- Uses the customer's name as the Xero contact and creates one entry per payment, keeping a clean one-to-one record between the two systems.
- Skips pending authorizations so only real, settled revenue ever lands in your books.
What do I need to use this?
- A Braintree gateway account with your payment history.
- A Xero organization you can connect, with a bank account set up to receive the money-in entries.
- No developer setup or spreadsheets required.
How can I customize it?
- Change the run time (1am by default) or the day range it covers.
- Pick which Xero bank account the money-in entries post to.
- Adjust which payment statuses are included (settled and submitted-for-settlement by default).
Frequently asked questions
Will this create duplicate entries if it runs twice?
Does this book pending or authorized-only payments?
What happens with payments in different currencies?
Do I need to match payments to existing invoices?
Can I use QuickBooks instead of Xero?
Related templates
Stop hand-keying Braintree payments into Xero.
Let every settled payment flow into your books overnight, already reconciled and tagged to its source.