Everything an AI agent can do with the Razorpay API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints36
API versionv1
Last updated23 June 2026
Orientation

How the Razorpay API works.

The Razorpay API is how an app or AI agent works with a Razorpay account: creating an order, capturing a payment, refunding a customer, running recurring subscriptions, or sending a bank payout through RazorpayX. Access is granted through an API key that is account-level and carries no per-endpoint scopes, so any valid key can reach every API the account is enabled for. A state change emits an event that Razorpay can deliver to a registered endpoint.

36Endpoints
9Capability groups
17Read
19Write
0Permissions
Authentication
Razorpay authenticates first-party calls with an API key over HTTP Basic auth, not OAuth: the key id is the username and the key secret is the password. A key pair belongs to one mode, either test (rzp_test_) or live (rzp_live_), and the key secret is revealed only once, when the key is generated. OAuth 2.0 exists separately for partners acting on merchant accounts they don't own.
Permissions
A Razorpay API key is account-level and carries no per-endpoint scopes. Any valid key can call every API the account is enabled for, so the key alone is the boundary, and a leaked live key reaches the whole account. This is why a governing layer in front of the key is the only way to give one agent narrower access than another.
Versioning
Razorpay carries a single URL version, v1, and describes its API changes as backward-compatible, so there is no dated version string to pin per request. RazorpayX payouts made an idempotency key mandatory on all payout requests from 15 March 2025, and Razorpay shipped an official MCP server in 2025.
Data model
Razorpay is resource-oriented REST with JSON requests and responses and predictable /v1/ paths. A collection is typically gated by an Order, which a Payment is captured against and a Refund returns; recurring billing combines Plans and Subscriptions, and RazorpayX adds Contacts, Fund Accounts, and Payouts for sending money out. A state change emits an event delivered by webhook, and amounts are always in the smallest currency unit, such as paise for rupees.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to Razorpay determines what it can reach. There is a route for making calls, a route for receiving events, and a hosted server that exposes Razorpay tools to agents, and each is governed by the key behind it.

Ways to connect

REST API

The REST API takes JSON request bodies, returns JSON, and pages through lists with a count-and-skip window, at https://api.razorpay.com/v1. A call authenticates with an API key over HTTP Basic auth, sending the key id as the username and the key secret as the password. Every key belongs to one mode, either test or live.

Best forConnecting an app or AI agent to Razorpay.
Governed byThe API key, which is account-level.
Docs ↗

Webhooks

Razorpay POSTs an event payload to an HTTPS endpoint configured in the Dashboard or via the API. The receiver verifies the X-Razorpay-Signature header, an HMAC SHA256 of the raw request body keyed with the webhook secret, to confirm the request came from Razorpay. Events cover payments, orders, refunds, settlements, invoices, subscriptions, payment links, and payouts.

Best forReceiving Razorpay events at an app or AI agent.
Governed byThe webhook secret on the endpoint.
Docs ↗

MCP server

Razorpay publishes an official Model Context Protocol server that exposes Razorpay tools to AI agents and LLM clients. A hosted remote server runs at https://mcp.razorpay.com/mcp with no local setup and authenticates with a merchant token (the base64 of key id and key secret); a self-hosted build runs locally with the key id and key secret. Tools cover orders, payments, payment links, refunds, QR codes, settlements, payouts, and saved tokens.

Best forConnecting an AI agent to Razorpay through MCP.
Governed byThe merchant token or the key id and key secret behind the server.
Docs ↗
Authentication

API key (Basic auth)

Every first-party call authenticates with an API key over HTTP Basic auth: the key id is the username and the key secret is the password. A key pair is account-level and carries no per-endpoint scopes, so any valid key can call any API the account is enabled for. The key secret is shown only once, when the key is generated, and must never be exposed in client code.

TokenKey id and key secret (rzp_test_... / rzp_live_...)
Best forServer-side calls to the Razorpay API.
Docs ↗

