Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.22 KB

File metadata and controls

41 lines (28 loc) · 1.22 KB

USPS Driver

Back to the Core Drivers list

This is a driver for the USPS API. Check out the repository on GitHub for more information.

Installation

First, install the USPS driver via the Composer package manager:

composer require parceltrap/driver-usps

Configuration

In your config/parceltrap.php configuration file, add the following to the drivers key:

'usps' => [
    'api_key' => env('PARCELTRAP_USPS_API_KEY'),
    'source_id' => env('PARCELTRAP_USPS_SOURCE_ID', env('APP_NAME')),
],

You can get these details by registering for the USPS API. To find out more, visit the Track & Confirm API reference. This documentation page also shows the raw USPS-specific data that can be found in the returned TrackingDetails DTO.

Usage

$driver = \ParcelTrap\Facades\ParcelTrap::driver('usps');

$driver->find('XXXXXXXXXXXXXXXXXX'); // ParcelTrap\DTOs\TrackingDetails