Unit.API.Fees (Unit v1.0.0)

Copy Markdown View Source

API module for Unit Fees.

Fees charge end-customers for specific actions (e.g. outgoing wire, paper statement, card replacement). They transfer funds from the customer's deposit account to your configured revenue account.

Fee Waivers

A fee waiver voids a previously charged fee and returns the amount to the customer.

Summary

Functions

Create a fee charge.

Create a fee waiver (refund a previously charged fee).

Functions

create(params, opts \\ [])

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

Create a fee charge.

Required params

  • :account_id — customer deposit account to debit
  • :amount — in cents
  • :description — appears on the customer's transaction
  • :revenue_account_id — your revenue account to credit

Optional

  • :tags
  • :idempotency_key

create_waiver(params, opts \\ [])

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

Create a fee waiver (refund a previously charged fee).

Required params

  • :fee_id — the ID of the fee to waive

Optional

  • :description — reason for the waiver
  • :tags
  • :idempotency_key