OAuth (partners)

Razorpay offers OAuth 2.0 for partners and platforms that act on merchants' accounts they don't own. A merchant authorizes the application, which receives an access token tied to that merchant's account. This is for partner integrations, not for a single business calling its own account.

TokenOAuth access token tied to a merchant account
Best forPartners and platforms connecting to merchants they don't own.
Docs ↗
Capability map

What an AI agent can do in Razorpay.

The Razorpay API is split into areas an agent can act on, like orders, payments, refunds, customers, recurring billing, payment links, settlements, and bank payouts. Each area has its own methods, and writes in some areas move real money or send funds out of the account.

Endpoint reference

Every Razorpay API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion

Orders

Methods for creating and retrieving orders, the record a payment is collected against.4

Razorpay keys are account-level with no per-endpoint scopes; any valid key can call this.

Acts onorder
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only; no per-endpoint scope.

Acts onorder
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only; default page size 10, maximum 100.

Acts onorder
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts onpayment
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventorder.paid
Rate limitStandard limits apply

Payments

Methods for capturing and retrieving payments.4

Collects money; an uncaptured authorized payment is voided if not captured in time.

Acts onpayment
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventpayment.captured
Rate limitStandard limits apply

Read-only; card, EMI, and offer details can be returned with an expand parameter.

Acts onpayment
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only; default page size 10, maximum 100.

Acts onpayment
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Edits the notes object only, not amount or status.

Acts onpayment
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Refunds

Methods for refunding payments and retrieving refunds.4

Returns real money; supports a speed of normal or optimum (instant).

Acts onrefund
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventrefund.created
Rate limitStandard limits apply

Read-only.

Acts onrefund
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only; default page size 10, maximum 100.

Acts onrefund
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Edits the notes object only.

Acts onrefund
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Customers

Methods for creating and retrieving customers.3

A core write; a customer holds email, phone, and saved payment methods.

Acts oncustomer
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only; returns the customer's contact details.

Acts oncustomer
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A core write to a customer record.

Acts oncustomer
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Subscriptions & Plans

Methods for recurring billing through plans and subscriptions.5

A plan is the template a subscription bills against.

Acts onplan
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts onplan
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Starts recurring billing once the customer authorizes the mandate.

Acts onsubscription
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventsubscription.activated
Rate limitStandard limits apply

Read-only.

Acts onsubscription
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Ends recurring billing for the customer.

Acts onsubscription
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventsubscription.cancelled
Rate limitStandard limits apply
Methods for creating and managing hosted payment links.3

Creates a real payable link; can notify the customer by SMS or email.

Acts onpayment_link
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventpayment_link.paid
Rate limitStandard limits apply

Read-only.

Acts onpayment_link
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Only works on a link that has not yet been paid.

Acts onpayment_link
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventpayment_link.cancelled
Rate limitStandard limits apply

Invoices

Methods for creating, issuing, and managing invoices.4

Starts in draft until issued.

Acts oninvoice
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Moves the invoice from draft to issued and notifies the customer.

Acts oninvoice
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventinvoice.paid
Rate limitStandard limits apply

Read-only; default page size 10, maximum 100.

Acts oninvoice
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A cancelled invoice cannot be reverted.

Acts oninvoice
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Settlements

Methods for retrieving settlements, the transfers of collected funds to a bank account.3

Read-only; reveals settled amounts and dates.

Acts onsettlement
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventsettlement.processed
Rate limitStandard limits apply

Read-only.

Acts onsettlement
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only; maps settled amounts back to the underlying transactions.

Acts onsettlement
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Payouts (RazorpayX)

RazorpayX methods for sending money out to contacts and their bank accounts.6

RazorpayX feature; a contact holds a payee's name and details.

Acts oncontact
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

RazorpayX feature; a fund account links a bank account or UPI VPA to a contact.

Acts onfund_account
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Sends real money out of the RazorpayX business account; an Idempotency-Key header is mandatory.

