Hook: mam_wc_is_refund_allowed

Signature

$allowed = apply_filters( 'mam_wc_is_refund_allowed', false, int $order_id );
Parameter Type Description
(first arg) bool Pass false; that is also the answer when mam-woocommerce is inactive.
$order_id int The WooCommerce order being asked about.

Returns true only when all of these hold:

  1. An app user is resolved for the current request (via MAM Main’s session — never from request parameters).
  2. That user owns the order, or has manage_woocommerce, or is granted by the mam_wc_user_can_refund_order escape-hatch filter.
  3. The order status is Processing.
  4. The Refund settings allow it: Allow Refunds is not “no” for the user’s role, and with Refund Type = “Before Order Delivery Date” the order’s completion date hasn’t passed.

When to use it

Use this filter as the single source of truth for “can this user refund this order right now” — for example before showing a custom refund button or accepting a refund request in your own endpoint. It is the same policy that drives mam-woocommerce’s built-in Request Refund tab-bar button.

if ( apply_filters( 'mam_wc_is_refund_allowed', false, $order_id ) ) {
    // show the refund affordance / accept the request
}

Notes

  • The Refund settings live on Mobile App Manager → WooCommerce → Refund and are stored per role (e.g. tsl-setting-allow_refunds_customer) — see Configure the cancel, feedback, and refund forms.
  • This is a query, not an action: nothing is refunded by calling it. Actual card refunds run through mam_pmt_refund_card.


Metadata

Field Value
Article type Hook Reference
Plugin slug mam-woocommerce
Applies to plugin version 26.19.3+
Category Extending MAM Suite
Hook type filter (mam-woocommerce registers the handler; you call apply_filters)
Audience PHP developer
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!