sendInvoice( )


Sends an invoice preview link to a customer via email.

The sendInvoice() function returns a Promise that resolves when the invoice with the specified ID and version is sent to the customer listed on the invoice.

Use the emailOptions parameter to specify the subject and body of the email sent to the customer.

Method Declaration
Copy
function sendInvoice(id: IdAndVersion, emailInfo: EmailInfo): Promise<void>;
Method Parameters
idIdAndVersionRequired

ID and version of the invoice to send.


emailInfoEmailInfoRequired

Information used when sending the email.

JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { invoices } from "wix-billing-backend"; export const sendInvoiceToCustomer = webMethod( Permissions.Anyone, (id, version, subject, body) => { const idAndVersion = { id: id, version: version, }; const emailInfo = { subject: subject, body: body, }; return invoices.sendInvoice(idAndVersion, emailInfo); }, );
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?