Column.Disbursements (Column v1.0.0)

Copy Markdown View Source

Loan disbursements with optional two-phase hold.

Disbursements move funds from a loan into a bank account. The hold pattern lets you reserve funds and then clear or cancel later, identical to the book transfer hold pattern.

Immediate disbursement

{:ok, disb} = Column.Disbursements.create(%{
  loan_id: "loan_123",
  bank_account_id: "bacc_456",
  amount: 500_000,
  currency_code: "USD"
})

Held disbursement

{:ok, disb} = Column.Disbursements.create(%{
  loan_id: "loan_123",
  bank_account_id: "bacc_456",
  amount: 500_000,
  currency_code: "USD",
  hold: true
})

Column.Disbursements.clear(disb["id"])

Summary

Functions

Cancel a held disbursement.

Clear (execute) a held disbursement.

Create a loan disbursement.

Get a disbursement by ID.

List all disbursements.

Update a disbursement while it is on hold.

Types

id()

@type id() :: String.t()

opts()

@type opts() :: keyword()

params()

@type params() :: map()

result()

@type result() :: {:ok, map()} | {:error, Column.Error.t()}

Functions

cancel(id, opts \\ [])

@spec cancel(id(), opts()) :: result()

Cancel a held disbursement.

clear(id, opts \\ [])

@spec clear(id(), opts()) :: result()

Clear (execute) a held disbursement.

create(params, opts \\ [])

@spec create(params(), opts()) :: result()

Create a loan disbursement.

get(id, opts \\ [])

@spec get(id(), opts()) :: result()

Get a disbursement by ID.

list(opts \\ [])

@spec list(opts()) :: result()

List all disbursements.

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

@spec update(id(), params(), opts()) :: result()

Update a disbursement while it is on hold.