Skip to content

Payouts

Hook Reference

HookDescription
fluent_affiliate/payout/stranded_referrals_releasedFired by the hourly scheduled job after referrals stuck in processing (claimed by a payout run that never completed) are released back to unpaid and the affected affiliates' earnings are recounted.
fluent_affiliate/payout/processedFired after a payout batch has been fully processed.
fluent_affiliate/payout/transaction/deletingFired just before a payout transaction is deleted.
fluent_affiliate/payout/transaction/deletedFired after a payout transaction has been deleted.
fluent_affiliate/payout/transaction/transaction_updated_to_{status}Fired when a payout transaction status changes.

fluent_affiliate/payout/stranded_referrals_released

Fired by the hourly scheduled job after referrals stuck in processing (claimed by a payout run that never completed) are released back to unpaid and the affected affiliates' earnings are recounted.

Parameters

ParameterTypeDescription
$affiliateIdsarrayIDs of the affiliates whose referrals were released.
$releasedintNumber of referral rows reset to unpaid.

Source: app/Hooks/Handlers/ScheduledJobsHandler.php

php
add_action('fluent_affiliate/payout/stranded_referrals_released', function($affiliateIds, $released) {
    error_log("Released {$released} stranded referrals for " . count($affiliateIds) . ' affiliates');
}, 10, 2);

fluent_affiliate/payout/processed

Fired after a payout batch has been fully processed.

Parameters

ParameterTypeDescription
$payoutPayoutThe Payout model that was processed.
$affiliatesarrayArray of Affiliate models included in the payout.

Source: app/Http/Controllers/PayoutController.php

php
add_action('fluent_affiliate/payout/processed', function($payout, $affiliates) {
    foreach ($affiliates as $affiliate) {
        // Send payment notifications, trigger PayPal mass pay, etc.
    }
}, 10, 2);

fluent_affiliate/payout/transaction/deleting

Fired just before a payout transaction is deleted.

Parameters

ParameterTypeDescription
$transactionTransactionThe Transaction model about to be deleted.
$payoutPayoutThe parent Payout model.

Source: app/Http/Controllers/PayoutController.php

php
add_action('fluent_affiliate/payout/transaction/deleting', function($transaction, $payout) {
    // Reverse any external payment before deletion.
}, 10, 2);

fluent_affiliate/payout/transaction/deleted

Fired after a payout transaction has been deleted.

Parameters

ParameterTypeDescription
$transactionIdintID of the deleted transaction.
$payoutPayoutThe parent Payout model.

Source: app/Http/Controllers/PayoutController.php

php
add_action('fluent_affiliate/payout/transaction/deleted', function($transactionId, $payout) {
    // Post-deletion audit logging.
}, 10, 2);

fluent_affiliate/payout/transaction/transaction_updated_to_{status}

Fired when a payout transaction status changes. The hook suffix is the new status (e.g. paid, failed, pending).

Parameters

ParameterTypeDescription
$transactionTransactionThe Transaction model with its updated status.
$payoutPayoutThe parent Payout model.

Source: app/Http/Controllers/PayoutController.php

php
add_action('fluent_affiliate/payout/transaction/transaction_updated_to_paid', function($transaction, $payout) {
    // Send receipt to the affiliate.
}, 10, 2);

FluentAffiliate developer documentation