Core HTTP client for all Plaid API requests.
Provides authentication injection, idempotency keys, exponential backoff with full jitter, circuit breaker integration, rate limiting, and structured telemetry events.
OpenTelemetry tracing is handled separately by
PlaidEx.Telemetry.OpenTelemetry — kept out of this module to
prevent macro-expansion issues with Dialyzer.
Telemetry events
[:plaid_ex, :http, :start]— request initiated[:plaid_ex, :http, :stop]— successful response[:plaid_ex, :http, :error]— failed (after all retries)[:plaid_ex, :http, :retry]— retry scheduled
Summary
Functions
Executes a POST request to the Plaid API.
Types
@type request_opts() :: [ tenant_id: String.t() | nil, idempotency_key: String.t() | nil, timeout_ms: pos_integer() | nil, response: :json | :binary ]
Functions
@spec post(String.t(), map(), PlaidEx.Config.t(), request_opts()) :: {:ok, map() | binary()} | {:error, PlaidEx.Error.t()}
Executes a POST request to the Plaid API.
Returns {:ok, response_body} on HTTP 2xx, or {:error, PlaidEx.Error.t()}
on any failure including after all retries are exhausted.
Pass response: :binary in opts for endpoints that return a raw
file body (e.g. Asset Report and statement PDFs) instead of JSON —
the raw bytes are returned as-is on success. Error responses are
still parsed as JSON regardless of this option, since Plaid returns
JSON error bodies even for otherwise-binary endpoints.