PHPackages                             tcgunel/omniship-fedex - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tcgunel/omniship-fedex

ActiveLibrary

tcgunel/omniship-fedex
======================

FedEx carrier for Omniship shipping library

v0.0.2(2mo ago)03↓100%MITPHPPHP ^8.2

Since Mar 12Pushed 2mo agoCompare

[ Source](https://github.com/tcgunel/omniship-fedex)[ Packagist](https://packagist.org/packages/tcgunel/omniship-fedex)[ RSS](/packages/tcgunel-omniship-fedex/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Omniship FedEx
==============

[](#omniship-fedex)

FedEx carrier driver for the [Omniship](https://github.com/tcgunel/omniship) shipping library.

Uses the FedEx REST API with OAuth 2.0 authentication.

Installation
------------

[](#installation)

```
composer require tcgunel/omniship-fedex
```

Usage
-----

[](#usage)

### Initialize

[](#initialize)

```
use Omniship\Omniship;

$carrier = Omniship::create('FedEx');
$carrier->initialize([
    'clientId' => 'your-client-id',
    'clientSecret' => 'your-client-secret',
    'accountNumber' => 'your-account-number',
    'testMode' => true, // false for production
]);
```

### Create Shipment

[](#create-shipment)

```
use Omniship\Common\Address;
use Omniship\Common\Package;

$response = $carrier->createShipment([
    'shipFrom' => new Address(
        name: 'Ahmet Yilmaz',
        company: 'Sender Company',
        street1: 'Ataturk Cad. No:42',
        city: 'Istanbul',
        district: 'Kadikoy',
        postalCode: '34710',
        country: 'TR',
        phone: '+905551234567',
    ),
    'shipTo' => new Address(
        name: 'John Smith',
        company: 'Receiver Inc',
        street1: '123 Main Street',
        city: 'New York',
        state: 'NY',
        postalCode: '10001',
        country: 'US',
        phone: '+12125551234',
    ),
    'packages' => [
        new Package(weight: 2.5, length: 30, width: 20, height: 15, description: 'Electronics'),
    ],
    'serviceType' => 'FEDEX_INTERNATIONAL_PRIORITY', // optional
])->send();

if ($response->isSuccessful()) {
    echo $response->getTrackingNumber(); // "794644790138"
    echo $response->getShipmentId();     // shipment identifier

    $label = $response->getLabel();
    if ($label !== null) {
        file_put_contents('label.pdf', base64_decode($label->content));
    }

    echo $response->getTotalCharge();    // 85.50
    echo $response->getCurrency();       // "USD"
} else {
    echo $response->getMessage(); // error description
    echo $response->getCode();    // error code
}
```

### Track Shipment

[](#track-shipment)

```
$response = $carrier->getTrackingStatus([
    'trackingNumber' => '794644790138',
])->send();

if ($response->isSuccessful()) {
    $info = $response->getTrackingInfo();
    echo $info->trackingNumber;
    echo $info->status->value;    // "delivered", "in_transit", etc.
    echo $info->carrier;          // "FedEx"
    echo $info->serviceName;      // "FedEx International Priority"
    echo $info->signedBy;         // "J.SMITH"

    foreach ($info->events as $event) {
        echo $event->description; // "Delivered"
        echo $event->city;        // "NEW YORK"
        echo $event->country;     // "US"
        echo $event->occurredAt->format('Y-m-d H:i');
    }
}
```

### Cancel Shipment

[](#cancel-shipment)

```
$response = $carrier->cancelShipment([
    'trackingNumber' => '794644790138',
])->send();

if ($response->isCancelled()) {
    echo 'Shipment cancelled';
}
```

### Get Rates

[](#get-rates)

```
$response = $carrier->getRates([
    'shipFrom' => new Address(
        city: 'Istanbul',
        postalCode: '34710',
        country: 'TR',
    ),
    'shipTo' => new Address(
        city: 'New York',
        postalCode: '10001',
        country: 'US',
    ),
    'packages' => [
        new Package(weight: 2.5, length: 30, width: 20, height: 15),
    ],
])->send();

if ($response->isSuccessful()) {
    foreach ($response->getRates() as $rate) {
        echo $rate->serviceCode;       // "FEDEX_INTERNATIONAL_PRIORITY"
        echo $rate->serviceName;       // "FedEx International Priority"
        echo $rate->totalPrice;        // 85.50
        echo $rate->currency;          // "USD"
        echo $rate->transitDays;       // 3
    }
}
```

Tracking Status Mapping
-----------------------

[](#tracking-status-mapping)

FedEx CodeDescriptionShipmentStatus`PU`Picked up`PICKED_UP``OC`Order created`PRE_TRANSIT``IT`In transit`IN_TRANSIT``AR`Arrived at facility`IN_TRANSIT``DP`Departed facility`IN_TRANSIT``OD`Out for delivery`OUT_FOR_DELIVERY``DL`Delivered`DELIVERED``DE`Delivery exception`FAILURE``CA`Cancelled`CANCELLED``RS`Return to shipper`RETURNED`API Details
-----------

[](#api-details)

- **Transport**: REST/JSON via PSR-18 HTTP client
- **Auth**: OAuth 2.0 (client credentials grant)
- **Base URL**: `https://apis.fedex.com` (prod), `https://apis-sandbox.fedex.com` (sandbox)
- **Create**: `POST /ship/v1/shipments`
- **Track**: `POST /track/v1/trackingnumbers`
- **Cancel**: `PUT /ship/v1/shipments/cancel`
- **Rates**: `POST /rate/v1/rates/quotes`

Testing
-------

[](#testing)

```
vendor/bin/pest
```

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance88

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

60d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36dffe883e88aeef07c26067af3d6a7eda1c2a81f1ae45fdd430b721665131da?d=identicon)[Mobius Studio](/maintainers/Mobius%20Studio)

---

Top Contributors

[![tcgunel](https://avatars.githubusercontent.com/u/3923425?v=4)](https://github.com/tcgunel "tcgunel (2 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tcgunel-omniship-fedex/health.svg)

```
[![Health](https://phpackages.com/badges/tcgunel-omniship-fedex/health.svg)](https://phpackages.com/packages/tcgunel-omniship-fedex)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
