Nombaone. Invoices
(Nomba One v0.1.0)
View Source
Invoices — read what the billing engine produced; void what should never be collected. You never create invoices — subscription cycles do.
Summary
Functions
List invoices, newest first. Optional filters: :customer_id,
:subscription_id, :status, :limit, :cursor.
Raising variant of list/3.
Retrieve an invoice by id. Common errors: 404 INVOICE_NOT_FOUND.
Raising variant of retrieve/3.
Void an open, unpaid invoice. Paid invoices can't be voided — refund the
settlement instead. Accepts an optional :comment.
Raising variant of void/4.
Functions
@spec list(Nombaone.Client.t(), map(), keyword()) :: {:ok, Nombaone.Page.t()} | {:error, Nombaone.Error.t()}
List invoices, newest first. Optional filters: :customer_id,
:subscription_id, :status, :limit, :cursor.
Note: the :status filter accepts draft | open | paid | void | uncollectible — not partially_paid, even though an invoice object can
carry that status.
Example
for invoice <- Nombaone.Invoices.list!(client, %{status: "open"}) do
IO.inspect({invoice.id, invoice.amount_due_in_kobo})
end
@spec list!(Nombaone.Client.t(), map(), keyword()) :: Nombaone.Page.t()
Raising variant of list/3.
@spec retrieve(Nombaone.Client.t(), String.t(), keyword()) :: {:ok, Nombaone.Invoice.t()} | {:error, Nombaone.Error.t()}
Retrieve an invoice by id. Common errors: 404 INVOICE_NOT_FOUND.
@spec retrieve!(Nombaone.Client.t(), String.t(), keyword()) :: Nombaone.Invoice.t()
Raising variant of retrieve/3.
@spec void(Nombaone.Client.t(), String.t(), map(), keyword()) :: {:ok, Nombaone.Invoice.t()} | {:error, Nombaone.Error.t()}
Void an open, unpaid invoice. Paid invoices can't be voided — refund the
settlement instead. Accepts an optional :comment.
Common errors: 409 INVOICE_NOT_VOIDABLE, 409 INVOICE_ALREADY_PAID.
@spec void!(Nombaone.Client.t(), String.t(), map(), keyword()) :: Nombaone.Invoice.t()
Raising variant of void/4.