razorpay
Razorpay Python Client
What it is and what it does
Razorpay is a Python wrapper around the Razorpay payment gateway API, designed for merchants in India who need to programmatically manage payments, orders, refunds, subscriptions, and related financial workflows. It abstracts HTTP communication via the requests library and provides a client-based interface to a large API surface covering accounts, customers, tokens, invoices, payment links, QR codes, and dispute handling.
The library is straightforward to set up: instantiate a client with your API credentials, optionally enable retries and set app metadata, then call methods on the client to interact with Razorpay resources. It is actively maintained, carries no known vulnerabilities, and has been in use since 2015, though it remains classified as Beta.
Use it for:
- Build a Django or Flask web application that accepts payments and needs to create orders and process refunds via Razorpay.
- Automate subscription billing workflows by programmatically managing recurring charges and customer tokens.
- Generate and manage payment links or QR codes for customers without building custom payment UI.
- Reconcile transactions by fetching payment and settlement data from Razorpay into your internal ledger.
- Handle payment verification and dispute resolution as part of a merchant's post-transaction workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python client library for the Razorpay payment gateway API, enabling merchants to programmatically interact with payment processing, orders, refunds, subscriptions, and related financial operations.
Yes. Razorpay is the official Python client for a major payment gateway serving India, actively maintained with no known vulnerabilities, low install friction, and permissive licensing. Install it if you are building a merchant application that needs to integrate Razorpay payments; avoid it if you use a different payment processor.
Install
razorpay on PyPI
pip
pip install razorpayuv
uv add razorpaypoetry
poetry add razorpayInstalling razorpay
Before you install
Low install friction with a single lightweight dependency (requests). Actively maintained with recent commits and a stable release cadence; marked as Beta in development status but has been in production use since 2015.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you include the license notice.
Quickstart
import razorpay
client = razorpay.Client(auth=("YOUR_API_KEY", "YOUR_API_SECRET"))
client.enable_retry(True)
client.set_app_details({"title": "MyApp", "version": "1.0"})
You must obtain API credentials (key and secret) from the Razorpay dashboard before instantiating a client.
Verify before relying
- Whether all listed resource types (Account, Addon, Item, Customer, etc.) are fully implemented and tested in version 2.0.1
- Specific Python version compatibility beyond the classifiers listed (3.4–3.6 are declared but current support is unspecified)
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — requests |
| Maintenance | actively maintained — 158 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,100,087/month — #4,370 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: razorpay-2.0.1-py3-none-any.whl
Keywords: razorpay, payment, gateway, india
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
braintreeProvides Python bindings to the Braintree…
permissive · top 5,000 on PyPI
mercadopagoProvides Python bindings to integrate Mercado…
permissive · top 15,000 on PyPI
recurlyOfficial Python client library for Recurly's V3…
unclear · top 15,000 on PyPI
mollie-api-pythonPython client library for the Mollie payment…
permissive · top 15,000 on PyPI
yookassaPython client library for integrating YooKassa…
permissive · top 15,000 on PyPI
paypalrestsdkA REST client library for integrating PayPal…
unclear · top 5,000 on PyPI
beanstreamProvides a Python client library for the…
permissive · top 15,000 on PyPI
chargehoundChargehound provides Python bindings to…
permissive · top 15,000 on PyPI
google-shopping-merchant-productsPython client library for Google Shopping…
permissive · top 15,000 on PyPI
AdyenProvides official Python bindings for Adyen's…
permissive · top 5,000 on PyPI