Both work. Both have millions of merchants. Both support UPI, cards, netbanking, wallets, and EMI. If you pick either one, you won't regret it.
So the question isn't "which one is good" — it's "which one should I use for this project, in this context." That's what this post answers.
I'll compare them across the eight dimensions that actually matter for developers building apps and AI agents in India, then give you a clear recommendation for each scenario.
The numbers upfront
| Dimension | Cashfree | Razorpay |
|---|---|---|
| Standard MDR | 1.75% | 2% |
| Settlement speed | T+1 (default) | T+2 (T+1 costs extra) |
| International | 15+ currencies | 100+ currencies |
| Subscription billing | Yes | Yes (more mature) |
| Official SDKs | Python, Node, Java, PHP, .NET | Python, Node, Java, PHP, Ruby |
| API version | 2023-08-01 | v1 (stable) |
| Sandbox access | Instant, no approval | Instant, no approval |
| Webhook format | HMAC-SHA256 + base64 | HMAC-SHA256 hex |
The 0.25% MDR difference sounds small. On ₹10 lakh/month of transactions it's ₹2,500 — about ₹30,000/year. On ₹1 crore/month it's ₹25,000/month. That compounds fast.
Pricing deep-dive
Cashfree's pricing page lists 1.75% for all domestic transactions — cards, UPI, netbanking, wallets. No per-transaction fees on top.
Razorpay charges 2% standard, dropping to 1.75% if you're on a custom enterprise plan (which requires meaningful volume and a sales conversation). Until you negotiate that, you pay 2%.
Both waive MDR for UPI payments on some transaction tiers — check the current promotions since NPCI's zero-MDR policy for UPI below ₹2,000 has had several revisions in 2025-26.
For subscriptions and recurring billing, Razorpay is ahead — their Subscriptions product has more configuration options, better retry logic, and cleaner dunning workflows. If subscription revenue is your primary model, Razorpay's extra features probably justify the extra 0.25%.
Settlement speed
This is Cashfree's clearest win.
Cashfree settles T+1 by default — payments received today hit your bank account tomorrow. For businesses with tight cash flow (most Indian startups), this matters.
Razorpay settles T+2 by default. T+1 is available but it's a paid feature on higher plans, or requires negotiating it into your contract.
For an AI agent that's processing payments and needs to confirm availability before fulfilling an order, T+1 vs T+2 can mean the difference between shipping same-day or next-day.
API and SDK quality
Both have clean REST APIs. Both have official Python SDKs. Neither will frustrate you.
Cashfree API (POST /pg/orders):
from cashfree_pg.api_client import Cashfree
from cashfree_pg.models.create_order_request import CreateOrderRequest
cf = Cashfree(
XEnvironment=Cashfree.PRODUCTION,
XClientId=os.environ["CASHFREE_CLIENT_ID"],
XClientSecret=os.environ["CASHFREE_CLIENT_SECRET"],
)
response = cf.PGCreateOrder(CreateOrderRequest(...), None, None)
session_id = response.data.to_dict()["payment_session_id"]
Razorpay API (POST /v1/orders):
import razorpay
client = razorpay.Client(
auth=(os.environ["RAZORPAY_KEY_ID"], os.environ["RAZORPAY_KEY_SECRET"])
)
order = client.order.create({
"amount": 249900, # in paise — Razorpay uses paise, Cashfree uses rupees
"currency": "INR",
"receipt": "order_receipt_001",
})
order_id = order["id"]
One practical difference: Razorpay amounts are in paise, Cashfree amounts are in rupees. This is a constant source of bugs — I've seen ₹1 charges processed as ₹0.01 because someone forgot the conversion. Cashfree's approach is less error-prone.
Both have webhook signatures, but the format differs:
- Cashfree: HMAC-SHA256 with base64 encoding of the digest
- Razorpay: HMAC-SHA256 with hex encoding
Neither is better — just different. Make sure you're using the right encoding or your signature checks will silently fail.
Which works better for AI agents?
For agentic workflows specifically, both are viable but Cashfree has two advantages:
1. Cleaner event model for webhooks
Cashfree's webhook payload is consistent: data.order.order_id, data.payment.payment_status, data.payment.cf_payment_id. The structure is predictable, which matters when you're writing a Claude tool definition that needs to parse it reliably.
Razorpay's webhook payload structure varies by event type, and some fields are nested differently depending on whether it's a payment, refund, or subscription event. Not a dealbreaker, but more parsing logic.
2. Tool definition works better with rupee amounts
When Claude is calling a create_payment_link tool, it needs to know the amount format. With Cashfree you define "amount": 2499 for ₹2,499. With Razorpay you'd need "amount": 249900 (paise) — models consistently make mistakes here, and you need extra prompt engineering to enforce the conversion. The tool design post covers why simpler parameter schemas mean fewer agent errors.
See the Cashfree AI agent tutorial for a complete working implementation with the Claude tool definition, webhook handler, and n8n workflow.
When to choose Cashfree
- New project starting fresh — no migration cost, better pricing, faster settlement
- Cost-sensitive at any scale — the 0.25% difference adds up quickly
- Building agentic workflows — cleaner webhook events, rupee amounts, reliable SDK
- Need T+1 settlement without paying extra for it
- India-only payments — Cashfree's domestic stack is excellent
When to stick with Razorpay
- Already integrated and running — migration cost and risk rarely justify switching for a working integration
- Subscription-heavy business — Razorpay Subscriptions is more mature, better retry logic
- Significant international volume (>30% of transactions) — Razorpay supports 100+ currencies vs Cashfree's 15+
- Need Razorpay's ecosystem — their Capital, Payroll, and RazorpayX products are integrated, which can matter if you're building on those
Migrating from Razorpay to Cashfree
If you're switching, here's what changes:
| Concept | Razorpay | Cashfree |
|---|---|---|
| Amount unit | Paise (integer) | Rupees (float) |
| Order ID field | id | order_id |
| Auth method | Key ID + Secret (Basic auth) | Client ID + Secret (custom headers) |
| Webhook signature | HMAC-SHA256 hex | HMAC-SHA256 base64 |
| Payment status | captured / failed | PAID / FAILED / USER_DROPPED |
| API base URL | https://api.razorpay.com/v1 | https://api.cashfree.com/pg |
The core flow (create order → redirect to checkout → handle webhook) is identical. The migration is a few hours of work, not a few days.
The honest verdict
Start new projects on Cashfree. The pricing advantage is real, T+1 settlement is meaningful, and the API is clean enough that there's no learning curve if you're coming from Razorpay.
Don't migrate existing Razorpay integrations unless you have a specific reason — subscription billing improvements, the T+1 settlement, or you're scaling to where the 0.25% MDR difference becomes significant (roughly ₹50L+/month).
For AI agents: Cashfree is the better choice. Rupee amounts, clean webhook events, and a reliable SDK mean less prompt engineering and fewer edge cases in your tool definitions.



