const webhook = await sdk.webhooks.create({
url: "https://example.com/webhooks",
events: ["invoice.created", "invoice.paid", "payment.received"],
description: "Invoice notifications",
});
// Save the secret — it is only shown on creation
console.log("Webhook secret:", webhook.secret);
Amazon SES reports what happened to a document email after it was sent. Every event carries { id, type, message_id }: the document ID, its type and the email’s message ID (also stored on the document’s sent activity). email.delivered, email.bounced and email.complained add recipients, the affected addresses; email.bounced also adds bounce_type and bounce_sub_type, and email.complained adds feedback_type. email.opened carries only { id, type, message_id }: SES does not say which recipient opened, and no IP address or user agent is stored.
Event
Trigger
email.delivered
The recipient’s mail server accepted the email
email.bounced
The email bounced (permanent or temporary)
email.complained
The recipient marked the email as spam
email.opened
First open of the email; only when the entity enabled email_open_tracking_enabled
The ksef.submission.* events carry { id, type, ksef }: the document ID, its type (invoice or credit_note), and the document’s KSeF state, the same object GET /invoices/{id}/ksef returns.
Event
Trigger
e_invoicing.submission.created
E-invoice submitted
e_invoicing.submission.delivered
E-invoice delivered
e_invoicing.submission.failed
E-invoice delivery failed
e_invoicing.enrollment.verified
Entity enrollment verified for e-invoicing
e_invoicing.enrollment.rejected
Entity enrollment rejected for e-invoicing
e_invoicing.supplier.onboarded
Deprecated compatibility event emitted with e_invoicing.enrollment.verified
e_invoicing.supplier.rejected
Deprecated compatibility event emitted with e_invoicing.enrollment.rejected
ksef.submission.accepted
KSeF accepted a Polish invoice or credit note
ksef.submission.rejected
KSeF rejected a Polish invoice or credit note
ksef.submission.upo_available
The KSeF receipt (UPO) for a document is available to download