shippex v0.6.3 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.

For USPS, a package has a container string which can be one of the pre-defined USPS containers.

%Shippex.Package{length: 8
                 width: 8,
                 height: 8,
                 weight: 5.5,
                 monetary_value: 100}

Link to this section Summary

Functions

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

Link to this type t()
t() :: %Shippex.Package{container: term, description: term, girth: term, height: term, length: term, monetary_value: term, weight: term, width: term}

Link to this section Functions

Link to this function usps_containers()
usps_containers() :: %{optional(atom) => String.t}

Returns a map of predefined containers for use with USPS. These can be passed to package.container for fetching rates.

Link to this function usps_flat_rate_containers()
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).