Marqeta.Client (marqeta v1.0.0)

Copy Markdown View Source

Core HTTP client for the Marqeta API.

Handles authentication (HTTP Basic Auth), retry with exponential backoff and jitter, telemetry emission, optional rate limiting, and error normalisation into Marqeta.Error.

Per-request options

All public functions accept an optional opts keyword list:

  • :timeout — override the configured timeout (ms).
  • :retry — max retries for this request; false to disable.
  • :headers — additional headers [{name, value}].
  • :params — URL query parameters (map or keyword list).

Summary

Functions

Performs a DELETE request to path.

Performs a GET request to path.

Performs a PATCH request to path with body.

Performs a POST request to path with body.

Performs a PUT request to path with body.

Functions

delete(path, opts \\ [])

@spec delete(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Performs a DELETE request to path.

get(path, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Performs a GET request to path.

patch(path, body \\ nil, opts \\ [])

@spec patch(String.t(), map() | nil, keyword()) ::
  {:ok, map()} | {:error, Marqeta.Error.t()}

Performs a PATCH request to path with body.

post(path, body \\ nil, opts \\ [])

@spec post(String.t(), map() | nil, keyword()) ::
  {:ok, map()} | {:error, Marqeta.Error.t()}

Performs a POST request to path with body.

put(path, body \\ nil, opts \\ [])

@spec put(String.t(), map() | nil, keyword()) ::
  {:ok, map()} | {:error, Marqeta.Error.t()}

Performs a PUT request to path with body.