Skip to main content
Invoice methods are available in @coin-voyage/paykit@3.4.0 and later. Every method requires your API secret and must run on the server.
Publishing an invoice creates a linked SALE order and emails the recipient a PDF with a hosted payment link. Treat createInvoice() as an external side effect, not a preview operation.

createInvoice

Creates and publishes an invoice. Include id to publish an existing draft, together with the complete invoice fields required by CreateInvoiceParams.
Parameters: params (CreateInvoiceParams), apiSecret, opts?
Returns: Promise<APIResponse<InvoiceResponse>>

saveInvoiceDraft

Creates a partial draft or updates an unpublished draft when id is supplied. Draft fields are validated when the invoice is published.
Returns: Promise<APIResponse<InvoiceResponse>>

listInvoices

Lists invoices and drafts newest first. Search matches invoice IDs, invoice numbers, recipient names or email addresses, and linked order IDs.
Returns: Promise<APIResponse<InvoicesWithPagination>>

getInvoice

Returns: Promise<APIResponse<InvoiceResponse>>

archiveInvoice

Archives an invoice. Archiving retains the invoice and records archived_at.
Returns: Promise<APIResponse<InvoiceResponse>>

deleteInvoice

Deletes an unpublished draft. Published invoices cannot be deleted.
Returns: Promise<APIResponse<void>>

Invoice types

unitPrice, quantity, and tax are decimal strings. tax is a percentage from 0 through 100. See Invoices overview for the lifecycle and Invoices API for the raw REST endpoints.