InvoicesAPI

Provides coroutine and callback entry points for all invoice-related API operations.

Functions

Link copied to clipboard

Creates a new invoice.

Creates a new invoice and delivers the result via a callback.

Link copied to clipboard

Deletes an invoice by its identifier.

Deletes an invoice by its identifier and delivers the result via a callback.

Link copied to clipboard
suspend fun getInvoices(page: Int? = null, perPage: Int? = null, customer: String? = null, account: String? = null, status: InvoiceStatus? = null): Pair<InvoiceResponses.ListInvoicesResponse?, NetworkingError?>

Retrieves a paginated list of invoices, optionally filtered by customer, account, or status.

fun getInvoices(page: Int? = null, perPage: Int? = null, customer: String? = null, account: String? = null, status: InvoiceStatus? = null, completionHandler: (InvoiceResponses.ListInvoicesResponse?, NetworkingError?) -> Unit)

Retrieves a paginated list of invoices and delivers the result via a callback.

Link copied to clipboard
suspend fun getInvoiceWith(invoiceId: String): Pair<Invoice?, NetworkingError?>

Retrieves a single invoice by its identifier.

fun getInvoiceWith(invoiceId: String, completionHandler: (Invoice?, NetworkingError?) -> Unit)

Retrieves a single invoice by its identifier and delivers the result via a callback.

Link copied to clipboard
suspend fun issueInvoice(invoiceId: String): Pair<Invoice?, NetworkingError?>

Issues a draft invoice, making it visible to the customer.

fun issueInvoice(invoiceId: String, completionHandler: (Invoice?, NetworkingError?) -> Unit)

Issues a draft invoice and delivers the result via a callback.

Link copied to clipboard

Updates an existing invoice.

fun updateInvoice(invoiceId: String, request: InvoiceRequests.UpdateInvoiceRequest, completionHandler: (Invoice?, NetworkingError?) -> Unit)

Updates an existing invoice and delivers the result via a callback.