Credit balance, purchasable plans and the credit ledger.
CorvoNfse.Resources.Credits.balance(client)
CorvoNfse.Resources.Credits.history(client, limit: 50)
Summary
Functions
Reads the credit balance (GET /v1/credits).
Lists credit transactions (GET /v1/credits/history).
Lazily iterates every credit transaction across pages.
Lists credit plans (GET /v1/credits/plans).
Types
@type list_option() :: {:limit, pos_integer()} | {:cursor, String.t()}
Functions
@spec balance(CorvoNfse.Client.t()) :: {:ok, map()} | {:error, CorvoNfse.Error.t()}
Reads the credit balance (GET /v1/credits).
@spec history(CorvoNfse.Client.t(), [list_option()]) :: {:ok, CorvoNfse.Types.Common.page()} | {:error, CorvoNfse.Error.t()}
Lists credit transactions (GET /v1/credits/history).
@spec iterate_history(CorvoNfse.Client.t(), [list_option()]) :: {:ok, Enumerable.t()} | {:error, CorvoNfse.Error.t()}
Lazily iterates every credit transaction across pages.
The first page is fetched eagerly: {:error, error} means it failed and
nothing was produced; {:ok, stream} yields transactions one by one. A
failure in a later page raises the %CorvoNfse.Error{} while consuming the
stream.
@spec plans(CorvoNfse.Client.t(), [list_option()]) :: {:ok, CorvoNfse.Types.Common.page()} | {:error, CorvoNfse.Error.t()}
Lists credit plans (GET /v1/credits/plans).