Amazon Seller Central to Xero Accounting Sync (n8n)

Automate Amazon revenue recognition and inventory reconciliation using n8n's visual workflow engine

Tools: AmazonXero

Platform: n8n

Short Answer

A fully automated workflow that captures Amazon orders in real-time or via settlement reports, maps them to Xero Invoices, creates line items for fees, and ensures inventory counts remain synchronized across platforms.

The Problem

Manually reconciling Amazon sales with Xero is time-consuming and prone to human error, especially regarding tax calculations and FBA fees. Without automation, inventory levels often drift between Seller Central and the general ledger, leading to inaccurate financial reporting.

The Outcome

A fully automated workflow that captures Amazon orders in real-time or via settlement reports, maps them to Xero Invoices, creates line items for fees, and ensures inventory counts remain synchronized across platforms.

Step-by-Step Guide

1. **Configure Credentials**: Open n8n, go to 'Credentials' and add 'Amazon Seller Central' (requires Client ID, Secret, and Refresh Token from Amazon Developer Console) and 'Xero OAuth2' credentials. 2. **Set Amazon Trigger**: Add the 'Amazon Seller Central' node. Set the Resource to 'Order' and Event to 'On Order Status Change'. Filter for status 'Shipped' to ensure revenue is only recognized upon fulfillment. 3. **Handle Order Items**: Amazon's initial trigger doesn't always provide full line-item SKU details. Add an 'Amazon Seller Central' node or 'HTTP Request' node to fetch details for the specific `AmazonOrderId` received from the trigger. 4. **Data Transformation**: Add a 'Code Node'. Use JavaScript to map Amazon's array structure to Xero's required format. Specifically, transform the `ItemPrice` and `PromotionDiscount` into distinct line items. 5. **Sync Contact**: Add a 'Xero' node. Set the Action to 'Get/Create Contact'. Map the Amazon 'Buyer Name' or use a generic 'Amazon Customer' contact ID to keep your Xero contact list clean. 6. **Create Invoice**: Add another 'Xero' node. Action: 'Create Invoice'. Use expressions (e.g., `{{ $json.orderId }}`) to map the Amazon Order ID to the Xero Reference field. Set the 'Status' to 'AUTHORISED'. 7. **Tax Logic**: In the Xero node, use an n8n Expression to apply Tax Types based on the `ShippingAddress.State` or `CountryCode` provided by Amazon. 8. **Inventory Update**: Add a 'Xero' node for 'Update Item'. Use the SKU from Amazon to find the matching Item Code in Xero and decrement the quantity based on the order. 9. **Error Handling**: Create an 'Error Trigger' workflow. If any node fails (e.g., Xero API limit reached), this sub-workflow should log the error and send a notification to a Slack channel via the 'Slack' node.