PHPackages                             razorpay/razorpay - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. razorpay/razorpay

ActiveLibrary[API Development](/categories/api)

razorpay/razorpay
=================

Razorpay PHP Client Library

2.9.2(9mo ago)2024.8M—1.1%137[26 issues](https://github.com/razorpay/razorpay-php/issues)[38 PRs](https://github.com/razorpay/razorpay-php/pulls)20MITPHPPHP &gt;=7.3CI passing

Since Jan 18Pushed 2mo ago197 watchersCompare

[ Source](https://github.com/razorpay/razorpay-php)[ Packagist](https://packagist.org/packages/razorpay/razorpay)[ Docs](https://docs.razorpay.com)[ RSS](/packages/razorpay-razorpay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (177)Used By (20)

razorpay-php
============

[](#razorpay-php)

[![Build Status](https://camo.githubusercontent.com/99426b1ba5acaad8bb4dcf5e686f704acc6232d172cc7dc26237b8cf46053c28/68747470733a2f2f7472617669732d63692e6f72672f72617a6f727061792f72617a6f727061792d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/razorpay/razorpay-php) [![Stable](https://camo.githubusercontent.com/c5c5d1236af9f87808a2a89a39aadace62c89b92b4d6624a9ee7a0bbc197f2f1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737461626c652d76322e382e302d626c75652e737667)](https://packagist.org/packages/razorpay/razorpay#2.8.0) [![License](https://camo.githubusercontent.com/247a73988cc06a47be5cee4107ff7392fa02bd04c2a902179f4f396d4e589164/68747470733a2f2f706f7365722e707567782e6f72672f72617a6f727061792f72617a6f727061792f6c6963656e73652e737667)](https://packagist.org/packages/razorpay/razorpay)

Official PHP library for [Razorpay API](https://docs.razorpay.com/docs/payments).

Read up here for getting started and understanding the payment flow with Razorpay:

### Prerequisites

[](#prerequisites)

- A minimum of PHP 7.3 upto 8.1

Installation
------------

[](#installation)

- If your project using composer, run the below command

```
composer require razorpay/razorpay:2.*

```

- If you are not using composer, download the latest release from [the releases section](https://github.com/razorpay/razorpay-php/releases). **You should download the `razorpay-php.zip` file**. After that, include `Razorpay.php` in your application and you can use the API as usual.

\##Note: This PHP library follows the following practices:

- Namespaced under `Razorpay\Api`
- API throws exceptions instead of returning errors
- Options are passed as an array instead of multiple arguments wherever possible
- All requests and responses are communicated over JSON

Documentation
-------------

[](#documentation)

Documentation of Razorpay's API and their usage is available at

Basic Usage
-----------

[](#basic-usage)

Instantiate the razorpay php instance with `key_id` &amp; `key_secret`. You can obtain the keys from the dashboard app ()

```
use Razorpay\Api\Api;

$api = new Api($api_key, $api_secret);
```

### Using Access Token

[](#using-access-token)

Instantiate the razorpay instance with `access_token`. The `access_token` can be obtained only in case if you are a platform partner. For more information, refer page - .

```
use Razorpay\Api\Api;

$api = new Api(null, null, "");
```

The resources can be accessed via the `$api` object. All the methods invocations follows the following pattern

```
    // $api->class->function() to access the API
    //Example
    $api->payment->fetch($paymentId);
```

Supported Resources
-------------------

[](#supported-resources)

- [Account](documents/account.md)
- [Customer](documents/customer.md)
- [Dispute](documents/dispute.md)
- [Document](documents/document.md)
- [Token](documents/token.md)
- [Order](documents/order.md)
- [Payments](documents/payment.md)
- [Settlements](documents/settlement.md)
- [Refunds](documents/refund.md)
- [Fund](documents/fund.md)
- [Invoice](documents/invoice.md)
- [Iin](documents/Iin.md)
- [Plan](documents/plan.md)
- [Item](documents/item.md)
- [Subscriptions](documents/subscription.md)
- [Add-on](documents/addon.md)
- [Payment Links](documents/paymentLink.md)
- [Product Configuration](documents/productConfiguration.md)
- [Smart Collect](documents/virtualaccount.md)
- [Stakeholder](documents/stakeholder.md)
- [Transfer](documents/transfer.md)
- [QR Code](documents/qrcode.md)
- [Emandate](documents/emandate.md)
- [Cards](documents/card.md)
- [Paper NACH](documents/papernach.md)
- [UPI](documents/upi.md)
- [Register Emandate and Charge First Payment Together](documents/registeremandate.md)
- [Register NACH and Charge First Payment Together](documents/registernach.md)
- [Payment Verification](documents/paymentVerfication.md)
- [Webhook](documents/webhook.md)
- [OAuthTokenClient](documents/oAuthTokenClient.md)

Development
-----------

[](#development)

See the [doc.md](doc.md) file for getting started with development.

Release
-------

[](#release)

Steps to follow for a release:

1. Merge the branch with the new code to master.
2. Bump the Version in `src/Api.php`.
3. Rename Unreleased to the new tag in `CHANGELOG.md`
4. Add a new empty "Unreleased" section at the top of `CHANGELOG.md`
5. Fix links at bottom in `CHANGELOG.md`
6. Commit
7. Tag the release and push to GitHub
8. A release should automatically be created once the travis build passes. Edit the release to add some description.

License
-------

[](#license)

The Razorpay PHP SDK is released under the MIT License. See [LICENSE](LICENSE) file for more details.

###  Health Score

68

—

FairBetter than 100% of packages

Maintenance71

Regular maintenance activity

Popularity64

Solid adoption and visibility

Community51

Growing community involvement

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 69.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~91 days

Recently: every ~173 days

Total

43

Last Release

287d ago

Major Versions

1.2.9 → 2.0.02017-03-07

1.2.1.x-dev → v2.8.42022-06-28

PHP version history (5 changes)1.0.0PHP &gt;=5.3.2

2.0.1PHP &gt;=5.3.3

2.1.0PHP &gt;=5.4.0

2.5.0PHP &gt;=5.3.0

2.8.5PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/adc4d2b7a7a7a8624e7b5683af11ed8ebbee623936635933c9694358827bc170?d=identicon)[crims0n](/maintainers/crims0n)

![](https://avatars.githubusercontent.com/u/7713209?v=4)[Razorpay](/maintainers/razorpay)[@razorpay](https://github.com/razorpay)

---

Top Contributors

[![ankitdas13](https://avatars.githubusercontent.com/u/89454448?v=4)](https://github.com/ankitdas13 "ankitdas13 (335 commits)")[![neera11](https://avatars.githubusercontent.com/u/76558100?v=4)](https://github.com/neera11 "neera11 (18 commits)")[![ccrims0n](https://avatars.githubusercontent.com/u/4971419?v=4)](https://github.com/ccrims0n "ccrims0n (18 commits)")[![shashankkumar](https://avatars.githubusercontent.com/u/713006?v=4)](https://github.com/shashankkumar "shashankkumar (16 commits)")[![jitendra-1217](https://avatars.githubusercontent.com/u/5562241?v=4)](https://github.com/jitendra-1217 "jitendra-1217 (15 commits)")[![albingeorge](https://avatars.githubusercontent.com/u/1938077?v=4)](https://github.com/albingeorge "albingeorge (14 commits)")[![captn3m0](https://avatars.githubusercontent.com/u/584253?v=4)](https://github.com/captn3m0 "captn3m0 (10 commits)")[![harman28](https://avatars.githubusercontent.com/u/4201494?v=4)](https://github.com/harman28 "harman28 (9 commits)")[![sonyy-m](https://avatars.githubusercontent.com/u/87705623?v=4)](https://github.com/sonyy-m "sonyy-m (7 commits)")[![harshilmathur](https://avatars.githubusercontent.com/u/1286414?v=4)](https://github.com/harshilmathur "harshilmathur (5 commits)")[![ramth05](https://avatars.githubusercontent.com/u/45222925?v=4)](https://github.com/ramth05 "ramth05 (4 commits)")[![amitmahbubani](https://avatars.githubusercontent.com/u/5546730?v=4)](https://github.com/amitmahbubani "amitmahbubani (3 commits)")[![ChetanGN](https://avatars.githubusercontent.com/u/54831964?v=4)](https://github.com/ChetanGN "ChetanGN (3 commits)")[![73SL4](https://avatars.githubusercontent.com/u/102838748?v=4)](https://github.com/73SL4 "73SL4 (3 commits)")[![sskop99](https://avatars.githubusercontent.com/u/146944495?v=4)](https://github.com/sskop99 "sskop99 (3 commits)")[![swati31196](https://avatars.githubusercontent.com/u/30949703?v=4)](https://github.com/swati31196 "swati31196 (2 commits)")[![MahlaqaHaque](https://avatars.githubusercontent.com/u/181709188?v=4)](https://github.com/MahlaqaHaque "MahlaqaHaque (2 commits)")[![Mayur-Wadpalliwar](https://avatars.githubusercontent.com/u/28298004?v=4)](https://github.com/Mayur-Wadpalliwar "Mayur-Wadpalliwar (2 commits)")[![msonowal](https://avatars.githubusercontent.com/u/6334484?v=4)](https://github.com/msonowal "msonowal (2 commits)")[![naveen-s-rzp](https://avatars.githubusercontent.com/u/153058734?v=4)](https://github.com/naveen-s-rzp "naveen-s-rzp (2 commits)")

---

Tags

phpapiclientrazorpay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/razorpay-razorpay/health.svg)

```
[![Health](https://phpackages.com/badges/razorpay-razorpay/health.svg)](https://phpackages.com/packages/razorpay-razorpay)
```

###  Alternatives

[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3633.0M18](/packages/kunalvarma05-dropbox-php-sdk)[culqi/culqi-php

Cliente Culqi API para PHP

41356.8k1](/packages/culqi-culqi-php)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
