Webhook tool

Xero AI voice agents that read invoices to callers

A Cartesia agent finds the caller's Xero contact, reads what they owe from outstanding invoices, and leaves a note in the contact's history for your team.

Accounts receivable agent

Answers balance questions from Xero and notes what the caller says.

Instructions

Ask for the business name or billing email and find the contact. Read outstanding invoices with amounts and due dates. Before the call ends, add a note with what the caller said and anything they promised. If there is no contact, ask for the business name and email and create one.

Connected tools

  • Find contactWebhook
  • Get outstanding invoicesWebhook
  • Add noteWebhook
  • Create contactWebhook

What a Xero AI voice agent can do

Open one to watch a call. The grey lines are the tools the agent calls mid-sentence.

Xero's contact search matches names, emails and account numbers, not phone numbers, so the agent asks for the business name first.

Tool definitions

Webhook tools go to POST /v1/agents/tools. Transfers are a system tool on the agent. Replace the placeholder values in capitals with your own.

Webhook

Find contact

Searches Xero contacts by name or email.

Show the JSON definition
find_contact
{
  "type": "webhook",
  "name": "find_contact",
  "description": "Finds the caller's Xero contact by business name or email. Returns the contact ID and name, or nothing if there is no match.",
  "pre_tool_speech": "auto",
  "execution_mode": "immediate",
  "response_timeout_secs": 20,
  "api_schema": {
    "url": "https://api.your-company.com/xero/contacts/search",
    "method": "GET",
    "query_params_schema": {
      "properties": {
        "search_term": {
          "type": "string",
          "description": "The business name, person's name or email the caller gave."
        }
      },
      "required": [
        "search_term"
      ]
    },
    "authentication": {
      "mode": "bearer",
      "token": {
        "type": "secret",
        "secret_value": "YOUR_SERVICE_TOKEN"
      }
    }
  }
}

Webhook

Get outstanding invoices

Lists the contact's unpaid invoices.

Show the JSON definition
get_outstanding_invoices
{
  "type": "webhook",
  "name": "get_outstanding_invoices",
  "description": "Lists the contact's authorised, unpaid invoices with invoice number, amount due and due date.",
  "pre_tool_speech": "auto",
  "execution_mode": "immediate",
  "response_timeout_secs": 20,
  "api_schema": {
    "url": "https://api.your-company.com/xero/contacts/{contact_id}/invoices",
    "method": "GET",
    "path_params_schema": {
      "contact_id": {
        "type": "string",
        "description": "The contact ID from find_contact or create_contact."
      }
    },
    "authentication": {
      "mode": "bearer",
      "token": {
        "type": "secret",
        "secret_value": "YOUR_SERVICE_TOKEN"
      }
    }
  }
}

Webhook

Add note

Adds a note to the contact's history.

Show the JSON definition
add_note
{
  "type": "webhook",
  "name": "add_note",
  "description": "Adds a note about this call to the contact's history and notes in Xero.",
  "pre_tool_speech": "auto",
  "execution_mode": "async",
  "response_timeout_secs": 20,
  "api_schema": {
    "url": "https://api.your-company.com/xero/contacts/{contact_id}/notes",
    "method": "POST",
    "path_params_schema": {
      "contact_id": {
        "type": "string",
        "description": "The contact ID from find_contact or create_contact."
      }
    },
    "request_body_schema": {
      "type": "object",
      "properties": {
        "details": {
          "type": "string",
          "description": "What the caller asked and what they promised, in two or three sentences."
        }
      },
      "required": [
        "details"
      ]
    },
    "authentication": {
      "mode": "bearer",
      "token": {
        "type": "secret",
        "secret_value": "YOUR_SERVICE_TOKEN"
      }
    }
  }
}

Webhook

Create contact

Creates a Xero contact for a new caller.

