Shippex.Shipment (shippex v0.18.0) View Source
A Shipment
represents everything needed to fetch rates from carriers: an
origin, a destination, and a package description. An optional :id
field
is provided in the struct, which may be used by the end user to represent the
user's internal identifier for the shipment. The id is not used by Shippex.
Shipments are created by shipment/3
.
Link to this section Summary
Link to this section Types
Specs
t() :: %Shippex.Shipment{ from: Shippex.Address.t(), id: any(), package: Shippex.Package.t(), ship_date: any(), to: Shippex.Address.t() }
Link to this section Functions
Specs
new(Shippex.Address.t(), Shippex.Address.t(), Shippex.Package.t(), Keyword.t()) :: {:ok, t()} | {:error, String.t()}
Builds a Shipment
.
Specs
new!(Shippex.Address.t(), Shippex.Address.t(), Shippex.Package.t(), Keyword.t()) :: t() | none()
Builds a Shipment
. Raises on failure.