canonical: https://jentic.com/apis/razorpay.com/razorpay

# Razorpay API

The Razorpay API accepts and captures payments, issues refunds, and organises the money flow around them for businesses selling in India. It covers orders, customers and their saved tokens, invoices and items, subscriptions with plans and addons, payment links, QR codes, virtual accounts, transfers with reversals, and settlements with a combined reconciliation report. Every amount is an integer in paise, the smallest currency unit, so 49900 means 499 rupees.

## For AI agents

Create orders, capture and refund payments, send payment links and invoices, run subscriptions, and reconcile settlements on Razorpay, with all amounts in paise.

## Scope

Does not handle storefront product listings, shipping, tax filing, or accounting ledgers. Use for collecting, refunding, and settling payments on Razorpay only.

## Capabilities

- Create an order with amount and currency, then list the payments made against it via `/orders/{id}/payments`
- Capture an authorized payment by passing amount and currency to `/payments/{id}/capture`
- Refund a payment in full or in part through `/payments/{id}/refund`, or raise a standalone refund with a payment_id
- Send a payment link with an amount, customer details, an expire_by time, and a callback_url, and cancel it if plans change
- Run recurring billing by creating plans and subscriptions with plan_id and total_count, then pause, resume, or cancel them
- Draft, issue, and cancel invoices built from line_items and reusable items
- Pull settlements and the combined settlement reconciliation report for a given year, month, and day

## Use cases

### Payment operations from an AI agent through Jentic

A support or operations agent often needs to look up a payment and act on it: capture a held payment, refund a disputed one, or check an order's payments. Through Jentic the agent searches for 'refund a Razorpay payment', receives the refund operation with its amount, speed, and notes inputs, and calls it with your key_id and key_secret injected by your self-hosted Jentic One instance. A rule can keep it to reads and refunds, away from transfers.

Example prompt: Call GET `/payments/{id}` for payment 'pay_29QQoUBi66xm2f', confirm it is captured, then POST `/payments/{id}/refund` with amount 50000

### Order-based checkout

Razorpay checkout starts from an order. A backend creates the order with an amount in paise, a currency, and an optional receipt reference, hands the order id to the checkout, and later reads the order's payments to confirm what was paid. Payments that arrive authorized can be captured with the same amount and currency.

Example prompt: POST /orders with amount 49900, currency 'INR', and receipt 'rcpt_1042', then call GET `/orders/{id}/payments` to list payments made on the returned order

### Collect payments by link or QR code

Businesses without a website collect money by sharing a link or showing a QR code. The payment links operation takes an amount, a description, customer details, notify settings, and an expire_by time, and can be cancelled later. QR codes are created, listed, and closed through their own operations, and virtual accounts give each customer a dedicated receiving account.

Example prompt: POST /payment_links with amount 149900, currency 'INR', description 'Workshop seat', and reference_id 'WS-2207', then share the returned short_url

### Subscription billing

Recurring products are modelled as plans, and each customer subscription points at a plan_id with a total_count of billing cycles. The API pauses, resumes, updates, and cancels subscriptions, and addons attach one-off charges to the next cycle. Listing subscriptions accepts a plan_id filter to see everyone on a given plan.

Example prompt: Call GET /subscriptions with plan_id 'plan_00000000000001' to find the customer's subscription, then POST `/subscriptions/{id}/pause` on it

### Settlement reconciliation

Finance teams match bank deposits to the payments, refunds, and fees behind them. The settlements operations list and fetch settlements, and the combined reconciliation report takes year, month, and optional day parameters to return the transactions settled in that window.

