Bunnyx.Billing (Bunnyx v0.3.1)

Copy Markdown View Source

Account billing details and per-zone usage summaries.

Uses the main API client created with Bunnyx.new/1.

Usage

client = Bunnyx.new(api_key: "sk-...")

{:ok, billing} = Bunnyx.Billing.details(client)
{:ok, summary} = Bunnyx.Billing.summary(client)

Summary

Functions

Returns account billing details including balance, charges, and usage.

Downloads a payment request invoice PDF.

Returns pending payment requests.

Returns a per-pull-zone usage summary for the current month.

Downloads a billing summary PDF for a billing record.

Functions

details(client)

@spec details(Bunnyx.t() | keyword()) :: {:ok, map()} | {:error, Bunnyx.Error.t()}

Returns account billing details including balance, charges, and usage.

invoice_pdf(client, payment_request_id)

@spec invoice_pdf(Bunnyx.t() | keyword(), pos_integer()) ::
  {:ok, binary()} | {:error, Bunnyx.Error.t()}

Downloads a payment request invoice PDF.

pending_payments(client)

@spec pending_payments(Bunnyx.t() | keyword()) ::
  {:ok, [map()]} | {:error, Bunnyx.Error.t()}

Returns pending payment requests.

summary(client)

@spec summary(Bunnyx.t() | keyword()) :: {:ok, [map()]} | {:error, Bunnyx.Error.t()}

Returns a per-pull-zone usage summary for the current month.

summary_pdf(client, billing_record_id)

@spec summary_pdf(Bunnyx.t() | keyword(), pos_integer()) ::
  {:ok, binary()} | {:error, Bunnyx.Error.t()}

Downloads a billing summary PDF for a billing record.