CorvoNfse.Resources.Plans (Corvo NFS-e v0.1.1)

Copy Markdown View Source

The public price catalog (monthly cycle only). Values are in centavos.

CorvoNfse.Resources.Plans.list(client)
CorvoNfse.Resources.Plans.quote(client, 20_000)

Summary

Functions

Reads the price of one plan (GET /v1/plans/:slug): "free", "developer", "growth", "scale" or "volume".

Lists plan prices, from the smallest to the largest allowance (GET /v1/plans).

Recommends the plan for volume invoices per month (GET /v1/plans/quote).

Types

list_option()

@type list_option() :: {:limit, pos_integer()} | {:cursor, String.t()}

Functions

get(client, slug)

@spec get(CorvoNfse.Client.t(), String.t()) ::
  {:ok, map()} | {:error, CorvoNfse.Error.t()}

Reads the price of one plan (GET /v1/plans/:slug): "free", "developer", "growth", "scale" or "volume".

list(client, opts \\ [])

@spec list(CorvoNfse.Client.t(), [list_option()]) ::
  {:ok, CorvoNfse.Types.Common.page()} | {:error, CorvoNfse.Error.t()}

Lists plan prices, from the smallest to the largest allowance (GET /v1/plans).

quote(client, volume)

@spec quote(CorvoNfse.Client.t(), non_neg_integer()) ::
  {:ok, map() | nil} | {:error, CorvoNfse.Error.t()}

Recommends the plan for volume invoices per month (GET /v1/plans/quote).

{:ok, nil} when the volume is missing or not positive. The keys of the recommendation are snake_case ("recommended_plan", "total_estimated_cents").