Shippex.Shipment (shippex v0.17.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

Functions

Builds a Shipment. Raises on failure.

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

Link to this function

new(from, to, package, opts \\ [])

View Source

Specs

new(Shippex.Address.t(), Shippex.Address.t(), Shippex.Package.t(), Keyword.t()) ::
  {:ok, t()} | {:error, String.t()}

Builds a Shipment.

Link to this function

new!(from, to, package, opts \\ [])

View Source

Specs

Builds a Shipment. Raises on failure.