# Remove Memberships Granted by Refunded Orders

> Finds members whose access came from an order you refunded, so nobody keeps paid access for free.

- Job: [Customers](https://storeagent.ai/mcp-recipes/job/customers/)
- What it does: Asks first: changes your store, only after you say yes
- Time saved: ~30 min vs doing it by hand
- Requires: StoreAgent (free plugin, MCP on every plan) + WooCommerce Memberships
- Works in: Claude, ChatGPT, Cursor and any MCP client connected to the store through StoreAgent MCP
- Web page: https://storeagent.ai/mcp-recipes/refunded-order-memberships/

## The prompt

```text
Find orders refunded in the last [number] days and skip guest orders. For each customer on those orders, list their memberships and show any membership whose order ID matches the refunded order, with the plan name, status and start date. Show me the list and wait for my OK. Deleting a membership removes the customer's access and cannot be undone, so only delete the ones I confirm.
```

## What happens when you paste it

You: Find orders refunded in the last [number] days and skip guest orders…

Assistant: 6 refunded orders in the last 30 days, 4 from registered customers. 2 of those customers have an active Gold Club membership linked to the refunded order. Calling: `woocommerce/orders-query`, `woocommerce-memberships/user-memberships-list`, `woocommerce-memberships/plans-get`, `woocommerce-memberships/user-memberships-delete`, `woocommerce/order-add-note`.

Assistant: This will make changes in WooCommerce. Do you want me to go ahead?

Assistant: Deleted 2 memberships after your OK: membership 1182 for customer 77 and membership 1190 for customer 103. The other 2 customers had no membership tied to those orders.

## Abilities this recipe calls

- **Find orders** (`woocommerce/orders-query`, read only, from WooCommerce): Finds orders by status, customer, email or date, with the items in each order.
- **List a customer's memberships** (`woocommerce-memberships/user-memberships-list`, read only, from WooCommerce Memberships): Lists the memberships of one customer, with plan, status and dates.
- **Get membership plan** (`woocommerce-memberships/plans-get`, read only, from WooCommerce Memberships): Shows one membership plan with its access method, length and rules.
- **Delete a membership** (`woocommerce-memberships/user-memberships-delete`, asks first, from WooCommerce Memberships): Permanently deletes a customer's membership, which removes their access.
- **Add an order note** (`woocommerce/order-add-note`, asks first, from WooCommerce): Adds a private note to an order, or a note the customer gets by email.

## Variations

Add one of these to the end of the prompt. Swap anything in [brackets] for your own details.

- Include cancelled orders as well as refunded ones.
- Add a private note to each refunded order to say the membership was removed.

## Related recipes

- [Find Your VIP Customers](https://storeagent.ai/mcp-recipes/vip-customers.md): Your top spenders and most loyal repeat buyers, plus the ones who have gone quiet.
- [Say Sorry With Store Credit](https://storeagent.ai/mcp-recipes/store-credit-delays.md): Gives a small credit to every customer whose order is running late, with a note explaining why.
- [Give a Customer Membership Access by Hand](https://storeagent.ai/mcp-recipes/grant-membership.md): Finds the customer from their orders, checks what they already have, then adds the plan you choose.

---

Part of the StoreAgent WooCommerce MCP Recipes directory: https://storeagent.ai/mcp-recipes/ (index for LLMs: https://storeagent.ai/mcp-recipes/llms.txt). Get StoreAgent free: https://app.storeagent.ai/sign-up/