Example prompt: Call GET `/settlements/recon/combined` with year 2026, month 11, and day 11, then total the settled amounts by entity type

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/orders` | Create an order |
| GET | `/payments/{id}` | Fetch a payment |
| POST | `/payments/{id}/capture` | Capture a payment |
| POST | `/payments/{id}/refund` | Refund a payment |
| POST | `/payment_links` | Create a payment link |
| POST | `/subscriptions` | Create a subscription |
| POST | `/invoices/{id}/issue` | Issue a draft invoice |
| GET | `/settlements/recon/combined` | Combined settlement reconciliation report |

## Key resources

- **Payments** — Fetch, capture, and refund customer payments
- **Orders** — Create orders that checkout payments attach to
- **Refunds** — Standalone and per-payment refunds
- **Subscriptions and plans** — Recurring billing cycles, addons, pause and resume
- **Invoices and items** — Draft, issue, and cancel invoices from line items
- **Payment links and QR codes** — Shareable ways to collect a payment
- **Settlements** — Settled funds and the combined reconciliation report

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 41 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 89 / 100
  - Developer Experience & Jentic Compatibility: 68 / 100
  - AI-Readiness & Agent Experience: 51 / 100
  - Agent Usability: 92 / 100
  - Security: 10 / 100
  - AI Discoverability: 76 / 100
- **View full report:** https://jentic.com/apis/razorpay.com/razorpay/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Razorpay by hand means building Basic auth from your key_id and key_secret, converting every amount to paise, and paging list endpoints with count and skip. Through Jentic you install once, import the Razorpay API from the API Directory, store the key pair once, and your agent calls it.
- **Permission scoping:** Razorpay puts the target id in the URL path on its fetch and action operations (`/payments/{id}/refund`, `/subscriptions/{id}/pause`, `/customers/{id}/tokens`), so a rule can pin your agent to one customer's tokens or one subscription as well as to chosen operations. You choose the operations it may call, so money-moving ones like transfers or refunds are not included unless you add them.
- **Credential handling:** Your Razorpay key_id and key_secret are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'refund a Razorpay payment' or 'create a payment link', and Jentic returns the matching Razorpay operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Stripe** — Global payments API with payment intents, subscriptions, and invoicing
- **PayPal Payments** — Authorize, capture, and refund PayPal payments
- **Braintree** — Card and wallet payment processing from PayPal
- **Shopify** — Storefront and order management for online shops

## FAQ

### What authentication does the Razorpay API use?

Per its OpenAPI spec, the Razorpay API uses HTTP Basic authentication with your key_id as the username and key_secret as the password. Through Jentic, the pair is stored encrypted by your own Jentic One instance and injected at execution time, so neither value enters the agent's prompt or logs.

### Is there a Razorpay MCP server?

You don't need an MCP server to give your agent the Razorpay API. Jentic connects it directly from the API Directory: import it, store your key_id and key_secret once, and your agent calls it. Operations are discovered on demand, so the agent loads only the Razorpay operation it needs rather than a full set of tool definitions.

### Can I limit what my agent is allowed to do with the Razorpay API?

Yes. A support agent could get a rule allowing GET `/payments/{id}`, GET `/orders/{id}/payments`, and POST `/payments/{id}/refund`, so it can look up a payment and refund it while transfers, fund accounts, and invoice deletion stay out of reach. Every call it makes is logged.

### Why are Razorpay amounts so large?

The spec states that all amounts are integers in paise, the smallest currency unit. An order for 499 rupees is sent as amount 49900 with currency INR, and the same rule applies to captures, refunds, payment links, and transfers.

### Can I issue a partial refund with the Razorpay API?

Yes. POST `/payments/{id}/refund` accepts an optional amount, so passing less than the captured amount refunds part of the payment, and a speed field sets the refund speed. POST /refunds does the same from a payment_id in the body, and GET `/refunds/{id}` reads back the refund.

### What are the rate limits for the Razorpay API?

The OpenAPI spec does not specify rate limits. Check https://razorpay.com/docs/api for current limits before running bulk jobs such as paging through GET /payments with count and skip.

### How do I refund a Razorpay payment through Jentic?

Install Jentic One with `curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | sh`, import the Razorpay API from the API Directory, and store your key_id and key_secret. Your agent searches for 'refund a Razorpay payment', receives POST `/payments/{id}/refund` with its input schema, and calls it with the payment id and amount. To run it on your own infrastructure, install Jentic One from its GitHub repo.
