Tipalti.Config (tipalti_client v1.0.0)

Copy Markdown View Source

Holds credentials and connection settings for all three Tipalti API families. Build one with new/1 and pass it as the first argument to every Tipalti.* function.

Nothing here is validated eagerly against Tipalti's servers — validation is limited to shape/presence checks so that misconfiguration fails fast, locally, with a clear message instead of a confusing HTTP error.

Summary

Types

mode()

@type mode() :: :sandbox | :production

procurement_opts()

@type procurement_opts() :: [{:api_key, String.t()}]

rest_opts()

@type rest_opts() :: [client_id: String.t(), client_secret: String.t()]

soap_opts()

@type soap_opts() :: [payer_name: String.t(), api_key: String.t()]

t()

@type t() :: %Tipalti.Config{
  max_retries: non_neg_integer(),
  mode: mode(),
  procurement: %{optional(:api_key) => String.t()},
  procurement_base_url: String.t(),
  receive_timeout: pos_integer(),
  rest: %{
    optional(:client_id) => String.t(),
    optional(:client_secret) => String.t()
  },
  rest_base_url: String.t(),
  soap: %{optional(:payer_name) => String.t(), optional(:api_key) => String.t()},
  soap_base_url: String.t(),
  soap_version: String.t(),
  telemetry_prefix: [atom()]
}

Functions

new(opts \\ [])

@spec new(keyword()) :: t()

Builds a new Tipalti.Config.

Options

  • :mode:sandbox (default) or :production. Selects the default base URL for every API family unless overridden below.
  • :rest[client_id: ..., client_secret: ...] for the modern OAuth2 REST API.
  • :soap[payer_name: ..., api_key: ...] for the legacy SOAP API.
  • :procurement[api_key: ...] for the Procurement REST API.
  • :rest_base_url, :soap_base_url, :procurement_base_url — override the computed base URL for that API family (useful for tests or self-hosted proxies).
  • :soap_version — SOAP endpoint version segment, defaults to "v11".
  • :receive_timeout — per-request timeout in milliseconds (default 30_000).
  • :max_retries — retry attempts for idempotent/safe requests on transient failures (default 3).

Only the sections you actually use need to be populated — e.g. a config built with only :soap opts is fine as long as you only call Tipalti.SOAP.* functions with it.