Short Answer
A seamless, hands-off workflow where A2X payout summaries are validated, enriched with Xero Tracking Categories, and posted as Draft Invoices. This ensures a 1:1 match with bank feeds while providing granular reporting by region or product line.
The Problem
Manual reconciliation of ecommerce payouts (Amazon/Shopify) is error-prone due to hidden fees and tax complexities. While A2X flows directly to Xero, accountants often need secondary data enrichment—such as assigning specific tracking categories or logging payout history to external BI tools—that the native integration doesn't handle natively.
The Outcome
A seamless, hands-off workflow where A2X payout summaries are validated, enriched with Xero Tracking Categories, and posted as Draft Invoices. This ensures a 1:1 match with bank feeds while providing granular reporting by region or product line.
Step-by-Step Guide
1. **Create Webhook in Make.com**: Add a 'Webhooks > Custom Webhook' module. Copy the unique URL provided.
2. **Configure A2X Notification**: In A2X settings, paste the Make.com Webhook URL into the 'Post-Posting Notification' section to trigger the scenario whenever a payout is finalized.
3. **Add Xero Connection**: Add a 'Xero > Create an Invoice' module. Click 'Add' to authorize your Xero Organization. Ensure the 'Tenant ID' is correctly selected.
4. **Set Up Search/Match Logic**: Add a 'Xero > List Tracking Categories' module to retrieve your dynamic 'Region' or 'Department' IDs for accurate mapping.
5. **Configure Router**: Use a 'Router' module to differentiate between 'Marketplace Application' (e.g., if source = Amazon vs Shopify) to apply different Tax Types.
6. **Map Invoice Header**: In the 'Create an Invoice' module, map the `Payout Date` to 'Date' and the `A2X Payout ID` to the 'Reference' field to prevent duplicates.
7. **Map Line Items (Iterator)**: If the A2X payload contains an array of lines, use the 'Iterator' module followed by 'Xero > Add an Item to an Invoice'.
8. **Apply Complex Functions**: Use Make.com's `formatDate()` for the invoice date and `ifempty()` for descriptions to ensure Xero's API doesn't reject null values.
9. **Implement Error Handling**: Right-click the Xero modules and select 'Add error handler'. Use the 'Break' directive to store the execution and retry later if Xero's API is temporarily down.
10. **Finalize Tracking**: Under 'Line Items' in Xero, map the Tracking Category ID retrieved in Step 4 to ensure the revenue hits the correct P&L segment.
Data Mapping
| A2X Field | Xero Target Field | Make.com Transformation | Requirement |
| :--- | :--- | :--- | :--- |
| `payout_date` | `Date` | `parseDate(payout_date; "YYYY-MM-DD")` | Required |
| `total_amount` | `Amount` | `formatNumber(total_amount; 2; "."; "")` | Required |
| `currency` | `Currency Code` | `upper(currency)` | Required |
| `payout_id` | `Reference` | `payout_id` (Crucial for reconciliation) | Required |
| `account_code` | `Account Code` | `ifempty(mapping_code; "200")` | Required |
| `sales_tax` | `Tax Type` | `if(tax > 0; "OUTPUT"; "NONE")` | Optional |
Gotchas & Failure Modes
• **Rate Limiting**: Xero has a limit of 60 calls per minute. If processing large batches of historical payouts, add a 'Sleep' module or set the scenario 'Max number of cycles' to 1 per execution.
• **Data Types**: Xero is strict about Invoice Numbers; ensure you aren't sending duplicate IDs or Make.com will return a '400 Validation Exception'.
• **Token Expiration**: Ensure your Xero connection is set to 'Offline Access' in the OAuth scopes so the Make.com connection doesn't disconnect every 30 minutes.
• **Draft vs. Authorised**: Always post as 'Draft' in Make.com initially to allow for a manual review before the invoice impacts the General Ledger.
Verification Checklist
1. [ ] **Run Once**: Use the 'Run Once' button and manually trigger a 'Send Test' from A2X.
2. [ ] **Check Mapping**: Verify in the 'Execution Log' that the date format is `YYYY-MM-DD` (Xero's required format).
3. [ ] **Verify in Xero**: Log into Xero and ensure the 'Draft Invoice' carries the correct 'Reference' ID matching the A2X payout.
4. [ ] **Test Error Handler**: Deliberately disconnect the Xero module to ensure the 'Break' error handler catches the bundle and stores it in the 'Incomplete Executions' tab.
5. [ ] **Reconciliation Check**: Confirm the total amount in Xero matches the Net Payout exactly to ensure the 'Match' feature works in the Bank Feed.
Ready to Automate?
Build this automation with Make.com in minutes.