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 anidfield that is used to refer to the object in other API calls. Anidconsists of a prefix based on the object type (e.g. aShipmentobjects has the prefix "shp_") followed by 32 hex characters. Theseidvalues may be used in many API endpoints to refer to an existing object rather than specifying the full object definition; for example, when creating aShipment, you may specify theto_addresseither with all fields (street1,city,zip, etc.) filled, or you may reuse an existingAddressby specifying only theidfield value as the matchingAddress'sid, omitting all other fields. -
object: Every first-class EasyPost object includes anobjectvalue. This can be useful for identifying the types of nested objects, or for cases such as a webhookEventwhich can contain many different values for aresult. For objects where there are many variant types, such as aFeeobject, theobjectvalue represents the supertype, and thetyperepresents the subtype for that object. -
reference: Many EasyPost objects also have an optionalreferencefield that may be assigned during creation. The reference values you assign may be used in place ofidvalues in many API endpoints, but we recommend using the EasyPost-assignedidinstead 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 samereferencebeing picked in EasyPost's handling of your API request. -
created_at/updated_at: Most API objects also include values forcreated_atandupdated_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.