shippex v0.4.4 Shippex.Service

A Service represents a carrier’s offered shipping speeds. This is not initialized by the user directly. However, some convenience functions exist to display all offered carrier services to the user.

iex> Shippex.Service.services_for_carrier(:ups)
[
  %Shippex.Service{carrier: :ups, code: "01", description: "UPS Next Day Air"},
  %Shippex.Service{carrier: :ups, code: "02", description: "UPS 2nd Day Air"},
  %Shippex.Service{carrier: :ups, code: "12", description: "UPS 3 Day Select"},
  %Shippex.Service{carrier: :ups, code: "03", description: "UPS Ground"}
]

Link to this section Summary

Functions

Returns all services from all supported carriers

Returns a service from a carrier by its code, if it exists. Otherwise, returns nil

Link to this section Types

Link to this type t()
t() :: %Shippex.Service{carrier: term, code: term, description: term}

Link to this section Functions

Returns all services from all supported carriers.

Link to this function by_carrier_and_code(carrier, code)

Returns a service from a carrier by its code, if it exists. Otherwise, returns nil.

iex> Shippex.Service.by_carrier_and_code(:ups, "01")
%Shippex.Service{carrier: :ups, code: "01", description: "UPS Next Day Air"},
iex> Shippex.Service.by_carrier_and_code(:ups, "999999999")
nil
Link to this function services_for_carrier(carrier, ori_country \\ "US", dst_country \\ "US")

Returns all services for carrier.

Shippex.Service.services_for_carrier(:ups)