Xero Accounting ACTION
Create or Update Contact
Creates a new contact or updates if the contact exists.
- Action
- Writes data
- Destructive
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Xero Accounting account once, then configure and run Create or Update Contact 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-xero-accounting-create-or-update-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: "Name",
},
})
console.log(result)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-xero-accounting-create-or-update-contact",
"configured_props": {
"xero_accounting_api": { "authProvisionId": "apn_xxxxxxx" },
"tenantId": "Tenant ID",
"name": "Name"
}
}'// 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()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "xero_accounting_api-xero-accounting-create-or-update-contact",
arguments: {
tenantId: "Tenant ID",
name: "Name",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
tenantId Tenant ID | string | Select an organization tenant to use, or provide a tenant ID Required Dynamic |
name Name | string | Full name of contact/organisation (max length = 255). The following is required to create a contact. Optional |
contactId Contact ID | string | Unique identification of the contact Optional Dynamic |
contactNumber Contact Number | string | This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. Optional |
accountNumber Account Number | string | A user defined account number. This can be updated via the API and the Xero UI (max length = 50). Optional |
contactStatus Contact Status | string | Current status of a contact - see contact status types Optional |
firstName First Name | string | First name of contact person (max length = 255) Optional |
lastName Last Name | string | Last name of contact person (max length = 255) Optional |
emailAddress Email Address | string | Email address of contact person (umlauts not supported) (max length = 255) Optional |
skypeUserName Skype User Name | string | Skype user name of contact Optional |
contactPersons Contact Persons | any | See contact persons Optional |
bankAccountDetails Bank Account Details | string | Bank account number of contact Optional |
taxNumber Tax Number | string | Tax number of contact - this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) Optional |
accountReceivableTaxType Account Receivable Tax Type | string | Default tax type used for contact on AP invoices Optional |
accountPayableType Account Payable Type | string | Store certain address types for a contact - see address types Optional |
addresses Addresses | any | Store certain address types for a contact - see address types Optional |
phones Phones | any | Store certain phone types for a contact - see phone types Optional |
isSupplier Is Supplier | boolean | true or false Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST - it is automatically set when an accounts payable invoice is generated against this contact. Optional |
isCustomer Is Customer | boolean | true or false Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST - it is automatically set when an accounts receivable invoice is generated against this contact. Optional |
defaultCurrency Default Currency | string | Default currency for raising invoices against contact Optional |
xeroNetworkKey Xero Network Key | string | Store XeroNetworkKey for contacts Optional |
salesDefaultAccountCode Sales Default Account Code | string | The default sales account code for contacts Optional |
purchasesDefaultAccountCode Purchases Default Account Code | string | The default purchases account code for contacts Optional |
salesTrackingCategories Sales Tracking Categories | string | The default sales tracking categories for contacts Optional |
purchasesTrackingCategories Purchases Tracking Categories | string | The default purchases tracking categories for contacts Optional |
trackingCategoryName Tracking Category Name | string | The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories Optional |
trackingOptionName Tracking Option Name | string | The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories Optional |
paymentTermsBillDay Payment Terms Bill Day | integer | The default payment terms bill day Optional |
paymentTermsBillType Payment Terms Bill Type | string | The default payment terms bill type Optional |
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-xero-accounting-create-or-update-contact
- Version
- 0.1.5
- App
- Xero Accounting
- Authentication
- OAuth
- Read-only
- No
- Destructive
- Yes
- Open world
- Yes
- Source
- View on GitHub ↗