Unit.API.Repayments (Unit v1.0.0)

Copy Markdown View Source

API module for Unit Credit Account Repayments.

Repayments reduce the outstanding balance on a credit account.

Types

  • bookRepayment — instant transfer from a deposit account (same bank)
  • achRepayment — external ACH transfer
  • capitalPartnerBookRepayment — capital-partner lending flows
  • capitalPartnerAchRepayment — capital-partner ACH flows

Summary

Functions

Create an ACH repayment (from external bank account).

Create a book repayment (instant, from deposit account at same bank).

Get a repayment by ID.

List repayments.

Functions

create_ach(params, opts \\ [])

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

Create an ACH repayment (from external bank account).

Required params

  • :credit_account_id
  • :amount
  • :description
  • :counterparty_id — saved counterparty or inline :counterparty map

Optional params

  • :same_day — boolean
  • :idempotency_key

create_book(params, opts \\ [])

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

Create a book repayment (instant, from deposit account at same bank).

Required params

  • :credit_account_id
  • :account_id — source deposit account
  • :amount — in cents
  • :description

get(id, opts \\ [])

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

Get a repayment by ID.

list(opts \\ [])

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

List repayments.

Filter options

  • :credit_account_id
  • :customer_id
  • :status