---
title: "Carrier invoice checked against McLeod before it becomes a Xero bill | FlowRunner flow"
description: "Carriers email invoices to your AP inbox. This flow checks each one against the agreed carrier pay in McLeod and enters a match as a Xero bill with the PDF attached."
url: https://flowrunner.ai/flows/xero-carrier-invoice-to-bill
date_published: 2026-11-19
date_modified: 2026-11-25T18:03:54-08:00
---

# Carrier invoice checked against McLeod before it becomes a Xero bill

Carriers email invoices to your AP inbox. This flow checks each one against the agreed carrier pay in McLeod and enters a match as a Xero bill with the PDF attached.

## The prompt

When a carrier emails an invoice to our AP inbox in Gmail, read the PDF and pull out the carrier, invoice number, load number, PRO, dates, total and each charge. Find the load in McLeod and the carrier in Xero by its exact name, and skip the invoice if that carrier already has a bill with the same invoice number. Compare the invoice with the load: same carrier, a total that matches the agreed carrier pay to the cent, and every accessorial on the invoice also in the carrier's extra pay. If it matches, enter it in Xero as a bill awaiting payment, with the load number as the reference, and attach the carrier's PDF to the bill. If it doesn't, ask the AP lead in Slack with Book it and Hold it buttons and wait for the answer. Tell AP in Slack when the load or the carrier can't be found.

FlowRunner Prompt to Flow built this flow from that request. Here it is as it opens in the editor.

## The flow

[Import this flow](https://flowrunner.ai/downloads/prompt-to-flow/xero-carrier-invoice-to-bill.json)

-   [Xero](https://flowrunner.ai/integrations/xero)
-   [Gmail](https://flowrunner.ai/integrations/gmail-service)
-   [McLeod LoadMaster](https://flowrunner.ai/integrations/mcleod-loadmaster)
-   [Slack](https://flowrunner.ai/integrations/slack)

Download the file, then in FlowRunner click + beside Flows, pick it under Import a Flow Version and click Create. [How importing works](https://docs.flowrunner.ai/manage/flows#importing-a-flow)

## What each step does

1.  New carrier invoice email Checks the AP inbox in Gmail every 5 minutes for an email with an attachment and invoice in the subject.
2.  Read the carrier invoice An AI agent reads the saved PDF and pulls out the carrier, invoice number, load number, PRO, dates, total and every charge on it.
3.  Find the load in McLeod Looks the load up by load number, or by PRO when the invoice has no load number. When nothing matches, the invoice goes to AP in Slack and nothing is entered.
4.  Find the carrier in Xero Finds the Xero contact whose name is exactly the carrier name McLeod has on the load. A carrier Xero doesn't know goes to AP in Slack.
5.  Compare with the agreed carrier pay When Xero already has a bill from this carrier with the same invoice number, the resent invoice is skipped and AP is told. Otherwise it checks the carrier, the total to the cent, and each accessorial against the carrier's extra pay in McLeod.
6.  Create the bill A match becomes a Xero bill awaiting payment, with the carrier's invoice number, the McLeod load number as the reference, one line per charge, and the carrier's PDF attached. If the PDF can't be attached, AP is asked in Slack to attach it.
7.  Ask the AP lead A variance goes to the AP lead in Slack with both totals, what differs, a link to the invoice, and two buttons, Book it and Hold it.
8.  Wait for the AP lead's answer The run waits for the click. Book it enters the bill as the carrier billed it. Hold it keeps the invoice out of Xero and says so in the Slack thread.

## We can build this for you.

It's custom work, built around how you do things by our implementation team at Midnight Flow, in your own FlowRunner workspace.

-   Every carrier invoice matched to its rate confirmation and POD, extra charges sent to you, and billing released
    
    Built and tested by our team. Runs on your FlowRunner plan.
    
    [Have us build this](https://midnightflow.ai/packages/carrier-invoice-matching?utm_source=flowrunner.ai&utm_medium=referral&utm_campaign=freight-brokers&utm_content=flows.aside&utm_term=xero-carrier-invoice-to-bill)

## Before you turn it on

-   Connect your Gmail, Xero and Slack accounts, and enter your McLeod server URL and API token.
-   Add your Anthropic key in the flow setting Anthropic key. Set Carrier pay account code to the Xero account your carrier bills are booked to, and Carrier payment terms (days) to the terms used when an invoice shows no due date.
-   Copy the URL of the block Wait for the AP lead's answer into the flow setting Answer link. The Slack buttons open it.
-   Pick your Slack channel in the six Slack steps, and narrow the Gmail search to your AP inbox if it shares a mailbox. Carriers are found by their exact name, so keep each carrier's Xero contact name the same as in McLeod.

[Everything FlowRunner does with Xero](https://flowrunner.ai/integrations/xero)

---
Markdown version of https://flowrunner.ai/flows/xero-carrier-invoice-to-bill. Site index: https://flowrunner.ai/llms.txt
