Hook: mam_wcpv_vendor_commission_payout

Signature

do_action( 'mam_wcpv_vendor_commission_payout', int $order_id, bool $force_payout = false );
Parameter Type Description
$order_id int The WooCommerce order whose vendor commissions should be paid
$force_payout bool true bypasses the hold/settle-days eligibility wait (use only after the charge is captured)

What the registered handler does

This plugin attaches pay_vendor_commission_payout (priority 10, accepts 2 args). In order:

  1. Idempotency — returns immediately if the order already has _mam_vendor_paid meta.
  2. Eligibility (skipped when $force_payout is true) — with tsl-setting-checkout_place_hold_on_order = yes, the order must be completed and tsl-setting-checkout_settle_order_days days must have elapsed since completion.
  3. Loads unpaid PV commissions for the order, grouped per vendor.
  4. Takes a per-order lock (mam_wc_pv_payout_lock_<order id> option) so a concurrent cron + manual settle cannot double-transfer; stale locks expire after 10 minutes.
  5. Routes by mam_wc_pv_payout_method:
    • stripe_connect — one mam_stripe_connect_transfer filter call per vendor (order_id, vendor_id, amount), handled by mam-stripe-manager;
    • paypal — WooCommerce Product Vendors’ PayPal MassPay;
    • anything else — logged, no payout.
  6. On success, marks the commissions paid in PV and writes _mam_vendor_paid on the order.

Who fires it

  • The auto-settle cron after a successful capture ($force_payout = true).
  • The manual settle AJAX endpoint after capture (true).
  • The review/tips flow after a successful tip charge, for the original order and any separate tip order (true).

Example — pay out an order from your own integration

// After your code has captured payment for $order_id:
do_action( 'mam_wcpv_vendor_commission_payout', $order_id, true );

Example — react to settled orders

The action itself is the trigger, so hook it at a later priority to observe:

add_action( 'mam_wcpv_vendor_commission_payout', function ( $order_id, $force = false ) {
    $order = wc_get_order( $order_id );
    if ( $order && $order->get_meta( '_mam_vendor_paid' ) ) {
        // payout completed — notify, log, sync to accounting, …
    }
}, 20, 2 );

Notes

  • Money moves when this fires (if a payout method is configured). Never expose it to unauthenticated or unauthorized input; the in-plugin callers all authorize first.
  • Safe to fire repeatedly for the same order — the paid flag and the lock make it idempotent.
  • With $force_payout = false the call is a no-op until the order is eligible, which is how the cron retries orders inside the settle window.

  • Recipe: Commissions, settlement, and payouts
  • Hooks: mam_wc_vendor_get_tip_product and mam_wc_vendor_split_tip

Metadata

Field Value
Article type Hook Reference
Plugin slug mam-woocommerce-product-vendors
Applies to plugin version 26.19.1+
Category Extending MAM Suite
Hook type action
Audience PHP developer / integrator
Last verified 2026-06-10
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!