CONNECT APP
Build with Xero Accounting
Commerce
- OAuth
MCP
Give your agent Xero Accounting tools
Every Xero Accounting action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Xero Accounting account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "xero_accounting_api",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Add Items to Existing Sales Invoice:
const result = await mcp.callTool({
name: "xero_accounting_api-add-line-item-to-invoice",
arguments: {
tenantId: "Tenant ID",
invoiceId: "Invoice ID",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "xero_accounting_api",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Add Items to Existing Sales Invoice:
result = await session.call_tool("xero_accounting_api-add-line-item-to-invoice", {
"tenantId": "Tenant ID",
"invoiceId": "Invoice ID",
})API PROXY
Call the Xero Accounting API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Xero Accounting API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.xero.com/connections",
})
// Any allowed Xero Accounting endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.xero.com/connections
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkueGVyby5jb20vY29ubmVjdGlvbnM?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Xero Accounting actions from your backend
Connect a user's Xero Accounting account once, then run Add Items to Existing Sales Invoice on their behalf from your own code — TypeScript, Python, or plain HTTP.
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-add-line-item-to-invoice",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
xero_accounting_api: { authProvisionId: "apn_xxxxxxx" },
tenantId: "Tenant ID",
invoiceId: "Invoice ID",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="xero_accounting_api-add-line-item-to-invoice",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"xero_accounting_api": {"authProvisionId": "apn_xxxxxxx"},
"tenantId": "Tenant ID",
"invoiceId": "Invoice ID",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "xero_accounting_api-add-line-item-to-invoice",
"configured_props": {
"xero_accounting_api": { "authProvisionId": "apn_xxxxxxx" },
"tenantId": "Tenant ID",
"invoiceId": "Invoice ID"
}
}'TOOLS
Xero Accounting actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Add Items to Existing Sales Invoice
actionAdds line items to an existing sales invoice. See the docs hereWritev0.0.5 -
Bank Statements Report
actionGets bank statements for the specified bank account.Read-onlyv0.1.4 -
Create Bank Transaction
actionCreate a new bank transaction See the documentationWritev0.1.4 -
Create Bill
actionCreates a new bill (Accounts Payable)See the docs hereWritev0.0.5 -
Create Credit Note
actionCreates a new credit note.Writev0.1.4 -
Create Employee
actionCreates a new employee.Writev0.3.4 -
Create History Note
actionCreates a new note adding it to a document.Writev0.1.4 -
Create Item
actionCreates a new item.Writev0.1.4 -
Create or Update Contact
actionCreates a new contact or updates if the contact exists.Writev0.1.5 -
Create or update contact
actionCreates a new contact or updates a contact if a contact already exists. See the docs hereWritev0.1.2 -
Create Payment
actionCreates a new paymentWritev0.1.5 -
Create Purchase Bill
actionCreates a new purchase bill.Writev0.1.4 -
Create Sales Invoice
actionCreates a new sales invoice. See the documentationWritev0.3.5 -
Create tracking category
actionCreate a new tracking category See the documentation.Writev0.0.3 -
Delete tracking category
actionDelete a tracking category by ID See the documentation.Writev0.0.3 -
Delete tracking category option
actionDelete a tracking category option by ID See the documentation.Writev0.0.3 -
Download Invoice
actionDownloads an invoice as pdf file. File will be placed at the action's associated workflow temporary folder.Writev0.2.4 -
Email an Invoice
actionTriggers the email of a sales invoice out of Xero.Writev0.1.4 -
Find contact. Optionally, create one if none are found
actionFinds a contact by name or account number. Optionally, create one if none are found. See the docs hereWritev0.0.2 -
Find Invoice
actionFinds an invoice by number or reference.See the docs hereRead-onlyv0.0.5 -
Find or Create Contact
actionFinds a contact by name or email address. Optionally, create one if none are found. See the docs hereRead-onlyv0.1.2 -
Get Bank Summary
actionGets the balances and cash movements for each bank account.Read-onlyv0.1.4 -
Get Contact
actionGets details of a contact.Read-onlyv0.1.4 -
Get History of Changes
actionGets the history of changes to a single existing document.Read-onlyv0.1.4 -
Get Invoice
actionGets details of an invoice.Read-onlyv0.1.4 -
Get Item
actionGets details of an item.Read-onlyv0.2.4 -
Get Sales Invoice Online URL
actionRetrieves the online sales invoice URL.Read-onlyv0.1.4 -
Get Tenant Connections
actionGets the tenants connections the user is authorized to accessRead-onlyv0.1.4 -
Get tracking category
actionGet information from a tracking category by ID See the documentation.Read-onlyv0.0.3 -
List Contacts
actionLists information from contacts in the given tenant id as per filter parameters.Read-onlyv0.2.2 -
List Credit Notes
actionLists information from credit notes in the given tenant id as per filter parameters.Read-onlyv0.2.2 -
List Invoices
actionLists information from invoices in the given tenant id as per filter parameters.Read-onlyv0.3.2 -
List Manual Journals
actionLists information from manual journals in the given tenant id as per filter parameters.Read-onlyv0.2.2 -
List tracking categories
actionLists information from tracking categories See the documentation.Read-onlyv0.0.3 -
Make API Call
actionMakes an aribitrary call to Xero Accounting API.Writev0.1.4 -
Update Contact
actionUpdates a contact given its identifier.Writev0.1.5 -
Update tracking category
actionUpdate a tracking category by ID See the documentation.Writev0.0.3 -
Update tracking category option
actionUpdate a tracking category by ID See the documentation.Writev0.0.3 -
Upload File
actionUploads a file to the specified document. See the documentationWritev1.0.4
EVENTS
Xero Accounting triggers
Event sources your backend can deploy for users and receive through a webhook.
-
New or Updated Contact
triggerEmit new notifications when you create a new or update existing contactv0.0.5 -
New or updated invoice
triggerEmit new notifications when you create a new or update existing invoicev0.0.5 -
New or Updated Quote
triggerEmit new event each time a quote is added or updated. See the documentationv0.0.1 -
Webhook Event Received (Instant)
triggerEmit new event for each incoming webhook notification. To create a Xero Webhook, please follow the instructions here.Instantv0.0.3
MULTI-APP
Use Xero Accounting with other popular apps
Most products don't stop at one integration. Pair Xero Accounting with the other apps your users rely on, and ship use cases that span both.
- App slug
- xero_accounting_api
- Authentication
- OAuth
- Categories
- Commerce
- Actions
- 39
- Triggers
- 4
- API proxy
- Available
OAuth scopes
These are the scopes Pipedream's managed Xero Accounting OAuth client requests when one of your users connects an account. Supply your own OAuth client to request a different set.
- offline_access
- openid
- profile
- accounting.transactions
- accounting.transactions.read
- accounting.reports.read
- accounting.settings
- accounting.settings.read
- accounting.contacts
- accounting.attachments
- accounting.journals.read
- accounting.reports.banksummary.read