View as Markdown
Xero Accounting icon

Xero Accounting ACTION

Find contact. Optionally, create one if none are found

Finds a contact by name or account number. Optionally, create one if none are found. See the docs here
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Xero Accounting account once, then configure and run Find contact. Optionally, create one if none are found from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "xero_accounting_api-find-contact",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    xero_accounting_api: { authProvisionId: "apn_xxxxxxx" },
    tenantId: "Tenant ID",
    name: "Contact name",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Find contact. Optionally, create one if none are found inputs
Property Type Description
tenantId Tenant ID string
Id of the organization tenant to use on the Xero Accounting API. See Get Tenant Connections for a workflow example on how to pull this data.
Required Dynamic
name Contact name string
Full name of contact/organization
Optional
accountNumber Account number string
Account number of Contact.
Optional
createContactIfNotFound Create a new contact if not found string
Create a new contact if not found?.
Required

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
xero_accounting_api-find-contact
Version
0.0.2
App
Xero Accounting
Authentication
OAuth
Behavior
May modify external data