Skip to main content
HomeBlogGuidesFedex Tracking Api: How to Track Packages Step by Step

Fedex Tracking Api: How to Track Packages Step by Step

17TRACK

To track FedEx packages through an application, create a FedEx Developer account, obtain API credentials, request an OAuth access token, submit a tracking request, and map the response into your order or shipment workflow. The FedEx Tracking API is intended for software systems that need shipment status data, while the FedEx website is usually faster for checking one package manually.

Fedex Tracking Api How to Track Packages Step by Step

This guide explains the integration sequence, the information to validate, common implementation mistakes, and an alternative for businesses that need multi-carrier tracking rather than FedEx-only connectivity. Exact request fields, authentication rules, environments, and service availability should always be confirmed in the current FedEx documentation before production deployment.

Choose the right tracking method first

The best method depends on who is taking action and how many shipments need to be monitored.

  • One-off lookup: Use the FedEx tracking page when a customer or support agent only needs to check a single shipment.
  • Internal application: Use the FedEx Tracking API when an order management system, warehouse application, customer portal, or support tool needs programmatic status data.
  • Multi-carrier operation: Consider a tracking platform when the business receives shipments from FedEx and other carriers and wants one normalized integration, one status model, or one customer-facing tracking experience.

A FedEx-only API integration can provide direct control and may be appropriate for a system built around FedEx shipments. It also means that your team must manage authentication, request limits, response changes, carrier-specific status logic, error handling, and any additional carrier integrations itself.

What you need before using the FedEx Tracking API

Prepare the following items before writing the integration:

  • A FedEx Developer account and access to the FedEx developer portal.
  • The API credentials required for the selected FedEx environment. FedEx documentation may refer to credentials such as a client ID and client secret.
  • A FedEx account relationship or other account information if the selected API operation requires it.
  • A secure server-side location for credentials. Do not expose the client secret in browser JavaScript, a mobile application, or a public repository.
  • At least one valid shipment identifier for testing, such as a FedEx tracking number. Test data should represent the shipment types and services your application will process.
  • A plan for storing the last known status, event timestamp, location information, and the time of the latest successful check.

FedEx separates developer access, authentication, API environments, and operational requirements. A successful login to the developer portal does not by itself prove that a production request is ready. Check the current product documentation for account prerequisites, approval requirements, environment URLs, and any use restrictions.

Step 1: Create an application in the FedEx developer portal

Start with the official FedEx Developer Portal and identify the Track API product. Create or select an application, then record the credentials provided for the environment you intend to use. Keep development and production credentials separate.

At this stage, confirm four details:

  1. Which API product contains the tracking operation you need.
  2. Which base URL belongs to the test or production environment.
  3. Which authentication method and scopes, if any, are required.
  4. Whether the request needs a FedEx account number or another account-level field.

Do not copy a URL or field name from an old code sample without checking the current documentation. Carrier APIs can change endpoint versions, required headers, response structures, or onboarding rules.

Step 2: Request an OAuth access token

FedEx API authentication commonly uses OAuth 2.0 client credentials. Your application sends its client credentials to the FedEx authorization endpoint and receives a short-lived access token. The application then sends that token in the Authorization header of the tracking request.

A simplified command-line example looks like this:

curl -X POST "<FEDEX_OAUTH_URL>" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=<CLIENT_ID>" \
  -d "client_secret=<CLIENT_SECRET>"

Treat this as an implementation pattern rather than a substitute for the current FedEx authentication documentation. The production code should read the token expiration value, cache the token securely, and request a new one when it expires or when the API returns an authentication failure. Avoid requesting a new token for every tracking number unless the official limits and your traffic pattern make that necessary.

Useful authentication safeguards include:

  • Store secrets in a server-side secret manager or protected environment variables.
  • Never write access tokens or client secrets to application logs.
  • Use separate credentials for development and production where the platform supports that separation.
  • Return a controlled error to the user when authentication fails; do not expose the raw carrier response.
  • Monitor token failures separately from invalid tracking-number failures.

Step 3: Build the tracking request

After obtaining a valid token, construct the request described in the current FedEx Track API documentation. The request generally identifies one or more shipment records and can include options that affect the detail returned. The exact JSON property names and required fields must come from the version of the FedEx endpoint you are using.

A representative request pattern may look like this:

curl -X POST "<FEDEX_TRACK_BASE_URL>/track/v1/trackingnumbers" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "trackingInfo": [
      {
        "trackingNumberInfo": {
          "trackingNumber": "<FEDEX_TRACKING_NUMBER>"
        }
      }
    ],
    "includeDetailedScans": true
  }'

The endpoint path and field names above should be checked against the live FedEx documentation before use. Some integrations may need a different request shape, an account number, a reference-based lookup, or a different option for detailed scans. Do not assume that a tracking number belonging to another carrier can be sent to a FedEx-only endpoint.

Step 4: Parse the response into business fields

Do not pass the complete carrier response directly to a customer-facing page. First, map it into a stable internal model. A practical shipment record may include:

  • Carrier: FedEx.
  • Tracking identifier: The identifier submitted to the API.
  • Current status: Your normalized status, such as label created, in transit, out for delivery, delivered, exception, or unknown.
  • Carrier status: The original FedEx status or code, retained for support and debugging.
  • Latest event: The most recent event description and timestamp returned by FedEx.
  • Estimated delivery: Store only when the response provides it, and display it as an estimate rather than a guarantee.
  • Delivery confirmation: Use the carrier response to determine whether delivery has been reported.
  • Last checked time: The timestamp recorded by your system, which is different from the event time reported by FedEx.

