Download the PHP package ktscript/fedex-rest without Composer
On this page you can find all versions of the php package ktscript/fedex-rest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package fedex-rest
FedEx REST API
PHP package for integrating with FedEx REST API. This package provides a simple and intuitive interface for working with FedEx services including tracking, shipping, and address validation.
Features
- 🚀 Easy Integration - Simple, fluent API for interacting with FedEx services
- 🔐 OAuth 2.0 Support - Built-in authorization handling
- 📦 Shipping Labels - Create shipping labels and track packages
- 📍 Address Validation - Validate addresses using FedEx API
- 📌 Location Search - Find FedEx pickup/dropoff locations by address, coordinates, or phone
- 🔄 Environment Switching - Switch between sandbox and production environments easily
- 🎯 Laravel Compatible - Works seamlessly with Laravel 7-12+ using Conditionable trait
- 🔧 Fluent Interface - Chainable methods for building requests
Requirements
- PHP >= 7.2.5
- Laravel 7-12+ (or illuminate/support package)
- Guzzle HTTP Client ^6|^7
- JSON extension
Installation
Install the package via Composer:
Configuration
Getting FedEx API Credentials
- Register for a FedEx Developer account at FedEx Developer Portal
- Create a new application to get your
client_idandclient_secret - Choose between sandbox (testing) or production environment
Usage
Authorization
First, you need to obtain an access token using your FedEx credentials:
Tracking Packages
Track one or multiple packages by tracking number:
Creating Shipping Labels
Create shipping labels for packages:
Address Validation
Validate addresses using FedEx address validation service:
Location Search (FedEx Location API)
Search for FedEx pickup and dropoff locations by address, coordinates, or phone:
The response is a decoded object. Main keys:
output.totalResults,output.resultsReturned— count of locationsoutput.locationDetailList— array of locations (each hasdistance,contactAndAddresswithaddress/contact/displayName,locationId,storeHours,carrierDetailList,locationType,locationCapabilities, etc.)output.nearestLocation,output.latestLocation— single location objects when applicableoutput.matchedAddress— normalized search addressoutput.alerts— optional messages
Environment Switching
The package supports easy switching between sandbox (testing) and production environments:
Raw Response
Get raw HTTP response instead of decoded JSON:
Available Service Types
Use constants from FedexRest\Services\Ship\Type\ServiceType:
ServiceType::_FEDEX_GROUNDServiceType::_FEDEX_2_DAYServiceType::_STANDARD_OVERNIGHTServiceType::_PRIORITY_OVERNIGHTServiceType::_INTERNATIONAL_PRIORITY- And many more...
Available Packaging Types
Use constants from FedexRest\Services\Ship\Type\PackagingType:
PackagingType::_YOUR_PACKAGINGPackagingType::_FEDEX_BOXPackagingType::_FEDEX_ENVELOPEPackagingType::_FEDEX_PAK- And more...
Available Pickup Types
Use constants from FedexRest\Services\Ship\Type\PickupType:
PickupType::_USE_SCHEDULED_PICKUPPickupType::_DROPOFF_AT_FEDEX_LOCATIONPickupType::_CONTACT_FEDEX_TO_SCHEDULE
Exception Handling
The package throws specific exceptions for missing required data:
MissingAccessTokenException- When access token is not providedMissingAuthCredentialsException- When client credentials are missingMissingTrackingNumberException- When tracking number is not providedMissingAccountNumberException- When account number is missingMissingLineItemException- When line items are not provided
Advanced Usage
Custom Request Parameters
For shipping labels, you can customize request parameters:
Laravel Integration
This package works seamlessly with Laravel 7-12+. The switchableEnv trait uses Laravel's Conditionable trait, allowing you to use the when() method:
Support
For issues, questions, or contributions, please visit:
- GitHub Issues
- Telegram: @ktscript — contact the author
License
This package is open-sourced software licensed under the MIT license.
Credits
Special thanks to Sinnbeck for the help and contributions.
Changelog
1.2.1-1.2.5
- Fix Location API
- Add
LocationTypeconstants - Add
LocationSearchRequest - Add
LocationSearchResponse - Add
LocationSearchResponseItem
1.2.0
- FedEx Location API: search pickup/dropoff locations by address, coordinates, or phone
LocationSearchRequestandLocationTypeconstants- Support contact: Telegram @ktscript added to README and composer.json
1.0.0
- Initial stable release
- Support for Laravel 7-12+
- OAuth 2.0 authorization
- Package tracking
- Shipping label creation
- Address validation
- Environment switching (sandbox/production)
- Fluent interface with method chaining
All versions of fedex-rest with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^6|^7
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0