EasyPost Objects

The EasyPost API consists of many object types. There are several attributes that are consistent across all objects:

  • id: Every EasyPost object that can be created through the API has an id field that is used to refer to the object in other API calls. An id consists of a prefix based on the object type (e.g. a Shipment objects has the prefix "shp_") followed by 32 hex characters. These id values may be used in many API endpoints to refer to an existing object rather than specifying the full object definition; for example, when creating a Shipment, you may specify the to_address either with all fields (street1, city, zip, etc.) filled, or you may reuse an existing Address by specifying only the id field value as the matching Address's id, omitting all other fields.

  • object: Every first-class EasyPost object includes an object value. This can be useful for identifying the types of nested objects, or for cases such as a webhook Event which can contain many different values for a result. For objects where there are many variant types, such as a Fee object, the object value represents the supertype, and the type represents the subtype for that object.

  • reference: Many EasyPost objects also have an optional reference field that may be assigned during creation. The reference values you assign may be used in place of id values in many API endpoints, but we recommend using the EasyPost-assigned id instead because IDs are guaranteed to be unique within the system, while reference uniqueness is not enforced. If your system does not enforce uniqueness on the references you submit, this may result in the wrong one of many objects with the same reference being picked in EasyPost's handling of your API request.

  • created_at/updated_at: Most API objects also include values for created_at and updated_at. These two fields respectively specify the time the object was created and most recently updated. These datetime fields are formatted according to ISO 8601.

The majority of EasyPost API objects are immutable, meaning that once they are created, their properties cannot be altered. Please consider this when developing workflows that create and manage EasyPost objects.