ml-connector
OdooFedEx

Odoo and FedEx integration

Odoo runs purchasing and inventory. FedEx delivers the goods. Connecting the two keeps your purchase orders lined up with shipment tracking and automatically records goods receipt in Odoo when a FedEx package arrives at your dock. Instead of manually checking FedEx's website and then posting the receipt, ml-connector watches FedEx for delivery events and updates Odoo's inventory on a schedule you control.

How Odoo works

Odoo exposes purchase orders, goods receipts, purchase order lines, and inventory through XML-RPC or JSON-2 REST calls. Authentication requires an API key paired with a username login; Odoo 14 and later support API key directly, and the API key is passed per-call in XML-RPC or as a Bearer token in JSON-2. Odoo Online users must have a password set by an admin before XML-RPC can authenticate. Key entities include purchase.order (PO header, vendor reference, expected delivery), purchase.order.line (line items, quantities, received), and stock.move (inventory transactions). Odoo has no native webhooks for purchase or stock events in core editions, so ml-connector polls using the write_date filter on search_read calls with a high-water-mark timestamp.

How FedEx works

FedEx exposes shipments, tracking events, rate quotes, and pickup records through REST JSON APIs. All calls require OAuth 2.0 Client Credentials with an API Key and API Secret from the FedEx Developer Portal; the bearer token must be refreshed when it expires, typically within an hour. FedEx offers two tracking options: webhooks via Advanced Integrated Visibility (a paid service) for real-time tracking push events, or the free Track API for polling historical and in-transit tracking. Track API accepts up to 30 tracking numbers per request. Key entities are Shipment (label, account number, origin and destination, tracking number) and Tracking Event (status updates from departure through delivery). FedEx rate-limits token requests at 3 per second; exceeding that triggers a 10-minute block at the IP level, so ml-connector must cache tokens and retry on 403 errors.

What moves between them

The flow runs from FedEx into Odoo. When a purchase order is created in Odoo, the user provides the FedEx tracking number. ml-connector polls FedEx's Track API for tracking events (in-transit, out for delivery, delivered) and when delivery status is recorded, it creates a goods receipt in Odoo, marking the PO as received and crediting the inventory. If the same tracking number appears on multiple Odoo POs (a partial shipment split), ml-connector matches the weight and dimension hints from FedEx to the correct Odoo line items. Reference data such as vendor addresses and dock locations are maintained in Odoo and must match FedEx shipment destination; mismatches are flagged in the audit log.

How ml-connector handles it

ml-connector stores both credential sets encrypted, maintains separate OAuth 2.0 token caches for FedEx with a 1-hour TTL, and respects FedEx's 3-token-per-second auth rate limit by caching. On the Odoo side, it uses the API key per customer and stores the base URL (Odoo Online, Odoo.sh, or self-hosted). To match a PO to a FedEx shipment, ml-connector searches Odoo's PO for a reference that contains or matches the FedEx tracking number, falls back to matching by vendor and PO date range, and uses shipment weight as a tie-breaker. FedEx's Track API is polled every 15 minutes by default; when a Delivered or Exception status is seen, ml-connector creates a goods_receipt record in Odoo with the matching PO lines and posts it to inventory. FedEx's API has no server-side idempotency, so ml-connector tracks each tracking number via the audit log to prevent duplicate goods receipts. Every record carries a full audit trail and can be replayed if an Odoo goods receipt creation fails.

A real-world example

A mid-sized wholesale distributor imports goods from three overseas vendors via FedEx freight and standard parcel service. The purchasing team creates purchase orders in Odoo with the FedEx tracking number from their freight forwarder; previously, the warehouse team checked FedEx's website daily and manually updated Odoo's goods receipts when packages arrived, often a day late and prone to errors. With Odoo and FedEx connected, ml-connector automatically monitors the FedEx tracking numbers linked to each PO and creates goods receipts in Odoo the moment a package is delivered, so the purchase is automatically received and the inventory is updated. The purchasing team can now see confirmed receipt dates in Odoo without checking FedEx separately, and month-end inventory counts match the system on the first day of close.

What you can do

  • Automatically match FedEx tracking numbers to Odoo purchase orders and track inbound shipments without manual website checks.
  • Create goods receipts in Odoo when FedEx delivery status is confirmed, updating inventory on the correct date.
  • Handle Odoo's API key authentication and FedEx OAuth 2.0 token refresh, respecting FedEx rate limits with cached tokens.
  • Poll FedEx free Track API at configurable intervals (default 15 minutes) and detect partial shipments split across multiple Odoo PO lines.
  • Maintain an audit trail of every tracking lookup and goods receipt creation, and replay failed receipts without creating duplicates.

Questions

How does ml-connector match a FedEx tracking number to an Odoo purchase order?
ml-connector searches Odoo's purchase orders for a reference field containing the FedEx tracking number. If the exact number is not found, it falls back to matching by vendor name and PO date range, then uses shipment weight as a tie-breaker if multiple POs match. The match logic and any mismatches are logged in the audit trail for visibility.
Does the integration require FedEx webhooks, or can it use free polling?
ml-connector uses FedEx's free Track API polling by default, checking up to 30 tracking numbers per request at configurable intervals (default 15 minutes). FedEx webhooks (Advanced Integrated Visibility) are a paid service; the integration supports webhooks if enabled, but does not require them.
What happens if a single FedEx shipment contains multiple Odoo purchase orders?
When a single shipment is split across multiple Odoo POs, ml-connector uses the weight and item count from FedEx and the line-item quantities in Odoo to allocate the delivery to the correct PO lines and create separate goods receipts for each affected PO. If allocation is ambiguous, the record is flagged in the audit log for manual review.

Related integrations

Connect Odoo and FedEx

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started