WooCommerce automation
Refund WooCommerce orders from a support list
Support hands you a list of order numbers with a reason for each, and for every one you open the order, work out the amount, press Refund and check the order notes to see whether the money really went back.
Cotlet does it in your own WooCommerce account with get_order, create_refund and add_order_note, called by your AI agent, an n8n workflow or a script.
Hosted · nothing to install or maintain
Can WooCommerce do this on its own?
WooCommerce refunds are made on the order screen, and the REST API can create them with a read/write key (checked 16 Oct 2026). The MCP developer preview has no refund ability, so an agent connected to it can read an order but not refund it. The gap is the job around the refund: reading a list, working out the amounts and checking the result.
How you do it in WooCommerce today
- Open WooCommerce > Orders, open the order and click the Refund button in the order summary.
- Enter the quantity to refund for each line item and WooCommerce calculates the amount, or type an amount per item when inventory is not managed. Add refund notes if you want.
- Click Refund via the payment gateway to send the money back to the original payment method, or Refund manually to only record it in WooCommerce.
- Tick Restock refunded items if the goods came back.
- Look in Order notes for the Successfully refunded message, or check the gateway account, because a manual refund still needs the money sent by hand.
How to refund WooCommerce orders from a support list
Order 1042 arrived damaged: refund the ceramic mug, 22.00, through the payment gateway, then add a private note with the reason. Tell me the order status afterwards. - 01
Open the order first
get_order returns the line items with their IDs, the amounts already refunded and the payment method. The agent refuses to refund more than the order still holds, and stops if a refund for the same item already exists.
- 02
Work out the amount
For "refund the mug" the agent takes that line's total from the order, so you do not type amounts. For a goodwill refund it uses the number you gave and refunds that amount without line items.
- 03
Choose gateway or manual
create_refund uses the payment gateway by default. If the order was paid by cash on delivery or a check, the agent switches to a manual refund and tells you the money still has to be sent by you.
- 04
Ask before the money moves
create_refund asks for your OK by default, once per order, with the amount and the reason on the screen, so a typo in the list never becomes a refund.
- 05
Note it and check the status
add_order_note records the reason as a private note for the team, and the agent reports the status that follows: a partial refund leaves it unchanged, a full refund sets it to Refunded.
What you get back
Order #1042 (Jordan Lee, card)
Refunded 22.00 via the payment gateway: Ceramic mug x1
Reason: Damaged in transit
Order status: Processing (partial refund, not changed)
Private note added for the team
Stock: restock refunded items is a separate tick in the admin, check the mug count Other ways to ask
- Refund every order in this list in full and mark each order note with the ticket number.
- Refund only the shipping on order 1050, 8.00, as a goodwill gesture.
- Show me which orders on this list are already refunded, and refund none.
- Refund order 1051 manually, because the customer paid by bank transfer.
What WooCommerce allows, and what to know first
- A refund through the payment gateway needs a compatible gateway; a manual refund only records the refund in WooCommerce and the money must be sent through the gateway dashboard or a bank transfer.
- WooCommerce refunds less than the full order value as a partial refund, and the order status does not change to Refunded; a full refund sets it to Refunded.
- Changing an order to Cancelled or Refunded without a refund does not return any money to the customer.
- The REST API refund has an api_refund flag that defaults to true, which uses the payment gateway API to make the refund.
- Gateway transaction fees are usually not recovered on a refund, and a manual refund is typical for Cash On Delivery or Check Payments.
create_refund and add_order_note ask for your OK by default. To run it on a schedule without you, switch confirmation off for those tools in your dashboard.
Sources: WooCommerce Docs: Refunds · WooCommerce Docs: Order statuses · WooCommerce REST API documentation: order refunds
Call create_refund from a script
curl -X POST https://cotlet.dev/api/v1/woocommerce/orders/1042/refunds \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount":"22.00","reason":"Damaged in transit","line_items":[{"line_item_id":7002,"quantity":1,"amount":"22.00"}],"api_refund":true}' {
"refund_id": 1051,
"order_id": 1042,
"amount": "22.00",
"reason": "Damaged in transit",
"refunded_via": "payment gateway",
"order_status": "processing"
} MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is woocommerce_write → create_refund. Example data.
Schedule it in n8n, Make, Zapier or cronWooCommerce tools this automation uses
| Tool | Parameters |
|---|---|
| get_order | order_id |
| create_refund | order_id, amount, reason, line_items, api_refund |
| add_order_note | order_id, note, customer_note |
Frequently asked questions
Does the refund put the item back in stock?
In the admin, restocking is a tick box named Restock refunded items on the refund screen. After a refund, ask the agent to read the product with list_products and check the stock count.
Is it safe to connect WooCommerce to Cotlet?
Yes. You sign in to WooCommerce yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get WooCommerce once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.
Give your agent access to WooCommerce.
Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with WooCommerce.