Nombaone. Settlements
(Nomba One v0.1.0)
View Source
Settlements — where collected money lands, and how it leaves (refunds, payouts) under the escrow lock.
Summary
Functions
Withdraw settled funds to your bank account.
Raising variant of create_payout/3.
List settlements, newest first. Optional filters: :status, :limit, :cursor.
Raising variant of list/3.
Refund a settlement's tenant share. The platform fee is never refunded.
Optional :amount_in_kobo (defaults to the full remaining refundable amount).
Raising variant of refund/4.
Retrieve a settlement by id. Common errors: 404 SETTLEMENT_NOT_FOUND.
Raising variant of retrieve/3.
Your escrow lock and available-to-withdraw balance.
Raising variant of retrieve_escrow/2.
Functions
@spec create_payout(Nombaone.Client.t(), map(), keyword()) :: {:ok, Nombaone.Payout.t()} | {:error, Nombaone.Error.t()}
Withdraw settled funds to your bank account.
Pass your own idempotency key
Money moves here, and the Idempotency-Key doubles as the payout's
durable merchant_tx_ref. Always pass an explicit, stable
idempotency_key: (e.g. your own payout id) — an auto-generated key
protects SDK-level retries, but a brand-new process retrying with a fresh
key would create a second payout.
Common errors: 409 ESCROW_LOCKED, 422 PAYOUT_EXCEEDS_AVAILABLE.
Example
{:ok, payout} =
Nombaone.Settlements.create_payout(
client,
%{amount_in_kobo: 5_000_000, bank_code: "058", account_number: "0123456789"},
idempotency_key: "payout-#{my_payout_row.id}"
)
@spec create_payout!(Nombaone.Client.t(), map(), keyword()) :: Nombaone.Payout.t()
Raising variant of create_payout/3.
@spec list(Nombaone.Client.t(), map(), keyword()) :: {:ok, Nombaone.Page.t()} | {:error, Nombaone.Error.t()}
List settlements, newest first. Optional filters: :status, :limit, :cursor.
@spec list!(Nombaone.Client.t(), map(), keyword()) :: Nombaone.Page.t()
Raising variant of list/3.
@spec refund(Nombaone.Client.t(), String.t(), map(), keyword()) :: {:ok, Nombaone.Refund.t()} | {:error, Nombaone.Error.t()}
Refund a settlement's tenant share. The platform fee is never refunded.
Optional :amount_in_kobo (defaults to the full remaining refundable amount).
Money moves here. The SDK sends an Idempotency-Key automatically; pass
your own stable idempotency_key: so a retry from a new process cannot
refund twice.
Common errors: 409 REFUND_ALREADY_REFUNDED, 422 REFUND_AMOUNT_EXCEEDS_NET.
@spec refund!(Nombaone.Client.t(), String.t(), map(), keyword()) :: Nombaone.Refund.t()
Raising variant of refund/4.
@spec retrieve(Nombaone.Client.t(), String.t(), keyword()) :: {:ok, Nombaone.Settlement.t()} | {:error, Nombaone.Error.t()}
Retrieve a settlement by id. Common errors: 404 SETTLEMENT_NOT_FOUND.
@spec retrieve!(Nombaone.Client.t(), String.t(), keyword()) :: Nombaone.Settlement.t()
Raising variant of retrieve/3.
@spec retrieve_escrow( Nombaone.Client.t(), keyword() ) :: {:ok, Nombaone.Escrow.t()} | {:error, Nombaone.Error.t()}
Your escrow lock and available-to-withdraw balance.
@spec retrieve_escrow!( Nombaone.Client.t(), keyword() ) :: Nombaone.Escrow.t()
Raising variant of retrieve_escrow/2.