API module for Unit Accounts (deposit, credit, wallet, batch).
Account lifecycle
- Create a deposit or credit account for an approved customer
- Issue cards, initiate payments, query transactions
- Freeze (temporary) or close (permanent)
Summary
Functions
Close an account permanently.
Open a batch/clearing account.
Open a credit account for a customer.
Open a deposit account for a customer.
Freeze an account temporarily.
Get an account by ID.
Get account balance history (daily snapshots).
Get account limits (per-rail daily/monthly hard and soft limits).
List accounts.
Unfreeze a previously frozen account.
Update an account's tags.
Functions
@spec close(String.t(), map(), keyword()) :: {:ok, Unit.Resource.Account.t()} | {:error, term()}
Close an account permanently.
Params
:reason—"ByCustomer"|"Fraud"(required):fraud_reason— required when reason is"Fraud"
@spec create_batch(String.t(), String.t(), keyword(), keyword()) :: {:ok, Unit.Resource.Account.t()} | {:error, term()}
Open a batch/clearing account.
Required params
:deposit_product,:name
Optional params
:tags,:idempotency_key
@spec create_credit(String.t(), String.t(), keyword(), keyword()) :: {:ok, Unit.Resource.Account.t()} | {:error, term()}
Open a credit account for a customer.
Required params
:customer_id,:credit_terms— configured by Unit's compliance team
Optional params
:tags,:credit_limit,:idempotency_key
@spec create_deposit(String.t(), String.t(), keyword(), keyword()) :: {:ok, Unit.Resource.Account.t()} | {:error, term()}
Open a deposit account for a customer.
Required params
:customer_id,:deposit_product— name of the deposit product (e.g."checking")
Optional params
:tags,:overdraft_limit,:idempotency_key
@spec freeze(String.t(), keyword(), keyword()) :: {:ok, Unit.Resource.Account.t()} | {:error, term()}
Freeze an account temporarily.
@spec get( String.t(), keyword() ) :: {:ok, Unit.Resource.Account.t()} | {:error, term()}
Get an account by ID.
Get account balance history (daily snapshots).
Get account limits (per-rail daily/monthly hard and soft limits).
@spec list(keyword()) :: {:ok, [Unit.Resource.Account.t()], map()} | {:error, term()}
List accounts.
Filter options
:customer_id,:status,:type,:tags
@spec unfreeze( String.t(), keyword() ) :: {:ok, Unit.Resource.Account.t()} | {:error, term()}
Unfreeze a previously frozen account.
@spec update(String.t(), map(), keyword()) :: {:ok, Unit.Resource.Account.t()} | {:error, term()}
Update an account's tags.