MoneyHub.Counterparties (MoneyHub v1.0.0)

Copy Markdown View Source

Counterparty data: the merchant/payee/payer identified behind a transaction, including logos, categories, and an explicit "is this a recognised business" check.

See Counterparties and Counterparties Check. This wraps the V3 counterparties API (V2 is deprecated by Moneyhub).

Summary

Functions

Checks whether a free-text name/identifier corresponds to a recognised counterparty/business - useful for validating a payee name before creating a payment.

Fetches a single counterparty by id.

Lists known counterparties for the user identified by token.

Types

counterparty()

@type counterparty() :: map()

Functions

check(config, token, name)

@spec check(MoneyHub.Config.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, MoneyHub.Error.t()}

Checks whether a free-text name/identifier corresponds to a recognised counterparty/business - useful for validating a payee name before creating a payment.

get(config, token, counterparty_id)

@spec get(MoneyHub.Config.t(), String.t(), String.t()) ::
  {:ok, counterparty()} | {:error, MoneyHub.Error.t()}

Fetches a single counterparty by id.

list(config, token, opts \\ [])

@spec list(MoneyHub.Config.t(), String.t(), keyword()) ::
  {:ok, [counterparty()]} | {:error, MoneyHub.Error.t()}

Lists known counterparties for the user identified by token.