Getting Started
This guide assists users in shipping their first package with EasyPost, outlining the necessary steps from setup to label generation.
Sign up for an EasyPost account to obtain a Test and Production API key. See Authentication and Key Management for more information.
Note: Negotiated rates are only available in Production mode.
Upon sign-up with EasyPost, users gain immediate access to Default Carrier Accounts, which can be enabled directly from the Dashboard. For additional carriers, EasyPost supports a Bring Your Own Account (BYOA) option. This requires users to register directly with the respective carrier.
Download an EasyPost Client Library or utilize the REST API with cURL.
Examine the EasyPost Objects section to understand the API's structure, which is critical for constructing requests and interpreting responses.
To create and rate a shipment, the API allows the to_address
, from_address
, and parcel
objects nested within the shipment object to be defined.
These objects do not need to be pre-created; they are created during the shipment creation process.
Additionally, insurance may be added during the purchase. To specify an amount to insure, pass the insurance attribute as a string. The currency of all insurance is U.S. Dollars (USD).
Add more carriers to the EasyPost Dashboard to receive rates beyond the default USPS options!
1curl -X POST https://api.easypost.com/v2/shipments \
2 -u "EASYPOST_API_KEY": \
3 -H 'Content-Type: application/json' \
4 -d '{
5 "shipment": {
6 "to_address": {
7 "name": "Dr. Steve Brule",
8 "street1": "179 N Harbor Dr",
9 "city": "Redondo Beach",
10 "state": "CA",
11 "zip": "90277",
12 "country": "US",
13 "phone": "8573875756",
14 "email": "dr_steve_brule@gmail.com"
15 },
16 "from_address": {
17 "name": "EasyPost",
18 "street1": "417 Montgomery Street",
19 "street2": "5th Floor",
20 "city": "San Francisco",
21 "state": "CA",
22 "zip": "94104",
23 "country": "US",
24 "phone": "4153334445",
25 "email": "support@easypost.com"
26 },
27 "parcel": {
28 "length": "20.2",
29 "width": "10.9",
30 "height": "5",
31 "weight": "65.9"
32 },
33 "customs_info": {
34 "id": "cstinfo_..."
35 }
36 }
37 }'
Buying and generating a shipping label involves selecting a shipping rate, purchasing the label, and retrieving it for printing.
- In client libraries, use the
buy
method on theShipment
object and pass theid
of the chosen rate. - For REST API users, POST the chosen rate
id
to the shipment resource. - Client libraries have convenience functions for automatically selecting the lowest available rate every time.
- After purchasing the label, a URL for the label image is provided for download and printing.
- This URL is located in the
postage_label.label_url
property of theShipment
object. - Labels are typically in PNG format, but other formats can be requested.
- The response from EasyPost includes a tracking
id
for the package. See the Tracking Guide for additional information. - This tracker
id
can be used for internal storage or provided to customers for tracking. - EasyPost also offers automatic tracking updates through webhooks.
1curl -X POST https://api.easypost.com/v2/shipments/shp_.../buy \
2 -u "EASYPOST_API_KEY": \
3 -H 'Content-Type: application/json' \
4 -d '{
5 "rate": {
6 "id": "rate_..."
7 },
8 "insurance": "249.99"
9 }'
EasyPost offers support to assist with FAQs, troubleshooting issues, and inquiries related to the EasyPost platform.
Please visit the Help Center for more information.
For questions about getting started with the EasyPost API please talk to a Shipping Expert or contact our Support team.