Codat (codat v1.0.0)

Copy Markdown View Source

Production-grade Elixir client for the Codat API.

Quick Start

client = Codat.client()

{:ok, company} = Codat.Platform.Companies.create(client, %{name: "Acme Corp"})
redirect_to(company["redirect"])

{:ok, page} = Codat.Accounting.Invoices.list(client, company["id"])

Configuration

config :codat,
  api_key: System.get_env("CODAT_API_KEY"),
  http_timeout: 30_000,
  max_retries: 3

Summary

Functions

Creates a %Codat.Client{} using application config and environment.

Creates a %Codat.Client{} with the given options.

Returns the current application configuration.

Returns the version of the codat hex package.

Functions

client()

@spec client() :: Codat.Client.t()

Creates a %Codat.Client{} using application config and environment.

client(opts)

@spec client(keyword()) :: Codat.Client.t()

Creates a %Codat.Client{} with the given options.

config()

@spec config() :: Codat.Config.t()

Returns the current application configuration.

version()

@spec version() :: String.t()

Returns the version of the codat hex package.