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 anid
field that is used to refer to the object in other API calls. Anid
consists of a prefix based on the object type (e.g. aShipment
objects has the prefix "shp_") followed by 32 hex characters. Theseid
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 aShipment
, you may specify theto_address
either with all fields (street1
,city
,zip
, etc.) filled, or you may reuse an existingAddress
by specifying only theid
field value as the matchingAddress
'sid
, omitting all other fields. -
object
: Every first-class EasyPost object includes anobject
value. This can be useful for identifying the types of nested objects, or for cases such as a webhookEvent
which can contain many different values for aresult
. For objects where there are many variant types, such as aFee
object, theobject
value represents the supertype, and thetype
represents the subtype for that object. -
reference
: Many EasyPost objects also have an optionalreference
field that may be assigned during creation. The reference values you assign may be used in place ofid
values in many API endpoints, but we recommend using the EasyPost-assignedid
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 samereference
being picked in EasyPost's handling of your API request. -
created_at
/updated_at
: Most API objects also include values forcreated_at
andupdated_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.