Low-level HTTP transport shared by every Sumup.* resource module.
You should not need to call this module directly unless you're
implementing support for a new/undocumented SumUp endpoint — every
documented resource is already exposed through its own module (e.g.
Sumup.Checkouts, Sumup.Readers).
Responsibilities:
- Builds requests against
Sumup.Config.t/0's:base_urlwith the correctauthorizationandacceptheaders (SumUp mixes RFC 9457 Problem Details and legacy error bodies across endpoints, so we always sendAccept: application/problem+json, application/jsonas SumUp's own docs recommend for non-official clients). - Emits
:telemetryspans perSumup.Telemetry. - Retries
429/5xx/transport errors with exponential backoff and jitter, honoring a numericretry-afterheader when present. - Normalizes every non-2xx response and transport failure into a
Sumup.Error.
Summary
Functions
Sends a request and returns {:ok, decoded_body} or {:error, Sumup.Error.t()}.
Types
Functions
@spec request(Sumup.Config.t(), method(), String.t(), request_opts()) :: {:ok, term()} | {:error, Sumup.Error.t()}
Sends a request and returns {:ok, decoded_body} or {:error, Sumup.Error.t()}.
decoded_body is a plain map/list (already JSON-decoded) when as: :json (the default), or a raw string when as: :text (used by
Sumup.Payouts when requesting the CSV report format). Resource modules
are responsible for turning maps into their typed structs.