Download the PHP package johnpaulmedina/laravel-usps without Composer
On this page you can find all versions of the php package johnpaulmedina/laravel-usps. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download johnpaulmedina/laravel-usps
More information about johnpaulmedina/laravel-usps
Files in johnpaulmedina/laravel-usps
Package laravel-usps
Short Description USPS Addresses API v3 (OAuth2) for Laravel
License MIT
Homepage https://github.com/johnpaulmedina/laravel-usps/
Informations about the package laravel-usps
Laravel-USPS
Full Laravel package for the USPS API v3 (OAuth2). Covers all 20 USPS API domains: addresses, tracking, labels, international labels, domestic prices, international prices, service standards, locations, carrier pickup, containers, payments, campaigns, package campaigns, adjustments, disputes, appointments, shipping options, and SCAN forms.
Note: The legacy USPS Web Tools XML API was retired in January 2026. This package uses the new OAuth2-based REST/JSON API at
apis.usps.com.Reference: Official USPS API examples and OpenAPI specs at github.com/USPS/api-examples.
Requirements
- PHP 8.1+
- Laravel 10, 11, 12, or 13
- USPS API credentials from developer.usps.com
Installation
The service provider and facade are auto-discovered.
Configuration
Publish the config file:
This creates config/usps.php:
Add your credentials to .env:
Artisan Commands
All commands output formatted tables to the console.
Usage
All API domains are accessible via the Usps facade. Address methods are called directly; all other domains are accessed through fluent accessor methods that return typed API clients.
Addresses
Response:
DPV (Delivery Point Validation) confirms whether a specific address is a real USPS deliverable location — down to the apartment/suite level.
Code Meaning YFull match — both street and unit confirmed DPrimary address confirmed, apartment/suite missing SPrimary confirmed, apartment/suite provided but doesn't match NNot a valid delivery point
When apartment is missing (e.g., multi-unit building):
Correction codes:
32= apartment/suite needed,22= multiple addresses found.
Response:
Response:
Response:
Note: State names are auto-converted to abbreviations (
Florida→FL). ZIP codes with dashes are auto-split (20500-0005→ ZIP5:20500, ZIP4:0005).USPS Address API Documentation: developer.usps.com/api/81 — full response field definitions, DPV codes, correction codes, and error handling.
Tracking
Domestic Labels
International Labels
Domestic Prices
International Prices
Service Standards
Service Standards Directory
Service Standards Files
International Service Standards
Locations
Carrier Pickup
Containers
Payments
Informed Delivery Campaigns (Mail)
Informed Delivery Package Campaigns
Adjustments
Disputes
Appointments (FAST)
Shipping Options
SCAN Forms
API Domains
| Domain | Facade Accessor | Endpoints |
|---|---|---|
| Addresses | Direct methods | 3 |
| Tracking | tracking() |
3 |
| Domestic Labels | labels() |
12 |
| International Labels | internationalLabels() |
4 |
| Domestic Prices | domesticPrices() |
5 |
| International Prices | internationalPrices() |
5 |
| Service Standards | serviceStandards() |
2 |
| Service Standards Directory | serviceStandardsDirectory() |
2 |
| Service Standards Files | serviceStandardsFiles() |
2 |
| International Service Standards | internationalServiceStandards() |
1 |
| Locations | locations() |
3 |
| Carrier Pickup | carrierPickup() |
5 |
| Containers | containers() |
5 |
| Payments | payments() |
2 |
| Campaigns | campaigns() |
9 |
| Package Campaigns | packageCampaigns() |
6 |
| Adjustments | adjustments() |
1 |
| Disputes | disputes() |
1 |
| Appointments | appointments() |
4 |
| Shipping Options | shippingOptions() |
1 |
| SCAN Forms | scanForms() |
3 |
Authentication
The package automatically handles OAuth2 client credentials flow. Access tokens are cached per-scope for ~50 minutes to minimize token requests. Each API domain requests only the scopes it needs.
License
MIT
All versions of laravel-usps with dependencies
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/cache Version ^10.0 || ^11.0 || ^12.0 || ^13.0