Getting Started

This guide assists users in shipping their first package with EasyPost, outlining the necessary steps from setup to label generation.


Prerequisites

Account Registration

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.

Carrier Account Registration

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.

Software Requirements

Download an EasyPost Client Library or utilize the REST API with cURL.

Documentation Review

Examine the EasyPost Objects section to understand the API's structure, which is critical for constructing requests and interpreting responses.


Shipping Process

Step 1: Create a Shipment and Retrieve Rates

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!

POST /shipments
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  }'

Step 2: Buy and Generate a Shipping Label

Buying and generating a shipping label involves selecting a shipping rate, purchasing the label, and retrieving it for printing.

Label Purchase

  • In client libraries, use the buy method on the Shipment object and pass the id 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.

Label Retrieval

  • 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 the Shipment object.
  • Labels are typically in PNG format, but other formats can be requested.

Tracker ID Management

  • 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.
POST /shipments/:id/buy
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  }'

Additional Resources

Support and Troubleshooting

EasyPost offers support to assist with FAQs, troubleshooting issues, and inquiries related to the EasyPost platform.

Please visit the Help Center for more information.


Talk to a Shipping Expert

For questions about getting started with the EasyPost API please talk to a Shipping Expert or contact our Support team.