shippex v0.6.8 Shippex.Package
Defines the struct for storing a Package
, which is then passed along with
an origin and destination address for shipping estimates. A description
is
optional, as it may or may not be used with various carriers.
The monetary_value
might be required depending on the origin/destination
countries of the shipment. Both monetary_value
and insurance
are integers
stored in USD cents.
For USPS, a package has a container
string which can be one of the
pre-defined USPS containers.
Shippex.Package.package(%{length: 8
width: 8,
height: 8,
weight: 5.5,
monetary_value: 100_00})
Link to this section Summary
Functions
Builds and returns a Package
. Use this instead of directly initializing
the struct
Returns a map of predefined containers for use with USPS. These can be
passed to package.container
for fetching rates
Returns a map of flat rate USPS containers, along with their string description and flat shipping rate (in cents)
Link to this section Types
t() :: %Shippex.Package{container: term, description: term, girth: term, height: term, insurance: term, length: term, monetary_value: term, weight: term, width: term}
Link to this section Functions
new(%{length: number, width: number, height: number, weight: number}) :: t
Builds and returns a Package
. Use this instead of directly initializing
the struct.
Returns a map of predefined containers for use with USPS. These can be
passed to package.container
for fetching rates.
usps_flat_rate_containers() :: %{optional(atom) => flat_rate_container}
Returns a map of flat rate USPS containers, along with their string description and flat shipping rate (in cents).