Created
September 29, 2012 10:25
-
-
Save joncalhoun/3803646 to your computer and use it in GitHub Desktop.
Buy postage with EasyPost and Python
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
import easypost | |
easypost.api_key = "ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ" | |
easypost.Postage.buy({ | |
"tracking": True, | |
"insurance": 135, | |
"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", | |
"street1": "300 Granelli Ave", | |
"city": "Half Moon Bay", | |
"state": "CA", | |
"zip": "94019" | |
}, | |
# Optionally | |
"description": "Postage for Customer 2012389237561", | |
"external_id": "31224974" | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment