Unit.API.Counterparties (Unit v1.0.0)

Copy Markdown View Source

API module for Unit Counterparties (saved external ACH accounts).

Permissions: "CreditOnly", "DebitOnly", or "CreditAndDebit" (default).

Summary

Functions

Create a counterparty.

Delete a counterparty.

Get a counterparty by ID.

List counterparties.

Update a counterparty's permissions or tags.

Functions

create(params, opts \\ [])

@spec create(
  map(),
  keyword()
) :: {:ok, Unit.Resource.Counterparty.t()} | {:error, term()}

Create a counterparty.

Required params

  • :customer_id, :name, :routing_number, :account_number, :account_type

Optional

  • :permissions, :tags, :idempotency_key

delete(id, opts \\ [])

@spec delete(
  String.t(),
  keyword()
) :: {:ok, nil} | {:error, term()}

Delete a counterparty.

get(id, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, Unit.Resource.Counterparty.t()} | {:error, term()}

Get a counterparty by ID.

list(opts \\ [])

@spec list(keyword()) ::
  {:ok, [Unit.Resource.Counterparty.t()], map()} | {:error, term()}

List counterparties.

update(id, params, opts \\ [])

@spec update(String.t(), map(), keyword()) ::
  {:ok, Unit.Resource.Counterparty.t()} | {:error, term()}

Update a counterparty's permissions or tags.