beaudierman / ups

A Laravel package used to communicate with the UPS API to generate shipment rate quotes.
MIT License
12 stars 7 forks source link

Weight is measured in... lbs? #1

Closed carcinocron closed 10 years ago

carcinocron commented 10 years ago

Does the UPS API support any unit of weight other than LBS? I couldn't find UPS's actual API docs, all I could find was their "What is an API page?" and every link that looked relevant just looped back to that.

README.md could be a little bit more explicit about using LBS though.

beaudierman commented 10 years ago

I contacted UPS and found that they accept both LBS and KG. The package has been updated to include an optional measurement identifier:

$return = Ups::getQuote(
    array(
        'access_key' => 'your key',
        'username' => 'your username',
        'password' => 'your password',
        'account_number' => 'your account number',
    ),
    array(
        'from_zip' => '37902',
        'to_zip' => 90210,
        'packages' => 1,
        'weight' => 50,
        'measurement' => 'LBS' // Currently the UPS API will only allow LBS and KG, default is LBS
    )
);
carcinocron commented 10 years ago

Thanks! sorry for the inconvenience.