Show the JSON definition
create_contact
{
  "type": "webhook",
  "name": "create_contact",
  "description": "Creates a Xero contact for a caller who has none. Returns the new contact ID.",
  "pre_tool_speech": "auto",
  "execution_mode": "immediate",
  "response_timeout_secs": 20,
  "api_schema": {
    "url": "https://api.your-company.com/xero/contacts",
    "method": "POST",
    "request_body_schema": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The business or person name. Required by Xero."
        },
        "email": {
          "type": "string",
          "description": "The caller's billing email."
        },
        "phone": {
          "type": "string",
          "dynamic_variable": "system__caller_id"
        }
      },
      "required": [
        "name"
      ]
    },
    "authentication": {
      "mode": "bearer",
      "token": {
        "type": "secret",
        "secret_value": "YOUR_SERVICE_TOKEN"
      }
    }
  }
}

Set it up

No native connector. The tools call a small service of yours, which holds the Xero OAuth connection and calls the Xero Accounting API. Vendor details read in November 2026.

  1. Create a Xero app

    In Xero's developer portal, create a web app with accounting.contacts, accounting.invoices.read and offline_access, or a custom connection for a single organisation.

  2. Run the four endpoints

    Your service calls GET Contacts with searchTerm, GET Invoices with ContactIDs and Statuses=AUTHORISED, PUT Contacts/{ContactID}/History and POST Contacts, each with the xero-tenant-id header.

  3. Add the tools

    Point the tools at your service with a bearer secret. The note tool runs async, so the caller doesn't wait on it.

  4. Test on the Demo Company

    Connect Xero's Demo Company first. It's free, including for custom connections, and has sample contacts and invoices.

Before you build

Why not call Xero directly

Xero access tokens last 30 minutes, and each refresh returns a new refresh token. A webhook tool sends the value you stored, so your service refreshes and stores the tokens.

Contact search skips phone numbers

searchTerm covers Name, FirstName, LastName, ContactNumber, CompanyNumber and EmailAddress. To match on caller ID, your service needs its own phone-to-contact index.

Custom connections cost extra

A custom connection uses client credentials for one organisation and needs an additional monthly Xero subscription. It is available in Australia, New Zealand, the UK and the US only.

Use the granular scopes

Since March 2026, Xero web apps get granular scopes such as accounting.invoices.read. The broad accounting.transactions scopes keep working until September 2027.

Enterprise-grade security

  • HIPAA compliant badge

    HIPAA compliant

  • SOC 2 Type 2 badge

    SOC 2 Type 2

  • GDPR badge

    GDPR

Xero AI voice agent FAQs

Can an AI voice agent read invoices from Xero?

Yes. A Cartesia agent finds the caller's contact, reads what they owe from authorised invoices, and leaves a note in the contact's history, through a small service of yours that holds the Xero OAuth connection. There is no native Xero connector.

Can the agent find a Xero contact by phone number?

Not with Xero's search alone. searchTerm covers Name, FirstName, LastName, ContactNumber, CompanyNumber and EmailAddress, not phone numbers. The agent asks for the business name, or your service keeps its own phone-to-contact index for caller ID.

Can the Xero AI agent take a payment?

No. The tools on this page find contacts, read outstanding invoices, add notes and create contacts. Nothing on the call collects payment details.

Why can't the agent call the Xero API directly?

Xero access tokens last 30 minutes, and each refresh returns a new refresh token. A webhook tool sends the value you stored, so your service refreshes and stores the tokens and the agent calls your service with a bearer secret.

Who shows as the author of the note in Xero?

Xero records notes added through the API as "System Generated", with the date they were created. Put the call date and the caller's name in the note text so your team knows where it came from.

What does a Xero voice agent cost to run?

Agents run at $0.03/min, plus LLM usage and telephony. A Xero custom connection needs an additional monthly subscription and is available in Australia, New Zealand, the UK and the US only. The Demo Company is free to test against.

Get started today

Talk to an expert.

Connect with a member of our team and learn how Cartesia can help you build world-class voice experiences.

Contact Sales

Start building.

Access our models via API and bring a voice agent into production in minutes.

Try Cartesia