Column.BookTransfers (Column v1.0.0)

Copy Markdown View Source

Instant, free internal transfers between two Column bank accounts.

Book transfers are pure ledger movements — no external network involved. They support a two-phase hold pattern:

1. `create/2` with `hold: true`  funds reserved but not moved
2. `update/3`  optionally change amount/description while on hold
3. `clear/2`  execute the held transfer
   OR `cancel/2`  abandon the hold

Immediate transfer (no hold)

{:ok, transfer} = Column.BookTransfers.create(%{
  sender_bank_account_id: "bacc_aaa",
  receiver_bank_account_id: "bacc_bbb",
  amount: 5_000,
  currency_code: "USD",
  description: "Settlement"
})

Two-phase hold

{:ok, hold} = Column.BookTransfers.create(%{
  sender_bank_account_id: "bacc_aaa",
  receiver_bank_account_id: "bacc_bbb",
  amount: 5_000,
  currency_code: "USD",
  hold: true
})

# ... later, after authorization ...
{:ok, _} = Column.BookTransfers.clear(hold["id"])

Summary

Functions

Cancel a book transfer.

Clear (execute) a held book transfer.

Create a book transfer.

Get a book transfer by ID.

List all book transfers. Supports cursor pagination.

Update a book transfer 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 book transfer.

clear(id, opts \\ [])

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

Clear (execute) a held book transfer.

create(params, opts \\ [])

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

Create a book transfer.

get(id, opts \\ [])

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

Get a book transfer by ID.

list(opts \\ [])

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

List all book transfers. Supports cursor pagination.

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

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

Update a book transfer while it is on hold.