Events are triggered by changes in objects you've created via the API. Every time an Event related to one of your objects is created, EasyPost will send a POST request to each of the webhook URLs set up for your account.
Event objects are serialized into JSON and sent in the body of the request to your webhook URLs. The 'description' attribute is significant - it contains two values: a result object type, and an event name, separated by a period. For example, the description 'tracker.updated' indicates that the Event result attribute will contain a Tracker object that has just been updated.
{
"id": "evt_qatAiJDM",
"object": "Event",
"created_at": "2014-11-19T10:51:54Z",
"updated_at": "2014-11-19T10:51:54Z",
"description": "tracker.updated",
"mode": "test",
"previous_attributes": {
"status": "unknown"
},
"pending_urls": [],
"completed_urls": [],
"result": {
"id": "trk_Txyy1vaM",
"object": "Tracker",
"mode": "test",
"tracking_code": "EZ4000000004",
"status": "delivered",
"created_at": "2014-11-18T10:51:54Z",
"updated_at": "2014-11-18T10:51:54Z",
"signed_by": "John Tester",
"weight": 17.6,
"est_delivery_date": "2014-08-27T00:00:00Z",
"shipment_id": null,
"carrier": "UPS",
"public_url": "https://track.easypost.com/djE7...",
"tracking_details": [
{
"object": "TrackingDetail",
"message": "BILLING INFORMATION RECEIVED",
"status": "pre_transit",
"datetime": "2014-08-21T14:24:00Z",
"tracking_location": {
"object": "TrackingLocation",
"city": null,
"state": null,
"country": null,
"zip": null
}
},
{
"object": "TrackingDetail",
"message": "ORIGIN SCAN",
"status": "in_transit",
"datetime": "2014-08-21T14:48:00Z",
"tracking_location": {
"object": "TrackingLocation",
"city": "SOUTH SAN FRANCISCO",
"state": "CA",
"country": "US",
"zip": null
}
},
{
"object": "TrackingDetail",
"message": "DEPARTURE SCAN",
"status": "in_transit",
"datetime": "2014-08-22T08:51:00Z",
"tracking_location": {
"object": "TrackingLocation",
"city": "SOUTH SAN FRANCISCO",
"state": "CA",
"country": "US",
"zip": null
}
},
{
"object": "TrackingDetail",
"message": "ARRIVAL SCAN",
"status": "in_transit",
"datetime": "2014-08-23T09:31:00Z",
"tracking_location": {
"object": "TrackingLocation",
"city": "SAN FRANCISCO",
"state": "CA",
"country": "US",
"zip": null
}
},
{
"object": "TrackingDetail",
"message": "OUT FOR DELIVERY",
"status": "out_for_delivery",
"datetime": "2014-08-24T08:10:00Z",
"tracking_location": {
"object": "TrackingLocation",
"city": "SAN FRANCISCO",
"state": "CA",
"country": "US",
"zip": null
}
},
{
"object": "TrackingDetail",
"message": "DELIVERED",
"status": "delivered",
"datetime": "2014-08-24T15:33:00Z",
"tracking_location": {
"object": "TrackingLocation",
"city": "SAN FRANCISCO",
"state": "CA",
"country": "US",
"zip": null
}
}
]
}
}