View Source ExCheckout.Shipment (ex_checkout v1.5.2)
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 ExCheckout.
Shipments are created by shipment/3
.
Link to this section Summary
Link to this section Types
@type t() :: %ExCheckout.Shipment{ from: ExCheckout.Address.t(), id: any(), package: ExCheckout.Package.t(), ship_date: any(), to: ExCheckout.Address.t() }
Link to this section Functions
@spec new( ExCheckout.Address.t(), ExCheckout.Address.t(), ExCheckout.Package.t(), Keyword.t() ) :: {:ok, t()}
Builds a Shipment
.
@spec new!( ExCheckout.Address.t(), ExCheckout.Address.t(), ExCheckout.Package.t(), Keyword.t() ) :: t() | none()
Builds a Shipment
. Raises on failure.