View Source ExPipedrive.Currencies (ex_pipedrive v0.2.0)

API v1 client for Pipedrive currencies.

Currencies remain on /api/v1/currencies; there is no /api/v2 equivalent and no single-currency get endpoint. Use list/2 (optionally with :term) and get/2 / get_by_code/2 for client-side lookup.

Summary

Functions

Fetches a currency by integer id (client-side over list/2).

Fetches a currency by ISO/custom code (client-side over list/2).

Lists supported currencies via GET /api/v1/currencies.

Functions

@spec get(Tesla.Client.t(), pos_integer()) ::
  {:ok, ExPipedrive.Currency.t()} | {:error, ExPipedrive.Error.t()}

Fetches a currency by integer id (client-side over list/2).

Returns {:ok, %Currency{}} or {:error, %Error{kind: :not_found}}.

Link to this function

get_by_code(client, code)

View Source
@spec get_by_code(Tesla.Client.t(), String.t()) ::
  {:ok, ExPipedrive.Currency.t()} | {:error, ExPipedrive.Error.t()}

Fetches a currency by ISO/custom code (client-side over list/2).

Matching is case-insensitive. Returns {:ok, %Currency{}} or {:error, %Error{kind: :not_found}}.

Link to this function

list(client, opts \\ [])

View Source
@spec list(
  Tesla.Client.t(),
  keyword()
) :: {:ok, [ExPipedrive.Currency.t()]} | {:error, ExPipedrive.Error.t()}

Lists supported currencies via GET /api/v1/currencies.

Options: :term — optional search against currency name and/or code.

Returns {:ok, [%Currency{}]}.