PelcroInvoicePay

Fired when an invoice is paid

Overview

Fired when an invoice is successfully paid.


Triggered By

MethodDescription
Pelcro.invoice.pay()Paying an invoice

Event Detail

The event.detail object contains the paid invoice:

PropertyTypeDescription
idnumberInvoice ID
statusstringInvoice status (typically paid)
totalnumberInvoice total amount
currencystringCurrency code

Example

document.addEventListener('PelcroInvoicePay', (event) => {
  const invoice = event.detail;

  console.log(`Invoice paid: ${invoice.id}`);

  showMessage('Payment successful!');

  // Track payment
  analytics.track('Invoice Paid', {
    invoiceId: invoice.id,
    total: invoice.total,
    currency: invoice.currency
  });
});

Related