Acts onpayout
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventpayout.processed
Rate limitStandard limits apply

Read-only; RazorpayX feature.

Acts onpayout
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only; RazorpayX feature.

Acts onpayout
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Only works on a payout in the queued state, not one already processing.

Acts onpayout
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply
No endpoints match those filters.
Webhooks

Webhook events.

Razorpay can notify an app when something happens in an account, like a payment being captured or a payout being processed. It POSTs an event payload describing what changed, so an integration learns about activity without polling.

EventWhat it signalsTriggered by
payment.capturedA payment was captured and the funds are collected. An integration fulfills the order on this event./v1/payments/:id/capture
order.paidAn order was fully paid, fired when the payment associated with the order is captured./v1/orders/:id/payments
refund.createdA refund was created against a payment./v1/payments/:id/refunds
subscription.activatedA subscription became active after the customer authorized the mandate, and recurring billing has begun./v1/subscriptions
subscription.cancelledA subscription was cancelled, so recurring billing has stopped./v1/subscriptions/:id/cancel
payment_link.paidA payment link was paid in full by the customer./v1/payment_links
payment_link.cancelledA payment link was cancelled and can no longer be paid./v1/payment_links/:id/cancel
invoice.paidAn invoice was paid in full by the customer./v1/invoices/:id/issue
settlement.processedA settlement was processed and the collected funds were transferred to the linked bank account./v1/settlements
payout.processedA RazorpayX payout was processed and the money was sent to the contact's fund account./v1/payouts
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

Razorpay limits how fast an app can call, returning a rate-limit response when requests arrive too quickly, and pages long lists with a count-and-skip window.

Request rate

Razorpay meters requests by rate, not by a per-method cost or point weighting. The reference does not publish a fixed numeric ceiling; going over returns HTTP 429 with a RATE_LIMIT_EXCEEDED code, and the documentation directs integrations to watch for 429 and retry with an exponential or stepped backoff plus randomization to avoid a thundering-herd of retries. RazorpayX payouts add their own controls, including a mandatory idempotency key and IP allowlisting.

Pagination

A list endpoint uses a count-and-skip window: count sets the page size, default 10 and maximum 100, and skip sets how many records to step past. Lists can also be filtered by a from and to time range. Results are returned newest first.

Request size

A list endpoint returns at most 100 records per page, the maximum value of count. An identifier is 14 characters, alphanumeric and case-sensitive. The notes object on a resource holds up to 15 key-value pairs, each value up to 256 characters.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
400BAD_REQUEST_ERRORThe request was bad: a parameter is missing or invalid, an unsupported value was sent, or the key is wrong. This class also covers authentication and authorization problems.Read the description, field, and reason in the error body, fix the request, and resend. The request is not retryable as-is.
429RATE_LIMIT_EXCEEDEDRequests arrived faster than the allowed rate within the time window.Back off and retry with exponential backoff and jitter, and smooth the request rate.
502GATEWAY_ERRORThe request could not be completed due to an error at the payment gateway or a downstream bank.Confirm the final payment state before retrying, since the downstream system may have acted, and retry idempotently.
500SERVER_ERRORAn error on Razorpay's side while processing the request, which can be transient.Retry with the same idempotency key and request body following the recommended 5XX retry schedule, and contact support if it persists.
Versioning & freshness

Version history.

Razorpay carries one URL version, and describes its changes as backward-compatible, so an integration is not pinned to a dated release the way some payment APIs are.

Version history

What changed, and when

Latest versionv1
v1Current version
Current API (v1)

Razorpay carries a single URL version, v1, and describes its API changes as backward-compatible, so an integration is not pinned to a dated release per request. New resources and fields are added under the same version. Authentication is an account-level API key over HTTP Basic auth.

What changed
  • Single backward-compatible v1 API across orders, payments, refunds, customers, subscriptions, payment links, invoices, settlements, and RazorpayX payouts.
  • Errors carry a code, description, source, step, reason, and field for diagnosis.
