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:
- An app user is resolved for the current request (via MAM Main’s session — never from request parameters).
- That user owns the order, or has
manage_woocommerce, or is granted by themam_wc_user_can_refund_orderescape-hatch filter. - The order status is Processing.
- 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.
Related articles
- Recipe: Configure the cancel, feedback, and refund forms
- Hook:
mam_pmt_charge_card/mam_pmt_refund_card - Hook: the `mam_wc_usercan` authorization filters*
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 |