Status normalization needs editorial and operational judgment. For example, an exception should not automatically be displayed as a failed delivery, and a label-created event does not necessarily mean the parcel is moving through the network. Preserve the original carrier event alongside your normalized status so that support staff can investigate differences.

Step 5: Handle errors and incomplete information

A production tracking integration must distinguish between different failure types. A malformed request, expired token, invalid tracking number, temporary carrier outage, and successful response with no useful event are not the same condition.

SituationRecommended handling
Authentication failureRefresh credentials or token handling, then alert the integration owner if the problem continues.
Invalid requestValidate the payload, required headers, identifier format, and environment before retrying.
Tracking number not foundShow an unresolved or unavailable state; do not tell the customer that the parcel is lost without additional evidence.
Temporary timeout or server errorUse bounded retries with backoff and retain the last known status.
No recent scanDisplay the latest confirmed event and its age instead of inventing a current location.

Retry logic should be conservative. Repeated requests can increase load, create noisy alerts, or conflict with API limits. Apply timeouts, exponential backoff, idempotent processing, and monitoring for repeated failures. The exact rate limits and service commitments should be taken from your FedEx agreement or current documentation rather than assumed from a sample application.

Step 6: Schedule updates without creating a poor customer experience

Most shipment systems do not need to request a fresh result every few seconds. Use an update strategy based on shipment state. A new shipment may need more frequent checks after label creation, while a delivered shipment should normally stop polling. An exception may require a separate support workflow rather than faster automated polling.

When presenting results to customers, include the time of the latest carrier event and make clear whether a delivery date is estimated. If the API is temporarily unavailable, keep the last verified result and explain that the status has not been refreshed. This is more useful than replacing a known status with a generic error.

Step 7: Test the complete workflow

Test more than a successful response. A realistic test plan should cover:

  • A valid tracking number with multiple scan events.
  • A newly created shipment with limited tracking history.
  • A delivered shipment.
  • An exception or delayed shipment, if representative test data is available.
  • An invalid or incomplete tracking number.
  • An expired or revoked credential.
  • A timeout, rate-limit response, and temporary server error.
  • Duplicate events and events that arrive out of order.
  • Different time zones and daylight-saving transitions.
  • Redaction of credentials, tokens, personal data, and full carrier payloads in logs.

Before going live, compare your normalized status with the FedEx tracking page for a controlled sample. The two views may not update at exactly the same moment, so the goal is to confirm that your parser correctly interprets the response and does not turn missing data into a definitive claim.

When a multi-carrier tracking API is a better fit

A direct FedEx integration is sensible when FedEx is the main carrier and your team wants to own the full application logic. It is less efficient when orders can move through several carriers, marketplaces, postal operators, or regional delivery services. In that situation, the business may need carrier detection, a common status model, webhook or polling orchestration, branded tracking pages, and one support view.

17TRACK provides a separate Tracking API and publishes developer documentation at api.17track.net. It can be evaluated as a multi-carrier option when the requirement is broader than FedEx-only tracking. The right choice depends on the carriers, countries, event detail, integration model, commercial terms, and operational controls that your project can verify during testing. A multi-carrier service does not remove the need to test carrier-specific exceptions or validate the accuracy and timing of events for your own shipment mix.

Practical implementation checklist

  • Confirm that the FedEx API product matches the lookup type you need.
  • Verify the current authentication endpoint, base URL, request schema, and required headers.
  • Keep client secrets and access tokens on the server.
  • Cache and refresh OAuth tokens safely.
  • Validate tracking identifiers before sending requests.
  • Store both the original carrier status and your normalized status.
  • Record carrier event time separately from your system's retrieval time.
  • Use bounded retries and monitor authentication, validation, timeout, and carrier errors separately.
  • Stop routine polling after a terminal state, subject to your operational rules.
  • Test real response variations before exposing status messages to customers.
  • Recheck FedEx documentation when changing API versions or expanding shipment types.

FAQ

Can I use the FedEx website instead of the API?

Yes. The FedEx website is usually the simplest option for a manual lookup. An API becomes useful when software must retrieve tracking data automatically, connect status events to orders, or present tracking information inside another application.

Do I need an OAuth token for every tracking request?

Typically, the application obtains an access token and sends it with subsequent API requests until it expires. Cache the token securely and follow the current FedEx authentication documentation for expiration and refresh behavior. Do not expose the token to a browser or customer.

Can the API tell me exactly where a package is?

It can return the tracking events and other information provided by FedEx for the shipment. The result may show a scan location or facility, but it should not be interpreted as continuous real-time GPS positioning. Display only the location and event detail actually returned.

Why does a tracking number sometimes have no update?

A shipment may have been created without a recent scan, the identifier may be incorrect, the event may not yet be available in the response, or the carrier service may be temporarily unavailable. Keep the last confirmed result, show when it was checked, and investigate repeated failures instead of declaring the shipment lost.

Should an ecommerce business build separate APIs for every carrier?

That can be reasonable for a FedEx-focused operation with strong engineering resources. A business shipping through several carriers may prefer a multi-carrier tracking layer to reduce integration work and normalize events. Compare carrier coverage, data detail, reliability, documentation, cost, and control over customer-facing experiences before choosing.

Sources

Loading