Razorpay MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Razorpay MCP or direct API to create payment links, track payments, manage refunds, and review settlements through natural language.

Razorpay logoRazorpay
Api KeyOauth2

Razorpay is a payment gateway and financial services platform for Indian businesses. It helps companies accept payments, manage refunds, send invoices, and run payouts.

42 Tools

Try Razorpay now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Razorpay
Try asking
TOOLS

Supported Tools

Every Razorpay action and event your agent gets out of the box.

Cancel Invoice

Tool to cancel an existing Razorpay invoice.

Cancel Payment Link

Tool to cancel a specific payment link.

Create an Order

Tool to create a Razorpay order with specified amount and currency.

Create Contact

Tool to create a contact for payouts in RazorpayX.

Create Customer

Tool to create a new customer in Razorpay.

Create an Invoice

Tool to create an invoice for billing customers.

Create Item

Tool to create an item that can be used in Razorpay invoices.

Create Payment Link

Tool to create a payment link for collecting payments via a shareable URL.

Delete Invoice

Tool to delete an invoice in Razorpay.

Delete item

Tool to delete an existing item from Razorpay.

Fetch All Customers

Tool to retrieve a paginated list of all customers from Razorpay.

Fetch All Invoices

Tool to fetch all invoices with pagination and filtering support.

Fetch All Payment Links

Tool to fetch all payment links with pagination and filtering support.

Fetch All Payments

Tool to retrieve all payments from your Razorpay account with pagination and time filtering support.

Fetch all refunds for a payment

Tool to retrieve all refunds for a specific payment using the Razorpay API.

Fetch a Payment Link

Tool to retrieve details of a specific payment link by its ID.

Fetch Invoice by ID

Tool to fetch a specific invoice by its ID from Razorpay.

Fetch All Orders

Tool to retrieve a paginated list of all orders from Razorpay.

Fetch Order by ID

Tool to fetch details of a specific Razorpay order using its order ID.

Fetch payments by order

Tool to fetch all payments made for a particular order.

Fetch All Refunds

Tool to retrieve all refunds created by you using the Razorpay API.

Get Contact

Tool to retrieve details of a specific contact by ID in RazorpayX.

Retrieve Customer

Tool to retrieve details of a specific customer by their ID.

Get Fund Account

Tool to retrieve details of a specific fund account by its ID.

Get Item

Tool to retrieve complete details of a specific Razorpay item by its ID.

Get Settlement Reconciliation Report

Tool to fetch settlement reconciliation report for a specific date or month from Razorpay.

Get Transfer Reversals

Tool to fetch all reversals for a specific transfer using the Razorpay Route API.

Issue an Invoice

Tool to issue a draft Razorpay invoice to send it to the customer.

List Customer Tokens

Tool to retrieve all tokens (saved payment methods) for a customer.

List Disputes

Tool to retrieve a list of all disputes with pagination support.

List Fund Accounts

Tool to retrieve a list of all fund accounts from RazorpayX with pagination support.

List Fund Validations

Tool to fetch all fund account validation transactions from RazorpayX with pagination support.

List Items

Tool to retrieve a list of all items from Razorpay with pagination support.

List Payment Downtimes

Tool to fetch all active payment method downtimes from Razorpay.

Notify Payment Link

Tool to send or resend notification for a payment link via SMS or email.

Send/Resend Invoice Notification

Tool to send or resend an invoice notification via email or SMS.

Update Contact

Tool to update an existing contact's details in RazorpayX.

Update Customer

Tool to update an existing customer's details in Razorpay.

Update Invoice

Tool to update an existing draft invoice in Razorpay.

Update Item

Tool to update an existing item's details in Razorpay.

Update Order

Tool to update an existing order in Razorpay.

Update payment link

Tool to update an existing payment link in Razorpay.

SETUP GUIDE

Connect Razorpay MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK for Python or TypeScript
2

Initialize Client and Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });
const session = await composio.create('your-user-id');
console.log(`Tool Router session created: ${session.mcp.url}`);
Import and initialize the Composio client, then create a Tool Router session for Razorpay
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: session.mcp.url,
    headers: {
      'x-api-key': 'your-composio-api-key',
    },
  },
});

const tools = await client.tools();
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{
    role: 'user',
    content: 'Check the latest Razorpay refund status for payment ID pay_29QQoUBi66xm2f'
  }],
  maxSteps: 5,
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent (Anthropic Claude or Mastra)
SETUP GUIDE

Connect Razorpay API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Razorpay Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'List the 10 most recent Razorpay payments and summarize any failed transactions'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Razorpay actions with your Agent

Why Use Composio?

AI Native Razorpay Integration

  • Supports both Razorpay MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable payment and refund workflows
  • Rich coverage for reading, writing, and querying Razorpay payment data without bespoke integration code

Managed Auth

  • Configure Razorpay API key or OAuth access with auth_configs.create()
  • Link user accounts securely with connected_accounts.link() instead of hard-coding keys
  • Composio handles secure credential storage and API request handling for each user and environment

Agent Optimized Design

  • Razorpay tools are tuned for AI agents, so payment, order, refund, and invoice actions are easier for models to understand
  • Comprehensive execution logs show what your agent ran, when it ran, and which Razorpay account it used
  • Works through Tool Router sessions and MCP flows, including mcp.create() based server workflows

Enterprise Grade Security

  • Fine-grained RBAC helps control which agents and users can access Razorpay actions
  • Scoped, least privilege access keeps sensitive payment operations under control
  • Full audit trail of agent actions supports finance reviews, incident checks, and compliance workflows
FRAMEWORKS

Use Razorpay with any AI Agent Framework

Choose a Framework you want to connect Razorpay with

FAQ

Frequently asked questions

Yes, Razorpay requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with Razorpay.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Razorpay tool your agent needs.Free to start.

Start building