ShipHawk

EbertBuild StatusCoverage Status

This is an abstraction of Shiphawk API to Elixir applications. It comes with a nice and clean DSL that easily enable projects to integrate with ShipHawk.

Installation

If available in Hex, the package can be installed by adding shiphawk to your list of dependencies in mix.exs:

def deps do
  [
    {:shiphawk, "~> 0.1.0"}
  ]
end

Make sure you also add the necessary configuration:

config :shiphawk, api_key: "your_api_key"

Supported Endpoints

These are the supported API groups currenlty supported:

Rates

Getting Rates

Shiphawk.Rates.get/3 is used to get shipping rates

Parameters

Example

items = [%{
  package_type: "box",
  item_type: "handling_unit",
  handling_unit_type: "pallet", # Must be "pallet", "carton", "box", "crate", or "bag"
  length: "10",
  width: "10",
  height: "11",
  weight: "10",
  value: 100.00
}]

from = %{ "zip" => "93101"}
to = %{ "zip" => "60060"}

Shiphawk.Rates.get(items, from, to)

# {
#   :ok,
#   %{"rates" => [...]}
#  }

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/shiphawk.