Find Out Why an Order Didn’t Earn Loyalty Points with RewardsWP and AI
Why an order earned nothing, what the customer is owed, and a credit with the order number on it, only on your yes.
Prerequisites
A WooCommerce store connected to WPVibe running RewardsWP 1.6 or newer (free or Pro; tested on Pro 1.6.0) on WordPress 6.9 or newer, with an administrator account. Changes need RewardsWP's write access on: RewardsWP > Tools > AI MCP > Enable MCP Write Access.
My WooCommerce store runs RewardsWP. A customer, [their email], says order [order number] didn't earn loyalty points. Find out why, and credit them only on my yes. 1. Run get_ability_info for each RewardsWP ability this uses: rewardswp/get-order-rewards, rewardswp/get-member, rewardswp/list-points-entries, rewardswp/get-program-settings, rewardswp/list-vip-tiers, rewardswp/add-member and rewardswp/adjust-member-points. If one is not found, stop and tell me this needs RewardsWP 1.6 or newer on WordPress 6.9 or newer. If any of rewardswp/add-member and rewardswp/adjust-member-points shows meta.mcp.public false, RewardsWP is not letting AI make that change (not even a dry run): tell me to switch on Enable MCP Write Access under RewardsWP > Tools > AI MCP (and, if it lists separate permissions for each kind of change there, to allow these), and stop. If a RewardsWP call is refused because my plan doesn't include it, pass on the plan it names and stop. 2. Read the order with rest_api GET /wc/v3/orders/ORDER_ID and fields id,number,status,total,total_tax,shipping_total,discount_total,date_created,billing,line_items,fee_lines. Check the number it returns is the one I gave; if not (my store may use custom order numbers), stop and ask me for the order ID from the address of the order's edit screen. 3. Run rewardswp/get-order-rewards with order_id. If it lists points entries for this order, tell me what was earned and their status (pending points wait for the order to complete) and stop. Otherwise tell me the reasons in its explanation. 4. Run rewardswp/get-member with the customer's email (and with the order's billing email if it is different). If a member exists, run rewardswp/list-points-entries with their member_id, source_type manual_adjustment, number 100: if any note_internal names this order number, it was already credited by hand; show it and stop. 5. Work out the points the way RewardsWP counts a purchase: from rewardswp/get-program-settings, the purchase earn action's points_per_dollar (per base_amount if that is set); add up the order's line_items total (after discounts) and fee_lines total, with no tax or shipping, divide by base_amount (when it is null: 1, or 100 for currencies without decimals such as JPY), multiply by points_per_dollar and round down. If the member holds a VIP tier, rewardswp/list-vip-tiers gives its multiplier for purchases. If purchase points are switched off, or the order is not completed or processing, tell me and stop. If it is processing, don't credit it by hand: once a member has the order's billing email, RewardsWP adds the purchase points itself when the order is marked completed. Tell me that. If step 4 found no member under either email, offer to add the member only (step 7 without adjust-member-points); if the customer is a member under a different email, say the order will still earn nothing and that I can run this again once it is completed. Then stop. 6. Show me the order, why it earned nothing, the member (or that there is none yet, under which email) and the points with the math. Wait for my yes or a different number. 7. On my yes: if there is no member, run rewardswp/add-member with the email, first_name and last_name from the order's billing, a reason and dry_run true; if it is refused because guests can't join, tell me the customer needs an account and stop; otherwise run it for real. Then run rewardswp/adjust-member-points with the member, points, reason "Order ORDER_NUMBER: [why it is owed]" and dry_run true. Show me balance_before, balance_after, any VIP tier change and emails_that_would_send, and wait for my yes before running it without dry_run. 8. Check it with rewardswp/get-member and tell me the new balance and the entry's entry_id. To undo, run rewardswp/adjust-member-points with the same number negative and a reason, or rewardswp/revoke-points-entry with that entry_id (WPVibe will ask me to approve that one in my browser).
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Find Out Why an Order Didn’t Earn Loyalty Points with RewardsWP and AI” recipe from the WPVibe cookbook on my connected site.
A customer writes in: I bought something last month and my points never showed up. Maybe they checked out with another email, joined after ordering, or the order is still on hold. Finding out means matching the order to a member and reading the points ledger, and then working out what they should have earned.
The AI asks RewardsWP what it did with that order and why, checks the customer’s ledger, and works out the points the way RewardsWP counts them. If the points are owed, it shows you the credit as a dry run and adds it only on your yes, with the order number in the admin note so the same order can’t be credited twice.
Points added by hand aren’t tied to the order, so the AI checks for an earlier credit before it adds one, and leaves orders that are still processing for RewardsWP to pay itself. Taking points back later is one more message; WPVibe asks you to approve that in your browser.
Outcome
You know why the order earned nothing, and the customer has the points you approved, noted with the order number.