2025-04
Official MCP server launched

Razorpay shipped an official Model Context Protocol server, exposing Razorpay tools to AI agents and LLM clients through a hosted remote endpoint and a self-hosted build.

What changed
  • Remote hosted MCP server at mcp.razorpay.com, authenticated with a merchant token.
  • Tools across orders, payments, payment links, refunds, QR codes, settlements, and payouts.
2025-03-15Requires migration
Idempotency key mandatory for payouts

RazorpayX made an idempotency key mandatory on all payout requests, so a retried payout cannot be duplicated.

What changed
  • An Idempotency-Key header is required on every RazorpayX payout request from 15 March 2025.
  • IP allowlisting remains required to make payouts via the API.

Stay on v1; changes are described as backward-compatible.

Razorpay API reference ↗
Questions

Razorpay API, answered.

How does Razorpay authenticate API requests?+
Every API request uses HTTP Basic auth with an API key: the key id is the username and the key secret is the password, sent over HTTPS. A key pair belongs to one mode, test or live, and the key secret is shown only once when the key is generated. There is no per-request signing for standard calls; the key in the Basic auth header is the credential.
Can a Razorpay key be scoped to specific endpoints or resources?+
No. A Razorpay API key is account-level and carries no per-endpoint scopes, so any valid key can call every API the account is enabled for, including refunds and, where RazorpayX is enabled, bank payouts. The key itself is the only boundary, which is why limiting one agent to less than another requires a governing layer in front of the key rather than the key alone.
What's the difference between test and live keys?+
A key pair belongs to one mode. A test key (rzp_test_) operates on simulated data where no real money moves, while a live key (rzp_live_) processes real payments and, with RazorpayX, real payouts. Objects do not cross modes, and the key secret is revealed only once, when the key is generated.
How do I verify a webhook is really from Razorpay?+
Each webhook carries an X-Razorpay-Signature header. The receiver computes an HMAC SHA256 over the raw, unparsed request body using the webhook secret set on the endpoint, and compares it against the header value. A mismatch is rejected to prevent spoofing, and if the secret was changed, the old secret is used when retrying older requests.
How does pagination work?+
List endpoints use a count-and-skip window. The count parameter sets the page size, with a default of 10 and a maximum of 100, and skip sets how many records to step past. Lists can also be narrowed by a from and to time range, and results come back newest first.
Why are amounts so large in API requests?+
Razorpay expresses every amount in the smallest unit of the currency. For rupees that is paise, so to charge 299 rupees a request passes 29900. This avoids rounding errors from decimal fractions, and the same rule applies across orders, payments, refunds, invoices, and payouts.
Does Razorpay have an official MCP server for AI agents?+
Yes. Razorpay publishes an official Model Context Protocol server that exposes Razorpay tools to AI agents and LLM clients. A hosted remote server runs at mcp.razorpay.com with no local setup and authenticates with a merchant token, and a self-hosted build runs locally with the key id and key secret. Its tools span orders, payments, payment links, refunds, QR codes, settlements, and payouts.
Related

More finance API guides for agents

What is Bollard AI?

Control what every AI agent can do in Razorpay.

Bollard AI sits between a team's AI agents and Razorpay. A Razorpay key is account-level and reaches everything, so Bollard restores the missing per-agent boundary: grant each agent exactly the actions it needs, resource by resource, and check and log every call.

  • Set read, write, or full access per agent, never a shared Razorpay key.
  • Denied by default, so an agent reaches only what has been explicitly allowed.
  • Every call recorded in plain English: who, what, where, and the decision.
Razorpay
Payments Agent
View payments ResourceOffReadFull use
Issue refunds ActionOffReadFull use
Send payouts ActionOffReadFull use
Orders ResourceOffReadFull use
Per-agent access, set in Bollard AI, not in Razorpay