Skip to content
← Back to Index

OnOrderInvoiceCreated

This hook runs after an actor message (either create or applyCommands) has produced one or more new invoices on the order — for example via the invoice order command. It is the right place to react to new invoicing activity, such as capturing payments, sending the customer a copy of the invoice, or pushing it to an external accounting system.

Firing semantics

The hook fires once per actor message that resulted in new invoices, regardless of how many invoices were created during that message. The invoices field carries only the new invoices for this message; previously-existing invoices (incl. the new ones) can all be accessed through order.invoices.

Type

filtrera
{
  hook: 'OnOrderInvoiceCreated'
  order: Order // The order, including the newly created invoices
  invoices: [Invoice] // Only the invoices that were created in this message
}

Effects

messageActor Sends a message to another actor.
scheduleJob Schedules a job.
sendEmail Queues an email for delivery through the Sendings system.

© 2024 Hantera AB. All rights reserved.