Unit.API.StopPayments (Unit v1.0.0)

Copy Markdown View Source

API module for Unit Stop Payments (ACH and Check).

Stop payments instruct the bank to reject matching incoming payments.

ACH Stop Payments

Can be single-use or multi-use, directional (debit or credit), with optional amount bounds and originator name filters.

Check Stop Payments

Stop payment on a specific check number.

Summary

Functions

Create an ACH stop payment.

Create a check stop payment.

Disable (deactivate) a stop payment.

Get a stop payment by ID.

List stop payments.

Functions

create_ach(params, opts \\ [])

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

Create an ACH stop payment.

Required params

  • :account_id

Optional params

  • :amount — exact amount to match (cents)
  • :min_amount / :max_amount — amount range match
  • :direction"Debit" | "Credit" | nil (both)

  • :originator_name — list of company names to block
  • :expirationDate.t() when stop expires
  • :is_multi_use — boolean (default false)
  • :tags

create_check(params, opts \\ [])

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

Create a check stop payment.

Required params

  • :account_id
  • :check_number — the check number to stop

disable(id, opts \\ [])

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

Disable (deactivate) a stop payment.

get(id, opts \\ [])

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

Get a stop payment by ID.

list(opts \\ [])

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

List stop payments.

Filter options

  • :account_id, :customer_id, :status, :type