Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Pull request Compare This branch is 4 commits ahead of mpinchuk:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Forked from and updated to work with Laravel 5.4


Laravel-USPS is a composer package that allows you to integrate the USPS Address / Shipping API. This backage is ported from @author Vincent Gabriel

  • Requires a valid USPS API Username
  • Tested on Laravel 5+


Begin by installing this package through Composer. Run this command from the Terminal:

composer require mpinchuk/laravel-usps:dev-master

Laravel integration

To wire this up in your Laravel project you need to add the service provider. Open config/app.php, and add a new item to the providers array.


Then you must also specify the alias in config/app.php. Add a new item to the Aliases array.

'Usps' => 'Usps\Facades\Usps',

This will allow integration by adding the Facade Use Usps;

Laravel Config

Add your USPS username config in config/services.php.

'usps' => [
		'username' => "XXXXXXXXXXXX"

Example Controller Usage

The only method completed for Laravel is the Usps::validate which is defined in vendor/mpinchuk/laravel-usps/src/Usps/Usps.php. As this package was developed for internal use I did not bring over all the features but you are more than welcome to contribute the methods you need and I will merge them. I suggest looking at the original PHP-Wrapper by @VinceG USPS PHP-Api as I ported those clases and autoloaded them to use in the Usps.php file.


namespace app\Http\Controllers;
use app\Http\Requests;
use app\Http\Controllers\Controller;
use Illuminate\Support\Facades\Request;
use Usps;

class USPSController extends Controller
    public function index() {
        return response()->json(

@VinceG Original README.MD


This wrapper allows you to perform some basic calls to the USPS api. Some of the features currently supported are:

  • Rate Calculator (Both domestic and international)
  • Zip code lookup by address
  • City/State lookup by zip code
  • Verify address
  • Create Priority Shipping Labels
  • Create Open & Distribute Shipping Labels
  • Create International Shipping Labels (Express, Priority, First Class)
  • Service Delivery Calculator
  • Confirm Tracking


  • PHP >= 5.4 configured with the following extensions:
    • cURL
  • USPS API Username


You can’t perform that action at this time.