Packages

An Elixir SDK for Porter's delivery API, providing a simple and reliable way to integrate Porter's logistics services into your Elixir applications. Features include getting delivery quotes, creating and managing delivery orders, and real-time order tracking.

Current section

Files

Jump to
ex_porter_sdk lib quote impl.ex
Raw

lib/quote/impl.ex

defmodule ExPorterSDK.Quote.Impl do
alias ExPorterSDK.ErrorHandler
def get_quote(params) do
config = ExPorterSDK.Config.get()
Req.get(config.base_url <> "/v1/get_quote",
json: params,
headers: [{"x-api-key", config.api_key}]
)
|> ErrorHandler.handle_response()
end
end