Xero Accounting Automation

This n8n workflow automates Xero accounting tasks, managing contacts and invoices via the Xero API. Key nodes include Webhook Trigger (receives POST requests), Extract Request Metadata (captures client data), Xero Rate Limit Check, Validate and Sanitize Input, Create/Get/Update Xero Contact/Invoice (API interactions), and Success/Error Response nodes (handle outputs). Set up Requirements and Configuration: Install n8n by downloading from n8n.io for self-hosting or sign up at cloud.n8n.io for cloud setup. Follow installation prompts or create a cloud account. Obtain Xero API credentials from developer.xero.com: log in, create an app under 'My Apps,' select OAuth 2.0, note Client ID and Secret, and obtain an access token via authorization flow. In n8n, import the provided JSON to create the workflow. Configure Xero nodes (Create/Get/Update Contact/Invoice) with your OAuth 2.0 credentials under 'Credentials,' selecting 'Xero OAuth2 API.' Set the Webhook Trigger node’s path to 'xero/operations,' enable header authentication with a secure key, and ensure it accepts POST requests. The Validate and Sanitize Input node checks resource, operation, UUIDs, and email. Testing and Deployment Steps: Test by sending a POST request to the Webhook URL (from the Webhook Trigger node) using Postman. Example JSON body: {'resource': 'contact', 'operation': 'create', 'organizationId': 'UUID', 'name': 'John Doe', 'email': 'test@example.com'} or {'resource': 'invoice', 'operation': 'get', 'organizationId': 'UUID', 'invoiceId': 'UUID'} with the authentication header. The 'Xero Success Response' node returns a 200 status with operation results, or 'Validation Error Response' (400 status) for invalid inputs like incorrect UUID or email formats. The 'Rate Limit Response' (429 status) triggers if exceeding 60 requests per minute. The 'Resource Not Found Response' (404 status) indicates invalid IDs. Activate the workflow in n8n’s interface for deployment. Monitor logs for errors like invalid credentials or UUIDs, and verify the OAuth token or input formats if issues occur.

$6.99

Workflow steps: 28

Integrated apps: webhook, set, code

Xero Accounting Automation preview