Let AI agents refund, message and pay, inside your limits
For teams whose agents already handle support refunds, WhatsApp order updates, rider and vendor payouts or stock orders. AgentRaaS sits between the agent and Razorpay, Cashfree, RazorpayX, Gupshup or your own systems: every action runs once, a refund is checked against what the order really cost, big ones wait for a person, and every action is in the audit trail.
See the refund agentSelf-host itWhat it stops
| What goes wrong | What AgentRaaS does |
|---|---|
| A retried refund is paid twice | The same refund runs once; a repeat gets the first answer back. |
| The agent refunds more than the order was worth, or was talked into it | AgentRaaS reads the order from the provider itself before the refund runs, and holds anything over your limit (for example half the order) for a person. |
| Small refunds add up | A spend cap limits refunds per agent per day, counted in India time. |
| A customer gets the same WhatsApp message five times | The same message to the same number is sent once. |
| An agent stuck in a loop messages customers at night | A policy allows messages only during the hours you set. |
| A rider payout times out and is paid again | Every payout carries one idempotency key that survives retries; a call that may have gone through is never retried blindly. |
| A pricing agent sets a price far too low | A validation rule checks the price range; a big drop can wait for approval. |
| The payment gateway goes down during a sale | The circuit breaker pauses calls instead of hammering it; failed calls wait in Failed requests to be replayed. |
| "Why did the bot refund this?" | Every action, run or refused, is in the audit trail with the reason. |
A support agent that refunds orders
A customer says an item was missing. The agent may refund it, but never more than half of what the order cost, and never more than a day's budget. The limit comes from the order Cashfree has, not from anything the agent sends:
POST /api/v1/action-policies
{ "org_id": "org_acme", "agent_id": "support-agent",
"service": "cashfree", "action": "refund.create", "effect": "require",
"fields": { "refund_amount": { "max_from": {
"action": "order.get", "with": { "order_id": "order_id" },
"field": "order_amount", "factor": 0.5 } } },
"on_violation": "hitl" }
A refund over half the order, a refund with no amount (which would refund everything) and a refund for an order Cashfree can't find all wait for a person instead of running. With Razorpay, the same rule reads payment.get and subtracts what was already refunded. For store credits or wallet top-ups, point it at your own order API through a custom action.
Every case of this tutorial, with the real requests and responses, and the same steps clicked through in the dashboard: A support agent that refunds orders.
Built in for India
| Service | What an agent can do |
|---|---|
| Razorpay | Create orders, read a payment, refund it |
| Cashfree Payments | Create and read orders, refund them (with a test-mode version for sandbox keys) |
| RazorpayX Payouts | Pay riders, sellers and vendors; read a payout |
| Gupshup | Send WhatsApp messages |
| Your own systems | Wallet credits, coupons, order changes, stock: any HTTP API as a custom action, with the same checks |
Setup for each, with a first rule worth adding: Recipes.
When there is no API
Quick-commerce platforms don't offer open seller APIs. Brands that sell through them work from portal reports, emailed purchase orders and the seller panel. AgentRaaS can't sit inside someone else's portal, but most of the work around it does go through an API you control:
- The actions around the portal: the email back to the buyer, the WhatsApp update, the payment, the stock change in your own system. Each one can go through AgentRaaS and be checked, capped and recorded.
- No-code workflows: an n8n, Make or Zapier flow that reads the purchase-order email and acts on it sends its HTTP steps through AgentRaaS, with the same checks. In Connect agent, pick Make, Zapier or another HTTP tool, or use the n8n node.
- Your own scripts: a Python script that processes a report can make each action run once with library mode, with no server at all.
- Agents that click through a seller portal in a browser are not covered yet: there is no API call to check. If that is your case, tell us how your agent works.
Busy days
Measured on one 4-core desktop running everything itself: 1,000 new calls a second with a p50 of 3 ms, a p99 of 142 ms and no errors, and 300 refunds a second with a lookup limit at a p99 of 3.4 ms. Two server instances sharing one database still ran every call exactly once, with every call sent to both at the same moment. More instances can share the load; the speedup on separate machines is not measured yet. The numbers and how to reproduce them.
Keep it on your servers
Self-hosted, AgentRaaS runs on your own servers, for example in an Indian cloud region: your provider keys, your customers' order data and the audit trail stay with you. Install with one command, Docker or Podman, or the Helm chart and AWS template: Self-hosting.
Before you go live
- Start on test keys (Cashfree test mode, Razorpay and RazorpayX test keys) with the same rules you plan to use live.
- Start strict: send every refund for approval, then raise the limit as you trust the agent. Set the daily caps from your own refund data.
- Run the chaos tester against your agent before a big sale, to see it handle timeouts and duplicates.
Using another service?
PhonePe, Paytm, Shiprocket, Delhivery or MSG91: any of them works today as a custom action, with the same checks. Tell us which ones you want built in.
Ask in the communityCustom actions