PelcroInvoicePay
Fired when an invoice is paid
Overview
Fired when an invoice is successfully paid.
Triggered By
| Method | Description |
|---|---|
Pelcro.invoice.pay() | Paying an invoice |
Event Detail
The event.detail object contains the paid invoice:
| Property | Type | Description |
|---|---|---|
id | number | Invoice ID |
status | string | Invoice status (typically paid) |
total | number | Invoice total amount |
currency | string | Currency 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
- Events Overview - All available events
- Invoice Module - Invoice methods
Updated 1 day ago
