Daily FX exposure digest for open Xero invoices in Slack

Every weekday at 8am, see how exchange rate moves have changed what your unpaid foreign currency invoices are really worth.

Agentic Task
Open Exchange RatesXeroSlackFinanceAI ReportsNotifications & AlertsDaily Digests
PromptCreate

Every weekday at 8am, review my open foreign currency invoices in Xero and tell me how my FX exposure has shifted since each invoice was raised, then post the result to Slack.

Treat my Xero organisation's base currency as my home currency, and default to USD if you cannot determine it. Use the Xero List Invoices operation to pull accounts receivable invoices with status AUTHORISED that still have an amount outstanding, then keep only the ones whose currency code differs from my home currency. Filter server side with the where parameter where you can, and page through the full result set rather than stopping at the first page. Use the amount still due rather than the invoice total, so partly paid invoices are measured correctly. Xero returns dates in .NET format like /Date(1551830400000+0000)/, so parse each invoice date into a plain YYYY-MM-DD value before using it.

Get today's rates with the Open Exchange Rates Get Latest Rates operation, and the rate for each invoice date with Get Historical Rates. My plan is USD base only, so do not pass a base parameter: an unsupported base returns a 400 invalid_base error. Instead take the USD quotes and derive each cross rate by division. To convert an amount in currency C into my home currency H, multiply by the USD quote for H divided by the USD quote for C. Do not use the Convert Amount operation, which is Unlimited plan only, and do not use Get Time-Series, which is Enterprise only. Do the arithmetic in the workflow instead. Collect the distinct invoice dates first and make one historical call per date rather than one per invoice, because every call counts against my monthly quota. Note that historical values are the last rate published up to 23:59:59 UTC on the requested day.

For every invoice, compute the outstanding amount in my home currency at the invoice date rate and again at today's rate. The difference is the unrealised gain or loss. For a receivable, a foreign currency that has strengthened against my home currency since the invoice date is a gain, and one that has weakened is a loss. Compute the percentage change as well as the absolute change.

Only call out invoices that have moved more than 2 percent or more than 500 in my home currency, whichever is crossed first, so the digest stays short. Invoices below the threshold still count toward the totals, they just do not get their own line.

Post one message using the Slack Send a Message operation containing three sections. First, the invoices that crossed the threshold, ranked by the absolute size of the gain or loss, each showing the customer, invoice number, currency, amount outstanding, invoice date, the rate then versus the rate now, and the gain or loss in my home currency with a clear plus or minus sign. Second, subtotals of the swing grouped by currency. Third, the net swing across the whole open receivables book since invoice date, including the invoices below the threshold so the total is complete. Keep it scannable and lead with the numbers.

If no invoice crosses either threshold, stay silent apart from a single all clear line, for example: FX check, no material movement across 9 open foreign currency invoices. If I have no open foreign currency invoices at all, say that in one line instead.

What does this prompt do?

  • Each weekday morning it pulls every approved, unpaid invoice you have raised in a currency other than your home currency.
  • Compares today's exchange rate against the rate on the day each invoice was raised, so you can see the gain or loss that has quietly built up while the invoice sits open.
  • Ranks the biggest movers, subtotals the swing by currency, and gives you one net figure for the whole receivables book.
  • Stays quiet with a single all clear line on days when nothing has moved enough to be worth your attention.

What do I need to use this?

  • A Xero organisation that invoices customers in more than one currency
  • An Open Exchange Rates account (the free plan is enough)
  • A Slack workspace and the channel where your finance team should get the digest
  • Your home currency, which is normally the base currency your Xero organisation reports in

How can I customize it?

  • Change when it runs. Weekday mornings at 8am suits most finance teams, but month end only or every Monday works just as well.
  • Move the thresholds. The digest calls out anything that has moved more than 2 percent or more than 500 in your home currency, and you can tighten or loosen either number.
  • Narrow the scope. Limit it to particular currencies, your largest customers, or invoices above a certain value if your book is long.
  • Send it somewhere else, such as a private channel for the CFO instead of a shared finance channel.

FAQs

Does this work on the free Open Exchange Rates plan?
Yes. Free accounts quote every currency against the US dollar, so the workflow works out the pair rates itself by comparing the two dollar quotes. You do not need a paid plan for this digest.
Will this change anything in my Xero account?
No. It only reads your invoice list. Nothing is created, edited, or reconciled in Xero, so it is safe to run against your live organisation.
Why doesn't Xero already show me this?
Accounting systems record a currency gain or loss when an invoice is actually paid and reconciled. Until that happens, the drift on an invoice sitting open is invisible. This digest fills the gap between the day you invoice and the day you get paid.
What counts as a big enough move to get reported?
By default an invoice is called out if its value has moved more than 2 percent or more than 500 in your home currency, whichever happens first. Everything else is still counted in the totals, just not listed line by line.
What happens on a quiet day when rates barely moved?
You get a single all clear line confirming the book was checked and nothing crossed the threshold, so the digest never becomes noise you learn to ignore.
Can I use this for supplier bills as well as customer invoices?
Yes. It is set up for money owed to you, but the same approach works for what you owe, with the gain and loss signs reversed.

Related templates

Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sends

Stop discovering currency losses on the day you get paid.

Put a two minute check on your calendar every weekday morning and know exactly what your foreign currency receivables are worth today.