# Razorpay

```json
{
  "name": "Razorpay",
  "slug": "razorpay",
  "url": "https://composio.dev/toolkits/razorpay",
  "markdown_url": "https://composio.dev/toolkits/razorpay.md",
  "logo_url": "https://logos.composio.dev/api/razorpay",
  "categories": [
    "finance & accounting"
  ],
  "is_composio_managed": false,
  "updated_at": "2026-06-18T10:03:14.260Z"
}
```

![Razorpay logo](https://logos.composio.dev/api/razorpay)

## Description

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.

## Summary

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

## Categories

- finance & accounting

## Toolkit Details

- Tools: 42

## Images

- Logo: https://logos.composio.dev/api/razorpay

## Authentication

- **Api Key**
  - Type: `api_key`
  - Description: Api Key authentication for Razorpay.
  - Setup:
    - Configure Api Key credentials for Razorpay.
    - Use the credentials when creating an auth config in Composio.
- **Oauth2**
  - Type: `oauth2`
  - Description: Oauth2 authentication for Razorpay.
  - Setup:
    - Configure Oauth2 credentials for Razorpay.
    - Use the credentials when creating an auth config in Composio.

## Suggested Prompts

- List recent Razorpay payment failures
- Create payment link for invoice
- Fetch refund status for customer

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `RAZORPAY_CANCEL_INVOICE` | Cancel Invoice | Tool to cancel an existing Razorpay invoice. Use this when you need to cancel an invoice that has been issued but not yet paid. Only invoices in 'issued' status can be cancelled. |
| `RAZORPAY_CANCEL_PAYMENT_LINK` | Cancel Payment Link | Tool to cancel a specific payment link. Use when you need to cancel an active payment link before it expires. The payment link cannot be used after cancellation. |
| `RAZORPAY_CREATE_AN_ORDER` | Create an Order | Tool to create a Razorpay order with specified amount and currency. Use when you need to initiate a payment order before collecting payment from a customer. Amount and currency are mandatory parameters; receipt and notes are optional for internal tracking. |
| `RAZORPAY_CREATE_CONTACT` | Create Contact | Tool to create a contact for payouts in RazorpayX. Use when you need to add a new contact (employee, vendor, or customer) for making payouts. |
| `RAZORPAY_CREATE_CUSTOMER` | Create Customer | Tool to create a new customer in Razorpay. Use when you need to register a customer for recurring payments or saved cards. Returns a customer_id that can be used for future transactions. |
| `RAZORPAY_CREATE_INVOICE` | Create an Invoice | Tool to create an invoice for billing customers. Use when you need to generate an invoice with customer details and line items. You can create a blank invoice in draft state, update it later, and issue it when ready. |
| `RAZORPAY_CREATE_ITEM` | Create Item | Tool to create an item that can be used in Razorpay invoices. Use when you need to create a new product or service entry for invoicing purposes. |
| `RAZORPAY_CREATE_PAYMENT_LINK` | Create Payment Link | Tool to create a payment link for collecting payments via a shareable URL. Use when you need to generate a payment link for a customer to complete payment online. |
| `RAZORPAY_DELETE_INVOICE` | Delete Invoice | Tool to delete an invoice in Razorpay. Use when you need to permanently remove an invoice from the system. Note: Only invoices in 'draft' status can be deleted. Invoices in other statuses (issued, paid, cancelled) cannot be deleted. |
| `RAZORPAY_DELETE_ITEM` | Delete item | Tool to delete an existing item from Razorpay. Use when you need to permanently remove an item from the system. Items can only be deleted if they are not associated with any invoices. |
| `RAZORPAY_FETCH_ALL_CUSTOMERS` | Fetch All Customers | Tool to retrieve a paginated list of all customers from Razorpay. Use when you need to get customer details for multiple customers or iterate through the customer base. |
| `RAZORPAY_FETCH_ALL_INVOICES` | Fetch All Invoices | Tool to fetch all invoices with pagination and filtering support. Use when you need to retrieve a list of invoices, optionally filtered by payment ID, customer ID, receipt, or date range. |
| `RAZORPAY_FETCH_ALL_PAYMENT_LINKS` | Fetch All Payment Links | Tool to fetch all payment links with pagination and filtering support. Use when you need to retrieve a list of payment links, optionally filtered by payment ID, reference ID, or date range. |
| `RAZORPAY_FETCH_ALL_PAYMENTS` | Fetch All Payments | Tool to retrieve all payments from your Razorpay account with pagination and time filtering support. Use when you need to list payments, audit transactions, or analyze payment history. Returns payments in descending order by creation time (newest first). |
| `RAZORPAY_FETCH_ALL_REFUNDS_FOR_A_PAYMENT` | Fetch all refunds for a payment | Tool to retrieve all refunds for a specific payment using the Razorpay API. Use when you need to check refund status, track refund history, or list all refunds associated with a particular payment. |
| `RAZORPAY_FETCH_A_PAYMENT_LINK` | Fetch a Payment Link | Tool to retrieve details of a specific payment link by its ID. Use when you need to check the status, amount, customer details, or other attributes of an existing payment link. |
| `RAZORPAY_FETCH_INVOICE_BY_ID` | Fetch Invoice by ID | Tool to fetch a specific invoice by its ID from Razorpay. Use when you need to retrieve complete details of an invoice including customer information, line items, amounts, and payment status. |
| `RAZORPAY_FETCH_ORDERS` | Fetch All Orders | Tool to retrieve a paginated list of all orders from Razorpay. Use when you need to fetch multiple orders, filter by date range, receipt, or authorization status. |
| `RAZORPAY_FETCH_ORDERS_BY_ID` | Fetch Order by ID | Tool to fetch details of a specific Razorpay order using its order ID. Use when you need to retrieve order information, check order status, or verify payment details. |
| `RAZORPAY_FETCH_PAYMENTS_BY_ORDER` | Fetch payments by order | Tool to fetch all payments made for a particular order. Use when you need to retrieve payment details associated with a specific order ID. |
| `RAZORPAY_FETCH_REFUNDS` | Fetch All Refunds | Tool to retrieve all refunds created by you using the Razorpay API. Use when you need to list refunds, track refund status, or analyze refund history with pagination support. |
| `RAZORPAY_GET_CONTACT` | Get Contact | Tool to retrieve details of a specific contact by ID in RazorpayX. Use when you need to fetch information about an existing contact including their name, email, contact details, and metadata. |
| `RAZORPAY_GET_CUSTOMER` | Retrieve Customer | Tool to retrieve details of a specific customer by their ID. Use when you need to fetch customer information including name, email, contact details, and custom notes. |
| `RAZORPAY_GET_FUND_ACCOUNT` | Get Fund Account | Tool to retrieve details of a specific fund account by its ID. Use when you need to fetch fund account information including associated contact, account type, and payment details. |
| `RAZORPAY_GET_ITEM` | Get Item | Tool to retrieve complete details of a specific Razorpay item by its ID. Use when you need to fetch information about an item including its name, description, amount, tax details, and other metadata. |
| `RAZORPAY_GET_SETTLEMENT_RECON` | Get Settlement Reconciliation Report | Tool to fetch settlement reconciliation report for a specific date or month from Razorpay. Use when you need to retrieve detailed settlement transaction data for accounting and reconciliation purposes. |
| `RAZORPAY_GET_TRANSFER_REVERSALS` | Get Transfer Reversals | Tool to fetch all reversals for a specific transfer using the Razorpay Route API. Use when you need to check reversal status, track reversal history, or list all reversals associated with a particular transfer. |
| `RAZORPAY_ISSUE_AN_INVOICE` | Issue an Invoice | Tool to issue a draft Razorpay invoice to send it to the customer. Use when you need to issue an invoice that has been created in draft status. Only invoices in 'draft' status can be issued. |
| `RAZORPAY_LIST_CUSTOMER_TOKENS` | List Customer Tokens | Tool to retrieve all tokens (saved payment methods) for a customer. Use when you need to fetch the list of saved payment methods associated with a specific customer ID. |
| `RAZORPAY_LIST_DISPUTES` | List Disputes | Tool to retrieve a list of all disputes with pagination support. Use when you need to view chargebacks, fraud claims, or other payment disputes. Supports filtering by date range and pagination for efficient retrieval of dispute records. |
| `RAZORPAY_LIST_FUND_ACCOUNTS` | List Fund Accounts | Tool to retrieve a list of all fund accounts from RazorpayX with pagination support. Use when you need to fetch payout destinations, view beneficiary accounts, or manage fund account records. Supports filtering by contact and account type for efficient retrieval. |
| `RAZORPAY_LIST_FUND_VALIDATIONS` | List Fund Validations | Tool to fetch all fund account validation transactions from RazorpayX with pagination support. Use when you need to retrieve validation records, check account verification status, or monitor validation transactions. |
| `RAZORPAY_LIST_ITEMS` | List Items | Tool to retrieve a list of all items from Razorpay with pagination support. Use when you need to fetch invoice items, view available products, or manage item catalog. Supports filtering by active status and date range for efficient retrieval. |
| `RAZORPAY_LIST_PAYMENT_DOWNTIMES` | List Payment Downtimes | Tool to fetch all active payment method downtimes from Razorpay. Use when you need to check the current status of payment methods and identify any ongoing or scheduled downtimes. |
| `RAZORPAY_NOTIFY_PAYMENT_LINK` | Notify Payment Link | Tool to send or resend notification for a payment link via SMS or email. Use when you need to notify a customer about a payment link. |
| `RAZORPAY_SEND_OR_RESEND_NOTIFICATION` | Send/Resend Invoice Notification | Tool to send or resend an invoice notification via email or SMS. Use when you need to notify customers about an invoice through their preferred communication channel. |
| `RAZORPAY_UPDATE_CONTACT` | Update Contact | Tool to update an existing contact's details in RazorpayX. Use when you need to modify contact information such as name, email, phone number, type, reference ID, or notes. |
| `RAZORPAY_UPDATE_CUSTOMER` | Update Customer | Tool to update an existing customer's details in Razorpay. Use when you need to modify customer information such as name, email, or contact number. |
| `RAZORPAY_UPDATE_INVOICE` | Update Invoice | Tool to update an existing draft invoice in Razorpay. Use when you need to modify invoice details such as customer information, line items, description, notes, or other fields. Only invoices in draft state can be updated. |
| `RAZORPAY_UPDATE_ITEM` | Update Item | Tool to update an existing item's details in Razorpay. Use when you need to modify the name, description, or amount of an item. Only the fields provided in the request will be updated; other fields remain unchanged. |
| `RAZORPAY_UPDATE_ORDER` | Update Order | Tool to update an existing order in Razorpay. Use when you need to modify the notes field of an order to store or update additional metadata. |
| `RAZORPAY_UPDATE_PAYMENT_LINK` | Update payment link | Tool to update an existing payment link in Razorpay. Use when you need to modify payment link details such as reference ID, expiry time, partial payment settings, notes, or reminder preferences. |

## Supported Triggers

None listed.

## Installation and MCP Setup

### Path 1: SDK Installation

#### Path 1, Step 1: Install Composio

Install the Composio SDK
```python
pip install composio_openai
```

```typescript
npm install @composio/openai
```

#### Path 1, Step 2: Initialize Composio and Create Tool Router Session

Import and initialize Composio client, then create a Tool Router session
```python
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
openai = OpenAI()
session = composio.create(user_id='your-user-id')
```

```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');
```

#### Path 1, Step 3: Execute Razorpay Tools via Tool Router with Your Agent

Get tools from Tool Router session and execute Razorpay actions with your Agent
```python
tools = session.tools
response = 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'
  }]
)
result = composio.provider.handle_tool_calls(
  response=response,
  user_id='your-user-id'
)
print(result)
```

```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);
```

### Path 2: MCP Server Setup

#### Path 2, Step 1: Install Composio

Install the Composio SDK for Python or TypeScript
```python
pip install composio claude-agent-sdk
```

```typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
```

#### Path 2, Step 2: Initialize Client and Create Tool Router Session

Import and initialize the Composio client, then create a Tool Router session for Razorpay
```python
from composio import Composio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

composio = Composio(api_key='your-composio-api-key')
session = composio.create(user_id='your-user-id')
url = session.mcp.url
```

```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}`);
```

#### Path 2, Step 3: Connect to AI Agent

Use the MCP server with your AI agent (Anthropic Claude or Mastra)
```python
import asyncio

