Unit.API.Statements (Unit v1.0.0)

Copy Markdown View Source

API module for Unit Statements.

Statements are generated on the 1st of every month. You are responsible for distributing them to your customers.

Retrieve statements as HTML (for in-app display) or PDF (for download).

Summary

Functions

Get a bank-branded statement PDF (for regulatory delivery).

Get the HTML content of a statement.

Get the PDF binary content of a statement.

List statements for an account or customer.

Functions

get_bank_pdf(id, opts \\ [])

@spec get_bank_pdf(
  String.t(),
  keyword()
) :: Unit.Client.response()

Get a bank-branded statement PDF (for regulatory delivery).

get_html(id, opts \\ [])

@spec get_html(
  String.t(),
  keyword()
) :: Unit.Client.response()

Get the HTML content of a statement.

get_pdf(id, opts \\ [])

@spec get_pdf(
  String.t(),
  keyword()
) :: Unit.Client.response()

Get the PDF binary content of a statement.

list(opts \\ [])

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

List statements for an account or customer.

Filter options

  • :account_id
  • :customer_id
  • :period"YYYY-MM" format, e.g. "2024-01"
  • :page_limit, :page_offset