Reads actual company plan limits instead of hardcoding commercial plans.
documents/2 returns the annual document quota, consumption and remaining
capacity. This is the plan's document counter, not a dedicated SDI sending
counter. plan/3 also supports clients, suppliers and products (global quotas).
invoice_capacity/3 combines the document counter with company plan features,
license date and invoice permissions. It performs two GETs and never creates
or sends an invoice. api/2 retrieves detailed API counters (one additional
request); ordinary responses already expose counters in rate_limit for free.
These are point-in-time checks: another user or app can consume the same quota after a check. An unknown/null limit does not mean unlimited. Availability for creating a document does not guarantee SDI acceptance or permission to send an existing document. The provider remains authoritative for every write.
Summary
Functions
Retrieves hourly/monthly API usage, including custom limits and remaining counts. Consumes one request.
Checks document quota for count new documents; returns :unknown when the counter is unavailable.
Reads the annual document quota and computes remaining capacity.
Returns document quota, plan, license and invoice feature/permission checks (two API requests).
Reads a plan quota for :documents, :clients, :suppliers or :products.
Functions
@spec api(ExFattureincloud.Client.t(), integer() | String.t()) :: ExFattureincloud.Response.result()
Retrieves hourly/monthly API usage, including custom limits and remaining counts. Consumes one request.
@spec can_create_documents?( ExFattureincloud.Client.t(), integer() | String.t(), pos_integer() ) :: {:ok, boolean() | :unknown} | {:error, ExFattureincloud.Error.t()}
Checks document quota for count new documents; returns :unknown when the counter is unavailable.
@spec documents(ExFattureincloud.Client.t(), integer() | String.t()) :: {:ok, ExFattureincloud.Usage.Quota.t()} | {:error, ExFattureincloud.Error.t()}
Reads the annual document quota and computes remaining capacity.
@spec invoice_capacity( ExFattureincloud.Client.t(), integer() | String.t(), pos_integer() ) :: {:ok, map()} | {:error, ExFattureincloud.Error.t()}
Returns document quota, plan, license and invoice feature/permission checks (two API requests).
@spec plan(ExFattureincloud.Client.t(), integer() | String.t(), atom() | String.t()) :: {:ok, ExFattureincloud.Usage.Quota.t()} | {:error, ExFattureincloud.Error.t()}
Reads a plan quota for :documents, :clients, :suppliers or :products.