ExQuickBooks (ex_quickbooks v0.9.0)

Copy Markdown View Source

Public entry points for configuring ExQuickBooks.

ExQuickBooks is a small Elixir client for the QuickBooks Online Accounting API. It focuses on a clear library surface: create a validated client, run OAuth flows, execute shared requests, and work with decoded QuickBooks maps.

Examples

iex> {:ok, %ExQuickBooks.Client{environment: :sandbox}} =
...>   ExQuickBooks.new(
...>     client_id: "client-id",
...>     client_secret: "client-secret",
...>     redirect_uri: "https://example.com/callback",
...>     realm_id: "9130357992221046"
...>   )

Summary

Functions

Builds a validated client for later QuickBooks requests.

Executes a shared QuickBooks request.

Builds a shared /v3/company/:realm_id/... request path.

Functions

new(options)

@spec new(keyword()) ::
  {:ok, ExQuickBooks.Client.t()} | {:error, ExQuickBooks.Error.t()}

Builds a validated client for later QuickBooks requests.

request(client, request, options \\ [])

@spec request(ExQuickBooks.Client.t(), ExQuickBooks.Request.t(), keyword()) ::
  {:ok, term()} | {:error, ExQuickBooks.Error.t()}

Executes a shared QuickBooks request.

request_path(client, path_segments, options \\ [])

@spec request_path(
  ExQuickBooks.Client.t(),
  [String.t() | atom() | integer()],
  keyword()
) :: String.t()

Builds a shared /v3/company/:realm_id/... request path.

Examples

iex> {:ok, client} =
...>   ExQuickBooks.new(
...>     client_id: "client-id",
...>     client_secret: "client-secret",
...>     redirect_uri: "https://example.com/callback",
...>     realm_id: "9130357992221046",
...>     minor_version: 75
...>   )
iex> ExQuickBooks.request_path(client, ["customer"], query: [active: true])
"/v3/company/9130357992221046/customer?active=true&minorversion=75"