Created
September 29, 2012 00:31
-
-
Save joncalhoun/3802734 to your computer and use it in GitHub Desktop.
Buying postage with EasyPost and Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "easypost" | |
Easypost.api_key = "ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ" | |
EasyPost::Postage.buy( | |
:parcel => { | |
:weight => 1.1, | |
:height => 12, | |
:width => 14, | |
:length => 7 | |
}, | |
:to => { | |
:name => "Reed Rothchild", | |
:street1 => "101 California St", | |
:street2 => "Suite 1290", | |
:city => "San Francisco", | |
:state => "CA", | |
:zip => "94111" | |
}, | |
:from => { | |
:name => "Dirk Diggler", | |
:phone => "3108085243", | |
:street1 => "300 Granelli Ave", | |
:city => "Half Moon Bay", | |
:state => "CA", | |
:zip => "94019" | |
}, | |
:carrier => "USPS", | |
:service => "Express" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment