Skip to content

Instantly share code, notes, and snippets.

@joncalhoun
Created September 29, 2012 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joncalhoun/3803646 to your computer and use it in GitHub Desktop.
Save joncalhoun/3803646 to your computer and use it in GitHub Desktop.
Buy postage with EasyPost and Python
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