options = ClaudeAgentOptions(
    permission_mode='bypassPermissions',
    mcp_servers={
        'tool_router': {
            'type': 'http',
            'url': url,
            'headers': {
                'x-api-key': 'your-composio-api-key'
            }
        }
    },
    system_prompt='You are a helpful assistant with access to Razorpay tools.',
    max_turns=10
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query('Check the latest Razorpay refund status for payment ID pay_29QQoUBi66xm2f')
        async for message in client.receive_response():
            if hasattr(message, 'content'):
                for block in message.content:
                    if hasattr(block, 'text'):
                        print(block.text)

asyncio.run(main())
```

```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}`);
```

## Why Use Composio?

### 1. 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

### 2. 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

### 3. 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

### 4. 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

## Use Razorpay with any AI Agent Framework

Choose a framework you want to connect Razorpay with:

- [Claude Cowork](https://composio.dev/toolkits/razorpay/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/razorpay/framework/codex)

## Related Toolkits

- [Stripe](https://composio.dev/toolkits/stripe) - Stripe is a global online payments platform offering APIs for managing payments, customers, and subscriptions. Trusted by businesses for secure, efficient, and scalable payment processing worldwide.
- [Alpaca](https://composio.dev/toolkits/alpaca) - Alpaca is a stock and crypto trading platform for commission-free trading, real-time market data, and algorithmic strategies. Use it to build brokerage apps, trading bots, and portfolio workflows with market connectivity.
- [Alpha vantage](https://composio.dev/toolkits/alpha_vantage) - Alpha Vantage is a financial data platform offering real-time and historical stock market APIs. Get instant, reliable access to equities, forex, and technical analysis data for smarter trading decisions.
- [Altoviz](https://composio.dev/toolkits/altoviz) - Altoviz is a cloud-based billing and invoicing platform for businesses. It streamlines online payments, expense tracking, and customizable invoice management.
- [Benzinga](https://composio.dev/toolkits/benzinga) - Benzinga provides real-time financial news and data APIs for market coverage. It helps you track breaking news and actionable market insights instantly.
- [Brex](https://composio.dev/toolkits/brex) - Brex provides corporate credit cards and spend management tailored for startups and tech businesses. It helps optimize company cash flow, streamline accounting, and accelerate business growth.
- [Chaser](https://composio.dev/toolkits/chaser) - Chaser is accounts receivable automation software that sends invoice reminders and helps businesses get paid faster. It streamlines the collections process to save time and improve cash flow.
- [Clientary](https://composio.dev/toolkits/clientary) - Clientary is a platform for managing clients, invoices, projects, proposals, and more. It streamlines client work and saves you serious admin time.
- [Coinbase](https://composio.dev/toolkits/coinbase) - Coinbase is a platform for buying, selling, and storing cryptocurrency. It makes exchanging and managing crypto simple and secure for everyone.
- [Coinranking](https://composio.dev/toolkits/coinranking) - Coinranking is a comprehensive cryptocurrency market data platform offering access to real-time coin prices, market caps, and historical data. Get accurate, up-to-date stats for thousands of digital assets in one place.
- [Coupa](https://composio.dev/toolkits/coupa) - Coupa is a business spend management platform for procurement, invoicing, and expenses. It helps organizations streamline purchasing, control costs, and gain complete visibility over financial operations.
- [CurrencyScoop](https://composio.dev/toolkits/currencyscoop) - CurrencyScoop is a developer-friendly API for real-time and historical currency exchange rates. Easily access fiat and crypto data for smart, up-to-date financial applications.
- [Daffy](https://composio.dev/toolkits/daffy) - Daffy is a modern charitable giving platform with a donor-advised fund. Easily set aside funds, grow them tax-free, and donate to over 1.7 million U.S. charities.
- [Eagle doc](https://composio.dev/toolkits/eagle_doc) - Eagle doc is an AI-powered OCR API for invoices and receipts. It delivers fast, reliable, and accurate document data extraction for seamless automation.
- [Elorus](https://composio.dev/toolkits/elorus) - Elorus is an online invoicing and time-tracking software for freelancers and small businesses. Easily manage finances, bill clients, and track work in one place.
- [Eodhd apis](https://composio.dev/toolkits/eodhd_apis) - Eodhd apis delivers comprehensive financial data, including live and historical stock prices, via robust APIs. Easily access reliable, up-to-date market insights to power your apps, dashboards, and analytics.
- [Fidel api](https://composio.dev/toolkits/fidel_api) - Fidel api is a secure platform for linking payment cards to web and mobile apps. It enables real-time card transaction monitoring and event-based automation for businesses.
- [Finage](https://composio.dev/toolkits/finage) - Finage is a secure API platform delivering real-time and historical financial data for stocks, forex, crypto, indices, and commodities. It empowers developers and businesses to access, analyze, and act on market data instantly.
- [Finmei](https://composio.dev/toolkits/finmei) - Finmei is an invoicing tool that simplifies billing, invoice management, and expense tracking. Ideal for automating and organizing your business finances in one place.
- [Fixer](https://composio.dev/toolkits/fixer) - Fixer is a currency data API offering real-time and historical exchange rates for 170 currencies. Instantly access accurate, up-to-date forex data for your applications and workflows.

## Frequently Asked Questions

### Do I need my own developer credentials to use Razorpay with Composio?

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.

### Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. [Learn more](https://docs.composio.dev/tool-router/overview).

### Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. [Learn more](https://trust.composio.dev).

### What if the API changes?

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

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
