A fully automated workflow in Make.com that detects new orders, matches or creates customers in Xero, generates itemized invoices with correct tax codes, and applies payments for instant bank reconciliation.
The Problem
Manual entry of high-volume sales from multiple marketplaces (Amazon, eBay, Shopify) into Xero is time-consuming and prone to human error. Without automation, managing diverse tax rates and reconciling payments across different gateways becomes an accounting nightmare.
The Outcome
A fully automated workflow in Make.com that detects new orders, matches or creates customers in Xero, generates itemized invoices with correct tax codes, and applies payments for instant bank reconciliation.
Step-by-Step Guide
1. **Create Scenario & Webhook**: In Make.com, create a new scenario and add the 'Webhooks' module. Select 'Custom Webhook' and copy the URL into your Multi-Channel Tool (Tool A) to trigger on 'Order Placed'.
2. **Initialize Connection**: Add the 'Xero' module. Click 'Add' to establish a connection via OAuth2, logging into your Xero account and selecting the correct Organization.
3. **Search for Contact**: Add a 'Xero: Get a Contact' module. Map the email address from Tool A to the 'Email' field in Xero to prevent duplicate records.
4. **Apply Routing Logic**: Place a 'Router' module. Create two paths using Filters: Path A if 'Contact ID' does not exist (Create Contact); Path B if it does (Update Contact).
5. **Configure Invoice Creation**: Add the 'Xero: Create an Invoice' module. Map 'Order ID' to 'Invoice Number' and use the `parseDate()` function to format the transaction date correctly for Xero.
6. **Map Line Items & Taxes**: Use the 'Map' toggle on Line Items. Ensure SKU, Quantity, and Unit Amount are linked. Use a `switch()` function in the Tax Type field to map Marketplace Tax Codes to Xero Account Tax Codes (e.g., `switch(TaxName; VAT; Output; Zero Rated)`).
7. **Add Payment Logic**: Add a 'Xero: Create a Payment' module. Map the 'Invoice ID' from the previous step and specify the 'Bank Account ID' where the funds are deposited (e.g., your Stripe or PayPal clearing account in Xero).
8. **Implement Error Handling**: Right-click the Xero Invoice module and select 'Add error handler'. Choose the 'Break' directive to automatically retry if Xero's API is temporarily down, ensuring no orders are missed.