```html

Cashback Rewards

WalletPro can automatically credit a percentage of each order total back to the customer's wallet, turning every purchase into a reason to return. Cashback accumulates as real wallet balance that customers spend on future orders.

Customer Loyalty Automatic Rewards Rule-Based Role-Aware Per-Category Wallet Balance

Overview

Cashback rewards credit a configurable percentage of a qualifying order's subtotal directly into the purchasing customer's WalletPro wallet. Credits are posted after the order reaches a specified status (typically Completed), not at the moment of checkout, so reversals on cancelled or refunded orders remain clean.

You can configure cashback globally, override it per product category, and further differentiate it by customer role. A wholesale customer, a VIP subscriber, and a guest can each earn at a different rate from the same purchase, or not earn at all.

ℹ️

Cashback is credited as wallet balance, not as a coupon or discount code. The customer can spend it on any future order that accepts wallet payments, including partial-payment scenarios where they split the cost between their wallet and another gateway.

How It Works

  1. A customer places and pays for an order.
  2. WalletPro waits until the order transitions to the trigger status you configured (default: Completed).
  3. WalletPro evaluates the order against all active cashback rules, global rate, category overrides, and role overrides, and determines the applicable rate for each line item.
  4. The calculated cashback amount is atomically credited to the customer's wallet via the HMAC-chained audit ledger with a transaction type of cashback and the originating order ID recorded as the reference.
  5. The customer receives a notification (email and/or My Account inbox, depending on your notification settings) showing how much was credited and their new balance.
  6. If the originating order is later refunded, WalletPro checks the Reverse cashback on refund setting and, if enabled, debits the corresponding cashback amount from the wallet (capped at the current balance to avoid negatives).

Rate Resolution Order

When multiple rules could apply to a line item, WalletPro resolves them in the following priority order (highest wins):

Priority Rule Type Example
1 Role + Category override VIP customers buying from Electronics earn 8%
2 Role override (any category) Wholesale customers earn 1% regardless of category
3 Category override (any role) Items in Sale category earn 0%
4 Global rate All other purchases earn 2%

If a role or category override is set to 0%, that explicitly disables cashback for the matching line items, it is not treated as "unset."

Configuration

Navigate to WooCommerce > WalletPro > Cashback to access all cashback settings.

Global Settings

Setting Default Description
Enable cashback rewards Off Master toggle. Disabling this stops all new cashback accrual but does not remove existing wallet balances.
Cashback rate (%) 2.00 Default percentage applied to the order subtotal (excluding taxes and shipping) when no override matches.
Credit trigger status Completed The order status that triggers the cashback credit. Options: Processing, Completed. Completed is recommended to avoid crediting orders that may still be cancelled.
Reverse cashback on refund On When a full or partial refund is issued, debit the proportional cashback from the customer's wallet. Partial refunds debit a proportional amount.
Exclude wallet-funded portion On When the customer pays partly or fully with their wallet, cashback is calculated only on the portion paid via a non-wallet gateway. Prevents compounding cashback on cashback.
Minimum order subtotal 0.00 Orders with a subtotal below this amount do not earn cashback. Leave at 0 to apply to all orders.
Maximum cashback per order (none) Cap the cashback credited from a single order. Useful if you have high-value order outliers. Leave blank for no cap.

Category Overrides

Under the Category Rules tab within WooCommerce > WalletPro > Cashback, you can add per-category rates.

  1. Click Add category rule.
  2. Select a product category from the dropdown.
  3. Enter the cashback rate for that category. Set to 0 to exclude the category from cashback entirely.
  4. Click Save changes.

Category rules apply to every line item whose product belongs to (or is a descendant of) the selected category. If a product belongs to multiple categories and you have rules for more than one, the rule for the most specific (deepest) category in the hierarchy wins.

Role Overrides

Under the Role Rules tab, you can assign different rates per WordPress user role.

Column Description
Role Any registered WordPress role (Customer, Subscriber, Wholesale Customer, etc.)
Rate (%) Cashback percentage for this role. Overrides both the global rate and category rules unless a Role + Category rule is also defined.

To build a tiered loyalty program, create roles such as Silver Member, Gold Member, and Platinum Member, assign escalating cashback rates, and use a membership plugin or custom automation to promote customers between roles based on lifetime spend.

Combined Role + Category Rules

For the most granular control, use the Role + Category Rules tab. Rules here take the highest priority in the resolution chain. A common use case is giving VIP customers a boosted rate on high-margin categories while keeping their rate lower on sale items.

Merchant Setup: Step-by-Step

  1. Go to WooCommerce > WalletPro > Cashback.
  2. Check Enable cashback rewards.
  3. Set Cashback rate (%) to your baseline percentage (e.g., 2).
  4. Set Credit trigger status to Completed unless your fulfilment flow moves orders to Processing as a terminal state.
  5. Decide whether to enable Reverse cashback on refund (recommended: on).
  6. Optionally set a Minimum order subtotal to exclude very small orders.
  7. Optionally set a Maximum cashback per order cap.
  8. Switch to the Category Rules tab and add any per-category overrides. For example, set the Sale Items category to 0 to exclude discounted products.
  9. Switch to the Role Rules tab and add any per-role rates if you have a membership or wholesale tier structure.
  10. Click Save changes.

From this point on, every qualifying completed order automatically accrues cashback without further intervention.

Customer Experience

Viewing Earned Cashback

Customers can see cashback activity in two places within their My Account area:

Spending Cashback

Cashback is ordinary wallet balance. Customers spend it the same way they spend any other wallet funds:

  1. At checkout, the Pay with Wallet option is shown if the customer has a positive balance.
  2. The customer selects how much of their wallet balance to apply (up to the order total, subject to any spending limits the merchant has configured).
  3. The wallet amount is deducted first; any remaining balance is charged to the customer's chosen secondary payment method.

Printable Statement

Customers can download or print a full wallet statement from My Account > Wallet > Download Statement. Cashback entries are labeled with the transaction type Cashback and include the order reference, making it straightforward to reconcile earning history.

Notifications

When cashback is credited, WalletPro can send the customer a notification. To configure notifications:

  1. Go to WooCommerce > WalletPro > Notifications.
  2. Locate the Cashback credited notification template.
  3. Enable it and customise the subject line and body. Available merge tags include {{amount}}, {{order_number}}, and {{new_balance}}.

Reporting

To review cashback liability and program cost:

All reports are exportable as GL-friendly CSV from the Export button on each report page. You can also schedule automated CSV delivery under WooCommerce > WalletPro > Reports > Scheduled Exports.

Developer Reference

Hooks

Use these hooks to modify cashback behaviour programmatically.

walletpro_cashback_rate

Filters the final resolved cashback rate for a given line item before the credit is calculated.

/**
 * @param float    $rate      Resolved rate as a decimal (e.g. 0.02 for 2%).
 * @param WC_Order_Item_Product $item  The line item being evaluated.
 * @param WC_Order $order     The parent order.
 * @param WP_User  $customer  The purchasing customer.
 */
add_filter( 'walletpro_cashback_rate', function( $rate, $item, $order, $customer ) {
    // Double cashback during a promotional period.
    if ( defined( 'MY_PROMO_ACTIVE' ) && MY_PROMO_ACTIVE ) {
        return $rate * 2;
    }
    return $rate;
}, 10, 4 );

walletpro_cashback_amount

Filters the calculated cashback amount (in the store's base currency) for the entire order, after all line items have been summed. Return 0 to suppress the credit entirely.

add_filter( 'walletpro_cashback_amount', function( $amount, $order, $customer ) {
    // No cashback if the customer already used a referral discount on this order.
    if ( $order->get_meta( '_walletpro_referral_discount_applied' ) ) {
        return 0;
    }
    return $amount;
}, 10, 3 );

walletpro_cashback_credited

Action fired after the cashback transaction has been written to the ledger.

add_action( 'walletpro_cashback_credited', function( $transaction_id, $customer_id, $amount, $order_id ) {
    // Log to a custom analytics table.
    my_plugin_log_cashback( $customer_id, $amount, $order_id );
}, 10, 4 );

REST API

Cashback transactions appear in the standard wallet transaction endpoint. You can also trigger a manual cashback credit via the credit endpoint with "type": "cashback".

# Retrieve cashback transactions for a customer
GET /wp-json/walletpro/v1/customers/42/transactions?type=cashback

Example response item:

{
  "id": 1098,
  "type": "cashback",
  "amount": "1.84",
  "currency": "USD",
  "balance_after": "23.14",
  "reference": "order:5512",
  "note": "Cashback for order #5512",
  "created_at": "2025-03-18T14:22:07Z"
}

WP-CLI

To manually trigger a cashback recalculation for a specific order (useful when correcting a misconfiguration):

wp wallet cashback recalculate --order-id=5512

To preview what cashback would be credited for an order without actually writing the transaction:

wp wallet cashback recalculate --order-id=5512 --dry-run
⚠️

Running wp wallet cashback recalculate on an order that has already been credited will create a duplicate transaction unless you first reverse the original using wp wallet debit. Always use --dry-run first to confirm the expected outcome.

Edge Cases and Behavior Notes

Scenario Behavior
Order is fully paid with wallet balance If Exclude wallet-funded portion is on, cashback amount is $0. If off, cashback is calculated on the full subtotal.
Order is partially refunded Cashback is debited proportionally to the refunded line items if Reverse cashback on refund is enabled.
Customer's wallet balance is insufficient to absorb a reversal WalletPro debits whatever balance remains (balance floored at zero). It does not create a negative balance or pursue the shortfall.
Order status is manually changed back from Completed Cashback is not automatically reversed on status rollback. Use a refund action or the WP-CLI debit command if a reversal is needed.
Guest checkout Guests do not have a wallet. Cashback is not accrued. If the order is later assigned to a customer account, the credit is not backdated automatically.
Multi-currency order Cashback is calculated in the order currency and credited to the customer's wallet in that currency (or converted to the wallet's base currency if you are using single-currency wallets, see WalletPro > Settings > Currency).