/xero:contactsfrom xero
Manages Xero customers and suppliers: contact fields, addresses, phones, groups, statuses, read-only balances, and MSP client onboarding/offboarding patterns with PSA cross-referencing.
Ships in xero. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Contacts are the foundational entity in Xero, representing customers (clients you invoice), suppliers (vendors you pay), or both. Every invoice, payment, credit note, and bank transaction is linked to a contact. For MSPs, contacts typically represent managed services clients, hardware vendors, software suppliers, and subcontractors.
hubspot-companies or salesbuildr-companies-contacts.alternative-payments-customers.xero-accounts.qbo-customers.Xero contacts can be customers, suppliers, or both. The type is determined by usage rather than a fixed field:
| Role | Description | MSP Example |
|---|---|---|
| Customer | Contacts you create sales invoices (ACCREC) for | Managed services clients |
| Supplier | Contacts you receive bills (ACCPAY) from | Software vendors, ISPs |
| Customer & Supplier | Both roles | Partner MSPs, distributors |
| Status | Description |
|---|---|
ACTIVE | Active contact (default) |
ARCHIVED | Archived contact (hidden from lists) |
GDPR_REQUEST | GDPR deletion requested |
Contacts can be organized into groups for reporting and filtering:
| Group | MSP Use Case |
|---|---|
| Managed Services | Clients on monthly contracts |
| Break-Fix | Ad-hoc support clients |
| Vendors | Hardware and software suppliers |
| Partners | Co-managed or referral partners |
Name is the only required field and must be unique. AccountNumber and
ContactNumber are free-text and are the natural place to store your PSA
client ID. IsCustomer/IsSupplier and the Balances.* totals are read-only
and derived from invoice history.
See references/fields.md for the complete field reference, including address, phone, and balance fields.
Every request needs both Authorization: Bearer ${ACCESS_TOKEN} and
xero-tenant-id: ${XERO_TENANT_ID}. Xero-specific quirks:
/Contacts/{ContactID}, and the body
must repeat the ContactID.where clause with doubled quotes around
string literals, && for AND, and .Contains() / .StartsWith() for
partial name matching./Contacts is paginated at 100 records per page — pass page=N.# Search by name (partial match)
curl -s -X GET "https://api.xero.com/api.xro/2.0/Contacts?where=Name.Contains(%22Acme%22)" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "xero-tenant-id: ${XERO_TENANT_ID}" \
-H "Accept: application/json"
See references/api.md for the full endpoint catalog and create/update/archive/search examples.
async function onboardMspClient(clientData) {
const token = await auth.getToken();
const contact = await createContact(token, {
Name: clientData.companyName,
ContactNumber: clientData.psaId,
AccountNumber: clientData.accountCode,
EmailAddress: clientData.billingEmail,
Addresses: [
{
AddressType: 'STREET',
AddressLine1: clientData.address,
City: clientData.city,
Region: clientData.state,
PostalCode: clientData.zip,
Country: clientData.country
}
],
Phones: [
{
PhoneType: 'DEFAULT',
PhoneNumber: clientData.phone
}
],
DefaultCurrency: clientData.currency || 'USD'
});
return contact;
}
async function offboardClient(contactId) {
const token = await auth.getToken();
// Check outstanding balance
const contact = await getContact(token, contactId);
const outstanding = contact.Balances?.AccountsReceivable?.Outstanding || 0;
if (outstanding > 0) {
console.log(`WARNING: ${contact.Name} has $${outstanding} outstanding.`);
return { status: 'blocked', reason: 'outstanding_balance', amount: outstanding };
}
// Archive the contact
await updateContact(token, contactId, { ContactStatus: 'ARCHIVED' });
return { status: 'archived', contact: contact.Name };
}
Use the ContactNumber field to store your PSA system's client ID:
async function findByPsaId(psaId) {
const token = await auth.getToken();
const where = encodeURIComponent(`ContactNumber=="${psaId}"`);
const response = await fetch(
`https://api.xero.com/api.xro/2.0/Contacts?where=${where}`,
{
headers: {
'Authorization': `Bearer ${token}`,
'xero-tenant-id': process.env.XERO_TENANT_ID,
'Accept': 'application/json'
}
}
);
const data = await response.json();
return data.Contacts?.[0] || null;
}
async function generateClientReport() {
const contacts = await fetchAllContacts();
return contacts
.filter(c => c.IsCustomer && c.ContactStatus === 'ACTIVE')
.map(contact => ({
name: contact.Name,
accountNumber: contact.AccountNumber,
email: contact.EmailAddress,
outstanding: contact.Balances?.AccountsReceivable?.Outstanding || 0,
overdue: contact.Balances?.AccountsReceivable?.Overdue || 0,
city: contact.Addresses?.find(a => a.AddressType === 'STREET')?.City
}))
.sort((a, b) => b.overdue - a.overdue);
}
/Contacts upserts. Including a ContactID in the body updates
the existing contact rather than creating a new one.ContactStatus=="ACTIVE".See references/errors.md for the complete error-code table.
async function safeCreateContact(data) {
try {
return await createContact(data);
} catch (error) {
if (error.message?.includes('must be unique')) {
// Contact exists - find and return it
const existing = await searchContactByName(data.Name);
return existing;
}
if (error.status === 401) {
// Token expired - refresh and retry
await auth.refreshToken();
return await createContact(data);
}
throw error;
}
}
What SKILL.md sets; muted values are Claude Code's defaults
When creating, searching, updating, or managing client organizations in Xero. Use when: xero contact, xero customer, xero supplier, xero client, xero vendor, contact lookup, contact management, customer management, or xero organization.
6 skills in this plugin
/accountsXero AccountsXero chart of accounts: account classes and types, account codes, tax settings, system accounts, and how MSP revenue, cost-of-sales, and expense categories map to the general ledger.
/api-patternsXero API PatternsXero Accounting API fundamentals: OAuth2 Custom Connection (client credentials) auth and scopes, the xero-tenant-id header, where-clause filter syntax, page-based pagination, rate limits, the two date formats, validation-error shape, and batch operations.
/invoicesnpx claudepluginhub wyre-ai/msp-claude-plugins --plugin xeroOther plugins' skills for the same job