Template

AI agent for ecommerce: order exceptions, returns and refund approvals

This template handles the exceptions in an online shop: a failed payment, a late parcel, a return request. An agent gathers the order and payment facts and recommends an outcome, and a person approves any refund above your threshold.

Last reviewed 7 October 2026

Status

Starting point

The status rests on the Stripe MCP server entry in the library and the governed customer refund approval template, which is itself a starting point. The catalogue does not list which Stripe actions the server exposes, so the shop side is yours to build.

The library has a template, chatflow, MCP server or governed template that covers part of the job. You assemble the rest in Studio.

The job

What this template does

A shop runs on routine orders and is judged on the odd ones. A card is declined after dispatch, a customer asks to change the address an hour late, a parcel arrives broken. The owner of this work is usually the operations lead or the shop owner, with a part-time person working a shared inbox. Mistakes come from looking in three places for one order, and from a refund being typed in without a second look.

The template gives each exception the same treatment. An agent reads the order and the payment, names the type of exception, and recommends an outcome with its reasons. Your own rules, such as the return window, apply in a code step. Money moves only after the approval rule you set. It does not run your fulfilment or your stock.

Workflow

The workflow, step by step

Steps marked as approval gates pause the run until a named person approves. Nothing after a gate runs before that decision, and the decision is recorded.

  1. 01

    Order event arrives

    A webhook from the shop, or a scheduled check for flagged orders, starts the run with the order reference. If the customer wrote in, the message is attached. The run starts with the order number and nothing else.
  2. 02

    Name the exception

    The agent reads the order and the message and picks one type: failed payment, address change, late shipment, damaged item, return request or other. When it is unsure it says so and routes to a person. The type and a short reason go forward.
  3. 03

    Gather the facts

    The flow reads the order lines, the payment status in Stripe and any earlier returns for the same customer. Every call is a read. The facts are bundled into one summary so the next step works from a single source.
  4. 04

    Apply your rules and recommend

    A code step applies your return window, item exclusions and value limits. The agent then recommends an outcome, such as refund, replacement, store credit or decline, with the rule it relied on. It writes the draft customer message alongside.
  5. 05

    Approver decides on money

    Any refund, cancellation or credit above your threshold pauses the run for a named person, who sees the facts, the rule and the recommendation. Below the threshold the flow can proceed alone if you choose that. Assign approvers apart from whoever handles the inbox.Approval gate: a named person approves before the next step runs.
  6. 06

    Carry out the outcome

    After approval the flow issues the refund or cancels the order through the payment and shop tools and updates the order note. A failed call stops the run and flags it. Nothing is retried on money without a person seeing it.
  7. 07

    Tell the customer and record

    The approved message goes to the customer. The run keeps the exception type, the facts read, the recommendation, the approver, the amount and the message sent, so a chargeback or complaint can be answered from one record.
Controls

What it can do, cannot do, needs approval for, and records

Can

  • Classify an order exception from the order and message
  • Read order, payment and return history
  • Apply your return rules in a code step
  • Draft the customer message

Cannot

  • Refund above the threshold without a person
  • Change prices, stock or product listings
  • Decide fraud or chargeback disputes
  • Retry a failed money movement on its own

Requires approval

  • Refunds and credits above the shop threshold
  • Order cancellations after dispatch
  • Any case the agent marks as unsure

Records

  • Order reference and exception type
  • Facts read and the rule applied
  • Recommendation as presented
  • Approver, decision, amount and time
  • The message sent to the customer
Honest labels

What the library holds for this job

AssetTypeCoversRole in this flow
Stripe MCP serverMCP server entryPart of the jobA library entry for a Stripe MCP server that needs STRIPE_API_KEY; the catalogue does not say which actions it exposes.
Customer refund approvalGoverned templatePart of the jobThe approval pattern for refunds above a threshold, with a record for each refund.
Stripe MCPMarketplace sample listingSample listing, no template behind itA sample Marketplace listing for refunds, subscriptions and customer lookup; no template is seeded behind it.
Generate Product DescriptionsPromptUsed inside the flowA starting prompt if you also want drafted product copy for a person to publish.
ShopifyIntegrationUsed inside the flowThe shop platform the order is read from.
Read from the template, prompt, MCP and Marketplace data on the site. A Marketplace sample listing is a catalogue preview with no template seeded behind it.
Connections

Integrations this flow uses

  • Shopify: Source of orders, items and customer details.
  • WooCommerce: The same read for shops that run on WooCommerce.
  • Stripe: Payment status and, after approval, refunds.
  • Zendesk: Where customer messages about orders arrive.

The full list of tools Studio connects to is on the integrations page.

Before you start

What you supply, and what this page does not cover

  • You supply the return window, exclusions and refund limits. The refund threshold is <refund approval threshold - set by the shop owner>.
  • Which Stripe actions an agent can call through the MCP entry is not listed in the catalogue. Check the server before you rely on a refund call.
  • Fraud screening, chargeback evidence and tax treatment are not covered.

Common questions

Will the agent refund customers on its own?
Only where you tell it to. Refunds above the threshold you set wait for a named approver. Whether small refunds run without a person is your choice; if in doubt, leave the gate on for every refund until you have read a few weeks of records.
Does it connect to Shopify and WooCommerce directly?
Both appear in the integration catalogue, which is where this template reads orders. What each integration can read or write depends on its configuration and your credentials, so test a read on a sample order before you build on it.
Can it write product descriptions too?
A starting prompt for product descriptions is in the library, and a model can draft copy. The flow here is about order exceptions, so drafted copy would be a separate flow with a person publishing it.
How does this differ from a customer service chatbot?
A chatbot talks to the customer. This flow works on the order itself: it reads, recommends and acts after approval. You can pair them, with the chatbot handing a refund request to this flow.

Build this in Studio

Describe what you need in plain language. Studio builds the agents and workflows, and you keep every version.