Tracking with EasyPost

Generating a public url to send your customers is simple:

  1. require 'easypost'
  2. EasyPost.api_key = "<YOUR_API_KEY>"
  3. tracker = EasyPost::Tracker.create({
  4. tracking_code: "9400110898825022579493",
  5. carrier: "USPS"
  6. })
  1. {
  2. ...
  3. "id": "trk_a1b2c3d4",
  4. "tracking_code": "9400110898825022579493",
  5. "status": "in_transit",
  6. "created_at": "2016-01-13T21:52:28Z",
  7. "updated_at": "2016-01-13T21:52:32Z",
  8. "est_delivery_date": null,
  9. "carrier": "USPS",
  10. "tracking_details": [...],
  11. "public_url": "https://track.easypost.com/..."
  12. }