sujanshresthanet / ups-rates
A simple tool to return UPS shipping rates.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/sujanshresthanet/ups-rates
Requires
- php: ^7.2
- illuminate/support: ^6.0
This package is auto-updated.
Last update: 2025-10-07 23:58:52 UTC
README
UPS Rates Description
This package is used to send shipment rate quote requests to the UPS webservice.
Install using Composer, edit your composer.json file to include:
"require": {
	"sujanshresthanet/ups-rates": "1.*"
}
Update composer from the command line:
composer update
Add a new Service Provider to the providers array in your app/config/app.php file:
'Shipment_ups\Ups\UpsServiceProvider'
Add a class alias in the same configuration file to the aliases array:
'Ups'             => 'Shipment_ups\Ups\Facades\Ups'
Example:
$return = Ups::getQuote(
    array(
        'access_key' => 'your key',
        'username' => 'your username',
        'password' => 'your password',
        'account_number' => 'your account number',
    ),
	array(
		'from_zip' => '37902',
        'from_state' => 'TN', // Optional, may yield a more accurate quote
        'from_country' => 'US', // Optional, defaults to US
		'to_zip' => '90210',
        'to_state' => 'CA', // Optional, may yield a more accurate quote
        'to_country' => 'US', // Optional, defaults to US
		'packages' => 1,
		'weight' => 50,
        'measurement' => 'LBS', // Currently the UPS API will only allow LBS and KG, default is LBS
        'negotiated_rates' => true // Optional, set true to return negotiated rates from UPS
	)
);
Returns:
Array
(
    [03] => Array
        (
            [service] => UPS Ground
            [rate] => 52.32
        )
    [12] => Array
        (
            [service] => UPS 3 Day Select
            [rate] => 145.09
        )
    [02] => Array
        (
            [service] => UPS 2nd Day Air
            [rate] => 235.40
        )
    [01] => Array
        (
            [service] => UPS Next Day Air
            [rate] => 301.46
        )
)