Siren

TransactionCreateRequested

A mutable event that fires before a transaction is persisted. Listeners can modify transaction details before creation.

Last updated: April 8, 2026

TransactionCreateRequested

Before a transaction is written to the database, Siren gives listeners a chance to inspect and modify the data. TransactionCreateRequested is a mutable event that fires during this window, carrying the transactionDetails array that will become the transaction’s line items. Listeners can add entries, remove them, or transform values before anything is persisted.

The event is identified as transaction_create_requested and lives in Siren\Transactions\Core\Events\TransactionCreateRequested.

What does this event carry?

The event provides a transactionDetails array through getTransactionDetails() and an addTransactionDetail method for appending new entries. It also carries optional bindingId and bindingDataType fields that link the transaction to an external platform record.

Because this event is mutable, any changes a listener makes to the transaction details will propagate to all downstream processing. If multiple listeners modify the same event, they run in the order they were registered, so earlier listeners shape what later listeners see.

When would you use it?

This is the extension point for customizing how transaction data is assembled. A listener might inject additional line items, adjust pricing based on custom business rules, or filter out details that should not factor into commission calculations.

use Siren\Transactions\Core\Events\TransactionCreateRequested;

public function handle(Event $event): void
{
    $details = $event->getTransactionDetails();

    $event->addTransactionDetail([
        'name' => 'Processing Fee',
        'description' => 'Custom processing fee',
        'value' => 500,
        'type' => 'fee',
        'quantity' => 1,
    ]);
}

Once the event’s listeners have all run, the system persists the transaction using the final state of the details array and fires TransactionCreated as a read-only confirmation.

See the Payment Events overview for how this event fits into the full payment pipeline.