PHPackages                             dmeys/php-fedex-api-wrapper - 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. [API Development](/categories/api)
4. /
5. dmeys/php-fedex-api-wrapper

ActiveLibrary[API Development](/categories/api)

dmeys/php-fedex-api-wrapper
===========================

API Wrapper for Fedex web services

2.8.1(7y ago)066MITPHPPHP &gt;=5.4.0

Since Mar 28Pushed 7y agoCompare

[ Source](https://github.com/dmeys/php-fedex-api-wrapper)[ Packagist](https://packagist.org/packages/dmeys/php-fedex-api-wrapper)[ Docs](https://github.com/dmeys/php-fedex-api-wrapper)[ RSS](/packages/dmeys-php-fedex-api-wrapper/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (5)Versions (17)Used By (0)

PHP FedEx API Wrapper
=====================

[](#php-fedex-api-wrapper)

[![Latest Stable Version](https://camo.githubusercontent.com/1794248e207cda548e865204a66b35e5fc48906d47f7f4f45bc3ea56d8b0d3d9/68747470733a2f2f706f7365722e707567782e6f72672f6a6572656d792d64756e6e2f7068702d66656465782d6170692d777261707065722f762f737461626c65)](https://packagist.org/packages/jeremy-dunn/php-fedex-api-wrapper)[![Total Downloads](https://camo.githubusercontent.com/f1d57b8c321b484aa999d2e09436704c5d755ade5bcfd9098b899bca922b1db9/68747470733a2f2f706f7365722e707567782e6f72672f6a6572656d792d64756e6e2f7068702d66656465782d6170692d777261707065722f646f776e6c6f616473)](https://packagist.org/packages/jeremy-dunn/php-fedex-api-wrapper)[![Build Status](https://camo.githubusercontent.com/892a4d760f74bbc325729757761f15c10979494539bef4f51f536f02aec8a186/68747470733a2f2f7472617669732d63692e6f72672f4a6572656d7944756e6e2f7068702d66656465782d6170692d777261707065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/JeremyDunn/php-fedex-api-wrapper)[![Codacy Badge](https://camo.githubusercontent.com/f49ac9067a522275fd5f7f84ff97f64d8e7cf6021f0e4e7401106e950b6abeca/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6565356264633630356466643434643061353930656131646663303331343231)](https://www.codacy.com/app/JeremyDunn/php-fedex-api-wrapper?utm_source=github.com&utm_medium=referral&utm_content=JeremyDunn/php-fedex-api-wrapper&utm_campaign=badger)

This library provides a fluid interface for constructing requests to the FedEx web service API.

General Information
-------------------

[](#general-information)

All of the code under the `FedEx` namespace is generated using the [generate-classes-from-wsdls.php](util/generate-classes-from-wsdls.php) script. Each web service has it's own class namespace. See the official FedEx web service API documentation for a description of these services.

- [Address Validation Service](src/FedEx/AddressValidationService)
- [Close Service](src/FedEx/CloseService)
- [Courier Dispatch Service](src/FedEx/CourierDispatchService)
- [Locations Service](src/FedEx/LocationsService)
- [Package Movement Information Service](src/FedEx/PackageMovementInformationService)
- [Pickup Service](src/FedEx/PickupService)
- [Rate Service](src/FedEx/RateService)
- [Return Tag Service](src/FedEx/ReturnTagService)
- [Ship Service](src/FedEx/ShipService)
- [Track Service](src/FedEx/TrackService)
- [Upload Document Service](src/FedEx/UploadDocumentService)
- [Open Ship Service](src/FedEx/OpenShipService)
- [Validation Availability and Commitment Service](src/FedEx/ValidationAvailabilityAndCommitmentService)
- [ASYNC Transaction Service](src/FedEx/AsyncService)
- [In Flight Shipment Service](src/FedEx/InFlightShipmentService)
- [DGLD Service](src/FedEx/DGLDService)
- [DGDS Service](src/FedEx/DGDSService)

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

[](#installation)

```
composer require jeremy-dunn/php-fedex-api-wrapper

```

Using the library
-----------------

[](#using-the-library)

The easiest way to get started constructing a web service request is to create an new `Request` object for the particular service you wish to use and then work backward by injecting the objects necessary to complete the request.

For example if we wish to get shipping rates, we'll create a new instance of [FedEx\\RateService\\Request](src/FedEx/RateService/Request.php) and call the [getGetRatesReply()](src/FedEx/RateService/Request.php#L61) method. This method requires an instance of [FedEx\\RateService\\ComplexType\\RateRequest](src/FedEx/RateService/ComplexType/RateRequest.php) which itself requires instances of [FedEx\\RateService\\ComplexType\\RequestedShipment](src/FedEx/RateService/ComplexType/RequestedShipment.php), [FedEx\\RateService\\ComplexType\\TransactionDetail](src/FedEx/RateService/ComplexType/TransactionDetail.php), [FedEx\\RateService\\ComplexType\\WebAuthenticationDetail](src/FedEx/RateService/ComplexType/WebAuthenticationDetail.php), [FedEx\\RateService\\ComplexType\\ClientDetail](src/FedEx/RateService/ComplexType/ClientDetail.php), and so on. See below for an example.

Rate Service request example
----------------------------

[](#rate-service-request-example)

This assumes the `FEDEX_KEY`, `FEDEX_PASSWORD`, `FEDEX_ACCOUNT_NUMBER`, and `FEDEX_METER_NUMBER` are previously defined in your application. Also note that by default, the library will use the beta/testing server (wsbeta.fedex.com). To use the production server (ws.fedex.com), set the location on the `\SoapClient` returned from the Request. See below for an example of how to do this.

```
use FedEx\RateService\Request;
use FedEx\RateService\ComplexType;
use FedEx\RateService\SimpleType;

$rateRequest = new ComplexType\RateRequest();

//authentication & client details
$rateRequest->WebAuthenticationDetail->UserCredential->Key = FEDEX_KEY;
$rateRequest->WebAuthenticationDetail->UserCredential->Password = FEDEX_PASSWORD;
$rateRequest->ClientDetail->AccountNumber = FEDEX_ACCOUNT_NUMBER;
$rateRequest->ClientDetail->MeterNumber = FEDEX_METER_NUMBER;

$rateRequest->TransactionDetail->CustomerTransactionId = 'testing rate service request';

//version
$rateRequest->Version->ServiceId = 'crs';
$rateRequest->Version->Major = 10;
$rateRequest->Version->Minor = 0;
$rateRequest->Version->Intermediate = 0;

$rateRequest->ReturnTransitAndCommit = true;

//shipper
$rateRequest->RequestedShipment->Shipper->Address->StreetLines = ['10 Fed Ex Pkwy'];
$rateRequest->RequestedShipment->Shipper->Address->City = 'Memphis';
$rateRequest->RequestedShipment->Shipper->Address->StateOrProvinceCode = 'TN';
$rateRequest->RequestedShipment->Shipper->Address->PostalCode = 38115;
$rateRequest->RequestedShipment->Shipper->Address->CountryCode = 'US';

//recipient
$rateRequest->RequestedShipment->Recipient->Address->StreetLines = ['13450 Farmcrest Ct'];
$rateRequest->RequestedShipment->Recipient->Address->City = 'Herndon';
$rateRequest->RequestedShipment->Recipient->Address->StateOrProvinceCode = 'VA';
$rateRequest->RequestedShipment->Recipient->Address->PostalCode = 20171;
$rateRequest->RequestedShipment->Recipient->Address->CountryCode = 'US';

//shipping charges payment
$rateRequest->RequestedShipment->ShippingChargesPayment->PaymentType = SimpleType\PaymentType::_SENDER;
$rateRequest->RequestedShipment->ShippingChargesPayment->Payor->AccountNumber = FEDEX_ACCOUNT_NUMBER;
$rateRequest->RequestedShipment->ShippingChargesPayment->Payor->CountryCode = 'US';

//rate request types
$rateRequest->RequestedShipment->RateRequestTypes = [SimpleType\RateRequestType::_ACCOUNT, SimpleType\RateRequestType::_LIST];

$rateRequest->RequestedShipment->PackageCount = 2;

//create package line items
$rateRequest->RequestedShipment->RequestedPackageLineItems = [new ComplexType\RequestedPackageLineItem(), new ComplexType\RequestedPackageLineItem()];

//package 1
$rateRequest->RequestedShipment->RequestedPackageLineItems[0]->Weight->Value = 2;
$rateRequest->RequestedShipment->RequestedPackageLineItems[0]->Weight->Units = SimpleType\WeightUnits::_LB;
$rateRequest->RequestedShipment->RequestedPackageLineItems[0]->Dimensions->Length = 10;
$rateRequest->RequestedShipment->RequestedPackageLineItems[0]->Dimensions->Width = 10;
$rateRequest->RequestedShipment->RequestedPackageLineItems[0]->Dimensions->Height = 3;
$rateRequest->RequestedShipment->RequestedPackageLineItems[0]->Dimensions->Units = SimpleType\LinearUnits::_IN;
$rateRequest->RequestedShipment->RequestedPackageLineItems[0]->GroupPackageCount = 1;

//package 2
$rateRequest->RequestedShipment->RequestedPackageLineItems[1]->Weight->Value = 5;
$rateRequest->RequestedShipment->RequestedPackageLineItems[1]->Weight->Units = SimpleType\WeightUnits::_LB;
$rateRequest->RequestedShipment->RequestedPackageLineItems[1]->Dimensions->Length = 20;
$rateRequest->RequestedShipment->RequestedPackageLineItems[1]->Dimensions->Width = 20;
$rateRequest->RequestedShipment->RequestedPackageLineItems[1]->Dimensions->Height = 10;
$rateRequest->RequestedShipment->RequestedPackageLineItems[1]->Dimensions->Units = SimpleType\LinearUnits::_IN;
$rateRequest->RequestedShipment->RequestedPackageLineItems[1]->GroupPackageCount = 1;

$rateServiceRequest = new Request();
$rateServiceRequest->getSoapClient()->__setLocation(Request::PRODUCTION_URL); //use production URL

$rateReply = $rateServiceRequest->getGetRatesReply($rateRequest); // send true as the 2nd argument to return the SoapClient's stdClass response.

if (!empty($rateReply->RateReplyDetails)) {
    foreach ($rateReply->RateReplyDetails as $rateReplyDetail) {
        var_dump($rateReplyDetail->ServiceType);
        var_dump($rateReplyDetail->DeliveryTimestamp);
        if (!empty($rateReplyDetail->RatedShipmentDetails)) {
            foreach ($rateReplyDetail->RatedShipmentDetails as $ratedShipmentDetail) {
                var_dump($ratedShipmentDetail->ShipmentRateDetail->RateType . ": " . $ratedShipmentDetail->ShipmentRateDetail->TotalNetCharge->Amount);
            }
        }
        echo "";
    }
}

var_dump($rateReply);
```

More examples can be found in the [examples](examples) folder.

[Change Log](CHANGELOG.md)
--------------------------

[](#change-log)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 88.5% 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 ~37 days

Recently: every ~66 days

Total

14

Last Release

2852d ago

Major Versions

1.1 → 2.02017-07-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e617cabdca9e5e0a09968886148a25b06470c2d0ce33cd4add1d902ab751b5b?d=identicon)[dmeys](/maintainers/dmeys)

---

Top Contributors

[![JeremyDunn](https://avatars.githubusercontent.com/u/161614?v=4)](https://github.com/JeremyDunn "JeremyDunn (146 commits)")[![dmeys](https://avatars.githubusercontent.com/u/34945008?v=4)](https://github.com/dmeys "dmeys (5 commits)")[![alexankit](https://avatars.githubusercontent.com/u/10940370?v=4)](https://github.com/alexankit "alexankit (4 commits)")[![sg4tech](https://avatars.githubusercontent.com/u/3677021?v=4)](https://github.com/sg4tech "sg4tech (3 commits)")[![colinodell](https://avatars.githubusercontent.com/u/202034?v=4)](https://github.com/colinodell "colinodell (2 commits)")[![umpirsky](https://avatars.githubusercontent.com/u/208957?v=4)](https://github.com/umpirsky "umpirsky (2 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")[![cgsmith](https://avatars.githubusercontent.com/u/570018?v=4)](https://github.com/cgsmith "cgsmith (1 commits)")[![vlad-reshetylo](https://avatars.githubusercontent.com/u/7568590?v=4)](https://github.com/vlad-reshetylo "vlad-reshetylo (1 commits)")

---

Tags

soapshippingFedEx

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dmeys-php-fedex-api-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/dmeys-php-fedex-api-wrapper/health.svg)](https://phpackages.com/packages/dmeys-php-fedex-api-wrapper)
```

###  Alternatives

[shippo/shippo-php

A PHP library for connecting with multiple carriers (FedEx, UPS, USPS) using Shippo.

1711.8M2](/packages/shippo-shippo-php)[gabrielbull/ups-api

PHP UPS API

4642.4M10](/packages/gabrielbull-ups-api)[easypost/easypost-php

EasyPost Shipping API Client Library for PHP

1753.1M5](/packages/easypost-easypost-php)[laminas/laminas-soap

6121.8M37](/packages/laminas-laminas-soap)[gusapi/gusapi

Gus Api Library for PHP

1351.5M8](/packages/gusapi-gusapi)[firstred/postnl-api-php

PostNL REST API PHP Bindings

27610.2k1](/packages/firstred-postnl-api-php)

PHPackages © 2026

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