Tipalti.Client (tipalti_client v1.0.0)

Copy Markdown View Source

Shared JSON/REST request helper used by Tipalti.Payees, Tipalti.Invoices, Tipalti.Payments, and the Tipalti.Procurement.* modules.

Handles URL/query building, JSON encoding/decoding, auth header injection (OAuth2 bearer token for :rest, static x-api-key for :procurement), and translates HTTP error responses into the Tipalti.Error hierarchy.

Summary

Functions

Performs a JSON request against either the REST or Procurement API.

Types

api()

@type api() :: :rest | :procurement

Functions

request(api, config, method, path, opts \\ [])

@spec request(api(), Tipalti.Config.t(), Tipalti.HTTP.method(), String.t(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Performs a JSON request against either the REST or Procurement API.

Options

  • :query — map/keyword of query string params.
  • :json — a term to JSON-encode as the request body.
  • :headers — additional request headers.
  • :operation — an atom used only for telemetry metadata and error messages (e.g. :list_payees).