ml-connector
MYOBFedEx

MYOB and FedEx integration

MYOB runs accounting for small and medium Australian and New Zealand businesses. FedEx handles shipping and tracking. Connecting the two keeps your supply chain visible in your accounting records. When you create a purchase order in MYOB for inventory or goods, ml-connector can send that order to FedEx to generate a shipping label, and then FedEx tracking updates flow back into MYOB so you know when goods arrive without checking a separate system.

How MYOB works

MYOB Business API is a REST API covering AP, AR, and GL for cloud-hosted accounting. It requires OAuth2 Authorization Code flow plus a separate company file username and password transmitted in every API call header. Access tokens last 20 minutes and refresh tokens last one week. MYOB exposes contacts, purchase orders, invoices, payments, GL accounts, and journal entries. The API does not support webhooks, so changes are detected by polling with OData $filter on LastModified timestamps. The API rate limit is 8 requests per second and 1,000,000 requests per day. Page sizes are capped at 1,000 records except contacts which allow up to 5,000 per page. All dates must be ISO 8601 format.

How FedEx works

FedEx REST APIs cover shipping, tracking, rates, and freight. All calls require OAuth2 client credentials using API Key and API Secret from the FedEx Developer Portal. The token is cached at the IP level to avoid rate limits, since exceeding 3 tokens per second triggers a 10-minute lockout. FedEx exposes shipments, tracking events, rate quotes, and freight shipments. Webhooks for tracking push events are available but cost extra and require a separate billing subscription. Polling via the Track API is free and accepts up to 30 tracking numbers per request. The API rate limit is 1,400 transactions per 10 seconds. Ship API provides a transactionId field for client-side deduplication. FedEx has no invoice API, so billing data only exists in the FedEx Billing Online web portal. No PO or invoice master data lives on FedEx; PO references are customer fields on shipments matched against the Track API response.

What moves between them

The primary flow is MYOB to FedEx. When a purchase order is marked for shipment in MYOB, ml-connector reads the supplier address from the contact, line items with quantity, and any shipping instructions, then calls FedEx Ship API to create a label. The FedEx transactionId and tracking number are stored encrypted in MYOB against the purchase order so the relationship is never lost. Tracking status flows the opposite direction: ml-connector polls FedEx Track API on a regular schedule, matches results to MYOB purchase orders by their stored tracking number, and records the latest tracking event (picked up, in transit, delivered) as a note or custom field in MYOB. Reference data such as FedEx account numbers is stored once during setup and reused across all shipments.

How ml-connector handles it

ml-connector stores both MYOB company file credentials and FedEx API credentials encrypted. On the MYOB side it calls the Authorize endpoint to get an OAuth2 token, then uses that token plus the CF credentials in every request header. MYOB tokens expire in 20 minutes so ml-connector refreshes them proactively before they expire. On the FedEx side it calls the OAuth2 token endpoint with client credentials, caches the bearer token for one hour to stay under the 3-tokens-per-second IP rate limit, and refreshes only when the cached token approaches expiry. When MYOB purchase orders are read, ml-connector maps the MYOB supplier contact address (street, suburb, postcode, state) to FedEx ShipmentRecipientDetails, which requires both ISO country code and valid Australian/New Zealand state codes. Line items become shipment items. FedEx Ship API returns a transactionId and tracking number; both are stored encrypted in a MYOB custom field on the purchase order. On the tracking poll, ml-connector queries FedEx Track API with batches of up to 30 stored tracking numbers, maps FedEx TrackingEvent timestamps and status codes to a human-readable format, and appends each new event as a note to the MYOB purchase order. Every API call is logged with request, response, and outcome, and failed calls trigger retries with exponential backoff.

A real-world example

A small online retailer based in Sydney uses MYOB for AP, AR, and general ledger, and ships products to customers across Australia and New Zealand via FedEx. Before the integration, the warehouse team created shipments in FedEx manually by copying address details from MYOB purchase orders, which introduced entry errors and shipping delays. Customers asked for tracking links but the team had to log into FedEx separately to retrieve tracking numbers and email them. Now when the warehouse confirms a PO is ready to ship, they mark it in MYOB and ml-connector automatically creates the FedEx label with the correct address and stores the tracking number back in MYOB. Customers receive tracking updates as comments on their order, and the retailer never re-types an address again.

What you can do

  • Create FedEx shipping labels from MYOB purchase orders, mapping supplier addresses and line items automatically.
  • Store FedEx transactionId and tracking number encrypted in MYOB against each PO so the relationship is permanent.
  • Poll FedEx Track API on a schedule and append tracking events (picked up, in transit, delivered) back to MYOB as order notes.
  • Manage separate OAuth2 credentials for MYOB and FedEx, cache tokens to avoid rate limits, and refresh proactively before expiry.
  • Maintain full audit records of every label created, tracking query made, and event received, with retry logic on transient failures.

Questions

Does ml-connector need a FedEx account number to create labels?
Yes. ml-connector requires a FedEx account number to be stored during setup. This account number is used for all account-rated shipments. Different FedEx accounts can be set up per customer if needed, and the account number is stored encrypted.
How does ml-connector handle MYOB's two-factor auth requirement?
MYOB requires both an OAuth2 bearer token AND company file credentials (username and password) on every API call. ml-connector stores the company file credentials encrypted and includes them in the x-myobapi-cftoken header along with the OAuth2 token. Both are refreshed independently on their own schedules.
What happens if a FedEx tracking number is not found or a shipment fails to create?
If FedEx Ship API rejects a request (invalid address, weight, or account issue), ml-connector logs the error and retries with exponential backoff. If the shipment ultimately fails after retries, the MYOB purchase order remains without a tracking number and an alert is logged so the user can investigate. Tracking polls that find no match are silently skipped on the next attempt.

Related integrations

Connect MYOB and FedEx

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

Get started