Email credit transaction alerts to billing lead
When money is received into a Xero bank account, your billing lead gets an email right away with the payee, amount, account, date and reference.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/email-credit-transaction-alerts-to-billing-lead-immediately/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Finance · Banking operations
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/email-credit-transaction-alerts-to-billing-lead-immediately
Set it up with the CLI
- Add it. Copies the folder into
zaps/email-credit-transaction-alerts-to-billing-lead-immediately/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/email-credit-transaction-alerts-to-billing-lead-immediately - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy email-credit-transaction-alerts-to-billing-lead-immediately - Check it. Its recent runs, with status and errors.
npx zap-pack logs email-credit-transaction-alerts-to-billing-lead-immediately
zaps/email-credit-transaction-alerts-to-billing-lead-immediately/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 1 to fill in
- connections/xero.tsThe
xeroaccount it uses - triggers/bank-transaction.tsWhat starts it:
xerobank_transaction - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: Xero, New Bank Transaction (
xero,bank_transaction), fires for each new bank transaction in the chosen organization. - Filter (code): continues only for credits (Xero types starting with
RECEIVE:RECEIVE,RECEIVE-OVERPAYMENT,RECEIVE-PREPAYMENT,RECEIVE-TRANSFER) whose status is posted (AUTHORISED) and whoseTotalis greater thanMIN_CREDIT_AMOUNT. Anything else returnsskippedwith a reason and sends nothing. - Email by Zapier sends one email to the billing lead. The subject names the amount and bank account (
Credit received: 1250.00 USD into Business Checking). The body lists payee, amount, bank account and code, date, reference, line-item descriptions, type, reconciled flag and transaction ID.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
REPLACE_BILLING_LEAD_EMAIL |
The billing lead's email address, or a shared inbox, that gets each credit alert. Up to 5 comma-separated addresses |
Also ask:
- Which Xero organization should be watched? The trigger needs one. If they have no Xero connection, have them connect one first.
Review the defaults with them:
MIN_CREDIT_AMOUNTinworkflow.ts: alert only when the total is greater than this. It is0by default; raise it to skip small credits.POSTED_STATUSESinworkflow.ts: the Xero statuses treated as posted. It is["AUTHORISED"]by default.FROM_NAMEinconfig.ts: the sender's display name. It is"Xero credit alerts"by default.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/email-credit-transaction-alerts-to-billing-lead-immediately, replace each REPLACE_… value as this file says, then run npx zap-pack deploy email-credit-transaction-alerts-to-billing-lead-immediately, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
xero(the trigger's account only) to the user's Xero connection for the organization they chose. The workflow itself names no connection. Email by Zapier needs none. - Source: publish
workflow.tsandconfig.ts, withREPLACE_BILLING_LEAD_EMAILreplaced by the user's answer.triggers/bank-transaction.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. Set the trigger'sorganizationto the Xero organization the user chose, resolved from that field's choices (get_trigger_field_choices, fieldorganization) with the user's Xero connection. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections, and sample the trigger with the chosen organization (the
bank_transactionread action), before the first test run. Check thatType,Status,Total,Contact.Name,BankAccount.NameandLineItemsarrive as the code expects, and fix any key inworkflow.tsthat doesn't match.
Test it
Run it once as a draft test with the billing lead's address set to an inbox the user controls. Use this sample input:
{
"id": "txn-0001",
"BankTransactionID": "txn-0001",
"Type": "RECEIVE",
"Status": "AUTHORISED",
"Total": 1250,
"SubTotal": 1250,
"TotalTax": 0,
"CurrencyCode": "USD",
"Reference": "[install-test] INV-1042",
"DateString": "2026-10-29T00:00:00",
"IsReconciled": false,
"Contact": { "Name": "[install-test] Acme Supplies" },
"BankAccount": { "Name": "Business Checking", "Code": "090" },
"LineItems": [
{ "Description": "[install-test] Payment for INV-1042", "LineAmount": 1250 }
]
}
Check that one email arrives with the subject Credit received: 1250.00 USD into Business Checking and every field in the body. Then run it again with "Type": "SPEND" and check that the run returns skipped: true, reason: "not-a-credit" and sends no email. If run-status tools aren't available, check the result in the inbox directly.
Then publish, confirm the trigger is active, and ask the user to delete the test email. The user deletes test data, not the agent.
Notes
- Alerts are not repeated for one transaction: the Xero trigger fires once per new transaction ID. The workflow keeps no record of past alerts and does no lookup.
- Xero's trigger fires when a transaction is created. One created as a draft and authorised later is skipped at creation and does not fire again.
- Email by Zapier sends from a zapiermail.com address and is limited to 10 emails an hour on paid plans (5 a day on Free). Switch to Gmail or Outlook if heavy days hit the limit.
LineItemsmay arrive as a list of objects or as text. The code accepts both and falls back to(no description).- To change who receives alerts, change
REPLACE_BILLING_LEAD_EMAIL. To post to a team channel or create a reconciliation task too, add a step after the email. - Never commit a real email address to the repo.