Xero and FedEx integration
Xero is where your business records invoices, purchase orders, and payments. FedEx moves your packages and knows the cost of every shipment and its delivery status. Connecting the two means your outbound orders in Xero automatically generate FedEx shipments, rates flow back to your cost accounts, and package tracking updates land in your expense records without manual re-entry. For businesses shipping physical goods, this turns shipment tracking and cost allocation from a back-office spreadsheet task into a live reconciliation.
What moves between them
The main flow is Xero outbound: purchase orders and contacts flow from Xero to FedEx to create shipments and request rates. FedEx rate quotes are written back to Xero as line items on manual journals mapped to freight expense accounts. Tracking events flow from FedEx into Xero's bank transactions to post actual carrier charges and confirm delivery. Shipment data is synchronized on a schedule tied to order release cycles, while tracking events are polled once per day or received via FedEx webhooks if enabled.
How ml-connector handles it
ml-connector stores Xero OAuth2 tokens and FedEx API credentials encrypted, and manages the Xero tenant ID passed on every API call. It reads Xero purchase orders with a custom field or contact tag to identify shipping-eligible orders, extracts addresses and line items, and posts them to FedEx's Ship API, using the FedEx transactionId and Xero purchase order ID as a composite key to prevent duplicate shipments if the flow reruns. For rate quoting, ml-connector calls FedEx's Rate API with origin and destination addresses from Xero contacts and posts the resulting rates back to Xero as manual journal lines, mapped to user-configured freight expense accounts and cost centers via Xero's tracking categories. FedEx auth tokens are cached with a 1-hour TTL to stay within the 3-tokens-per-second auth rate limit. Tracking updates are polled from FedEx's Track API by shipment number and written back to Xero as expense journal entries or bank transaction records linked to the original order. All shipment and tracking records carry a full audit trail and can be replayed if a downstream write fails.
A real-world example
A mid-market e-commerce distributor ships orders from a warehouse to retail partners across the country using FedEx Ground and Next Day Air. Before integration, the warehouse team printed shipping labels from FedEx, and the finance team manually entered carrier charges into Xero at month end based on FedEx invoices. Order fulfillment and accounting were disconnected, and shipment costs did not post to Xero until weeks after delivery. With Xero and FedEx connected, each order in Xero triggers a FedEx shipment automatically, rates post to the freight expense account the same day, tracking updates flow back to Xero so fulfillment can be confirmed, and the accounting close process starts with carrier charges already reconciled.
What you can do
- Create FedEx shipments from Xero purchase orders with automatic address and line-item extraction.
- Request FedEx rate quotes and post approved rates back to Xero as freight expense journal entries mapped to your chart of accounts.
- Track FedEx shipments in Xero by polling the Track API and writing delivery status and actual charges to expense records.
- Prevent duplicate shipment creation by deduplicating FedEx transactionId against Xero purchase order ID.
- Manage Xero OAuth2 tokens and FedEx client credentials securely, with token caching to respect FedEx auth rate limits.
Questions
- Which direction does data move between Xero and FedEx?
- Orders and contacts flow from Xero to FedEx to create shipments and quotes. Rate quotes and tracking events flow back to Xero as expense journal entries and bank transactions so costs are reconciled. The main flows are order-to-shipment and tracking-to-expense.
- How does ml-connector prevent duplicate shipments if the sync runs twice?
- FedEx Ship API requests include a transactionId field that supports client-side deduplication. ml-connector uses a composite key of FedEx transactionId and Xero purchase order ID to track shipments that have already been sent, so re-running the flow does not create duplicate shipments at FedEx.
- What Xero objects need to be configured to enable this integration?
- Purchase orders must include shipping address information, either directly or pulled from a linked Xero contact. A custom field or contact tag identifies which orders are eligible for FedEx shipment. Xero accounts for freight expenses and cost centers (via tracking categories) must be configured so rate quotes and charges post to the right expense accounts.
Related integrations
More Xero integrations
Other systems that connect to FedEx
Connect Xero and FedEx
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started