ExEasyPost

Build Status

EasyPost client library for Elixir.

https://hexdocs.pm/ex_easypost

Installation

def deps do
  [
    {:ex_easypost, "~> 0.1"},
    {:httpoison, "~> 0.11"},
    {:poison, "~> 2.2 or ~> 3.0"}
  ]
end

Usage

ExEasyPost takes a data driven approach to making API requests. Each function meant to perform an API action will generate a struct which can then be used to perform a particular operation.

ExEasyPost.Address.get("adr_a6fd5dd822c94bdfa1e3f2d28a4dbf9b") |> ExEasyPost.request
#> {:ok, response}

You can also pass client configuration per request.

ExEasyPost.Address.get("adr_a6fd5dd822c94bdfa1e3f2d28a4dbf9b") |> ExEasyPost.request(api_key: "xxxx")
#> {:ok, response}

You can also provide an application wide config.

# config.exs
config :ex_easypost, api_key: {:system, "EASYPOST_API_KEY"}

Supported Endpoints