PHPackages                             smartilabs/revolut-php - 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. smartilabs/revolut-php

ActiveLibrary[API Development](/categories/api)

smartilabs/revolut-php
======================

PHP Bindings for the Revolut Business API

v1.2.1(5y ago)013MITPHPPHP &gt;= 7.0

Since Apr 7Pushed 5y agoCompare

[ Source](https://github.com/smartilabs/revolut-php)[ Packagist](https://packagist.org/packages/smartilabs/revolut-php)[ RSS](/packages/smartilabs-revolut-php/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (6)Versions (6)Used By (0)

RevolutPHP
==========

[](#revolutphp)

> (Unofficial) PHP API Client and bindings for the [Revolut Business API](https://revolut-engineering.github.io/api-docs/).

[![Build Status](https://camo.githubusercontent.com/33f394650806a6e8d9ef276f795bb06f9f26bacec5ce4dae538b8b3b1bb0a73a/68747470733a2f2f7472617669732d63692e6f72672f736d617274696c6162732f7265766f6c75742d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sverraest/revolut-php)[![codecov](https://camo.githubusercontent.com/45e11bc6a542fa809103ba6acd9b39d3be1869fd05a269091672742588745c9d/68747470733a2f2f636f6465636f762e696f2f67682f736d617274696c6162732f7265766f6c75742d7068702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/sverraest/revolut-php)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9fe9fe27afd00c0985a59ebab135d30f6ba09320e1fe4b4ff5877779048e3312/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736d617274696c6162732f7265766f6c75742d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/smartilabs/revolut-php/?branch=master)[![Maintainability](https://camo.githubusercontent.com/f7aec6263e68342c83e4808c848af297d350a1fd7daeafe803539cf6653abdee/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f63323465373861343364313133346161663162342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/smartilabs/revolut-php/maintainability)[![Latest Stable Version](https://camo.githubusercontent.com/e510d537de6a96da71045318fb964221636c938e2d129cd254657ab6ed032c42/68747470733a2f2f706f7365722e707567782e6f72672f7376657272616573742f7265766f6c75742d7068702f762f737461626c65)](https://packagist.org/packages/smartilabs/revolut-php)[![License](https://camo.githubusercontent.com/ee7fcf489ac852ff822bfa486f2a25eaf529d829d1f2b261e9a86601bd0c1041/68747470733a2f2f706f7365722e707567782e6f72672f7376657272616573742f7265766f6c75742d7068702f6c6963656e7365)](https://packagist.org/packages/smartilabs/revolut-php)[![composer.lock](https://camo.githubusercontent.com/784edd78520a5bf79b9412def2b75f849a0af718ccfa61029f23e991d3bf9fb3/68747470733a2f2f706f7365722e707567782e6f72672f7376657272616573742f7265766f6c75742d7068702f636f6d706f7365726c6f636b)](https://packagist.org/packages/smartilabs/revolut-php)

Using this PHP API Client you can interact with your:

- 💰 **Accounts**
- 🏢 **Counterparties**
- 💸 **Payments**
- 🕰️ **Payment Drafts**
- 🔀 **Transfers**
- 📊 **Transactions**
- 💹 **Rates**
- 💱 **Exchanges**
- 🔗 **Webhooks**

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

[](#installation)

Requires PHP 7.0 or higher

The recommended way to install revolut-php is through [Composer](https://getcomposer.org):

First, install Composer:

```
$ curl -sS https://getcomposer.org/installer | php

```

Next, install the latest revolut-php:

```
$ php composer.phar require sverraest/revolut-php

```

Finally, you need to require the library in your PHP application:

```
require "vendor/autoload.php";
```

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

[](#development)

- Run `composer test` and `composer phpcs` before creating a PR to detect any obvious issues.
- Please create issues for this specific API Binding under the [issues](https://github.com/sverraest/revolut-php/issues) section.
- [Contact Revolut](https://business.revolut.com/signin) directly for official Revolut For Business API support.

Quick Start
-----------

[](#quick-start)

### RevolutPHP\\Auth\\Provider

[](#revolutphpauthprovider)

Start by following the authentication instructions in the [Revolut API docs](https://revolut-engineering.github.io/api-docs/#business-api-authentication):

```
openssl genrsa -out privatekey.pem 1024
openssl req -new -x509 -key privatekey.pem -out publickey.cer -days 1825

```

Paste the generated public key on the Revolut for Business API settings page, and use the private key to instantiate a new `RevolutPHP\Auth\Provider`:

```
$authProvider = new \RevolutPHP\Auth\Provider([
    'clientId' => '{clientId}', // As shown when uploading your key
    'privateKey' => 'file://{privateKeyPath}',
    'redirectUri' => 'https://example.com', // The URL to redirect the user to after the authorisation step
    'isSandbox' => true
]);

```

You can now redirect the user to the authorisation flow in the Revolut for Business app:

```
$url = $authProvider->getAuthorizationUrl();

```

Once the user has confirmed authorisation, the user will be redirected back to the redirectUri with an authorisation code attached. You can exchange this authorisation code for an access token:

```
$accessToken = $authProvider->getAccessToken('authorization_code', [
    'code' => $_GET['code']
]);

```

You can save this `$accessToken` somewhere safe and pass it directly to the RevolutPHP\\Client. The token is valid for 40 minutes. To request a new token after expiration, you can use the refresh token to get a new access token:

```
if( $accessToken->hasExpired() ) {
    $newAccessToken = $authProvider->getAccessToken('refresh_token', [
        'refresh_token' => $accessToken->getRefreshToken()
    ]);
}

```

### RevolutPHP\\Client

[](#revolutphpclient)

If you want to get a `production` client:

```
use RevolutPHP\Client;

$client = new Client($accessToken);
```

If you want to get a `sandbox` client:

```
use RevolutPHP\Client;

$client = new Client($accessToken, 'sandbox');
```

If you want to pass additional [GuzzleHTTP](https://github.com/guzzle/guzzle) options:

```
use RevolutPHP\Client;

$options = ['headers' => ['foo' => 'bar']];
$client = new Client($accessToken, 'sandbox', $options);
```

Available API Operations
------------------------

[](#available-api-operations)

The following exposed API operations from the Revolut For Business API are available using the API Client.

See below for more details about each resource.

💰 **Accounts**

Get all accounts, Get a specific account and get details for a specific account.

🏢 **Counterparties**

Get all counterparties, get a specific counterparty, create a new counterparty and delete a counterparty.

💸 **Payments**

Create and schedule new payments.

🕰️ **Payment Drafts**

Create, get and delete payment drafts for approval by a business owner/admin.

🔀 **Transfers**

Create a transfer between your accounts.

📊 **Transactions**

Get all transactions or a subset (with queryFilters), cancel a scheduled transaction, get a specific transaction and get a transaction by the unique specified requestId.

A Transaction is either created as a Payment or a Transfer.

💹 **Rates**

Get exchange rates.

💱 **Exchanges**

There are two ways of using this endpoint:

If you know the amount of currency you want to sell (e.g: I want to exchange 135.5 USD to EUR), then you should specify the amount in the "from" object.

If, on the other hand, you want to specify the amount of currency you want to buy (e.g: I want to exchange USD to receive 200 EUR), then you should specify the amount in the "to" object.

❗ Please note that the "amount" field can be specified only once, either in the "from" object or in the "to" object.

🔗 **Webhooks**

Create new webhooks.

Usage details
-------------

[](#usage-details)

### 💰 Accounts

[](#-accounts)

#### Get all accounts

[](#get-all-accounts)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$accounts = $client->accounts->all();
```

#### Get one account

[](#get-one-account)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$account = $client->accounts->get('foo');
```

#### Get account details

[](#get-account-details)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$account = $client->accounts->getDetails('foo');
```

### 🏢 Counterparties

[](#-counterparties)

#### Add a Counterparty

[](#add-a-counterparty)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$counterparty = $client->counterparties->create(['profile_type' => 'business', 'name' => 'TestCorp' , 'email' => 'test@sandboxcorp.com']);
```

#### Delete a Counterparty

[](#delete-a-counterparty)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$client->counterparties->delete('foo');
```

#### Get all Counterparties

[](#get-all-counterparties)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$counterparties = $client->counterparties->all();
```

#### Get a specific Counterparty

[](#get-a-specific-counterparty)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$counterparty = $client->counterparties->get('bar');
```

### 💸 Payments

[](#-payments)

#### Create a payment

[](#create-a-payment)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);

$payment = [
  'request_id' => 'e0cbf84637264ee082a848b',
  'account_id' => 'bdab1c20-8d8c-430d-b967-87ac01af060c',
  'receiver' => [
    'counterparty_id': '5138z40d1-05bb-49c0-b130-75e8cf2f7693',
    'account_id': 'db7c73d3-b0df-4e0e-8a9a-f42aa99f52ab'
  ],
  'amount' => 123.11,
  'currency' => 'EUR',
  'reference' => 'Invoice payment #123'
];

$payment = $client->payments->create($payment);
```

#### Schedule a payment (for up to 30 days in the future)

[](#schedule-a-payment-for-up-to-30-days-in-the-future)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);

$payment = [
  'request_id' => 'e0cbf84637264ee082a848b',
  'account_id' => 'bdab1c20-8d8c-430d-b967-87ac01af060c',
  'receiver' => [
    'counterparty_id': '5138z40d1-05bb-49c0-b130-75e8cf2f7693',
    'account_id': 'db7c73d3-b0df-4e0e-8a9a-f42aa99f52ab'
  ],
  'amount' => 123.11,
  'currency' => 'EUR',
  'reference' => 'Invoice payment #123',
  'schedule_for' => '2018-04-20',
];

$payment = $client->payments->create($payment);
```

### 🕰️ Payment Drafts

[](#️-payment-drafts)

#### Get all Payment Drafts

[](#get-all-payment-drafts)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$paymentDrafts = $client->paymentDrafts->all();
```

#### Get a specific Payment Draft

[](#get-a-specific-payment-draft)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$counterparty = $client->paymentDrafts->get('bar');
```

#### Create a Payment Draft

[](#create-a-payment-draft)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);

$draft = [
  'title' => 'Title of payment',
  'schedule_for' => '2017-10-10',
  'payments' => [[
    'currency' => 'EUR',
    'amount' => 123,
    'account_id' => 'db7c73d3-b0df-4e0e-8a9a-f42aa99f52ab',
    'receiver' => [
      'counterparty_id' => '5138z40d1-05bb-49c0-b130-75e8cf2f7693',
      'account_id' => 'bdab1c20-8d8c-430d-b967-87ac01af060c'
    ],
    'reference' => 'External transfer'
  ]]
];

$draft = $client->paymentDrafts->create($draft);
```

#### Delete a payment draft

[](#delete-a-payment-draft)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$client->paymentDrafts->delete('bar');
```

### 🔀 Transfers

[](#-transfers)

#### Transfer money between your accounts

[](#transfer-money-between-your-accounts)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);

$transfer = [
  'request_id' => 'e0cbf84637264ee082a848b',
  'source_account_id' => 'bdab1c20-8d8c-430d-b967-87ac01af060c',
  'target_account_id' => '5138z40d1-05bb-49c0-b130-75e8cf2f7693',
  'amount' => 123.11,
  'currency' => 'EUR',
  'description' => 'Expenses funding'
];

$transfer = $client->transfers->create($transfer);
```

### 📊 Transactions

[](#-transactions)

#### Get a specific transaction (Transfer, Payment)

[](#get-a-specific-transaction-transfer-payment)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$transaction = $client->transactions->get('foo');
```

#### Get a specific transaction by requestId (Transfer, Payment)

[](#get-a-specific-transaction-by-requestid-transfer-payment)

You can fetch a transaction by the requestId that you specified on creation. See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$transaction = $client->transactions->getByRequestId('inv-123456789');
```

#### Cancel a scheduled transaction

[](#cancel-a-scheduled-transaction)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$client->transactions->cancel('foo');
```

#### Get all transactions

[](#get-all-transactions)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);
$transactions = $client->transactions->all();
```

#### Get all transactions with filters applied

[](#get-all-transactions-with-filters-applied)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);

$searchFilters = [
  'from' => '2018-01-01',
  'to' => '2018-04-01',
  'count' => 50,
  'counterparty' => 'foo',
  'type' => 'transfer'
];

$transactions = $client->transactions->all($searchFilters);
```

### 💹 Rates

[](#-rates)

#### Get exchange rates

[](#get-exchange-rates)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);

$rates = $client->rates->get('USD', 'EUR', 100);
```

### 💱 Exchanges

[](#-exchanges)

#### Exchange currency

[](#exchange-currency)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);

$exchange = [
  'from' => [
    'account_id' => '7998c061-115a-4779-b7c5-7175c6502ea0',
    'currency' => 'USD',
    'amount' => 135.5
  ],
  'to' => [
    'account_id' => '35ba695a-9153-4f68-ac16-b32f228265c9',
    'currency' => 'EUR'
  ],
  'reference' => 'Time to sell',
  'request_id' => 'e0cbf84637264ee082a848b'
];

$response = $client->exchanges->exchange($exchange);
```

### 🔗 Webhooks

[](#-webhooks)

#### Create a webhook

[](#create-a-webhook)

See more at

```
use RevolutPHP\Client;

$client = new Client($accessToken);

$webhook = [
  'url' => 'https://foo.bar',
];

$webhook = $client->webhooks->create($webhook);
```

Frameworks
----------

[](#frameworks)

If you're looking to use this PHP API Client in a specific PHP framework you currently have the following options:

FrameworkPackageSymfonyLaravelErrors
------

[](#errors)

Currently the following errors are defined in the Revolut Business API.

ErrorDescription400 Bad requestYour request is invalid.401 UnauthorizedYour API key is wrong.403 ForbiddenAccess to the requested resource or action is forbidden.404 Not FoundThe requested resource could not be found.405 Method Not AllowedYou tried to access an endpoint with an invalid method.406 Not AcceptableYou requested a format that isn't JSON.429 Too Many RequestsYou're sending too many requests.500 Internal Server ErrorWe had a problem with our server. Try again later.503 Service UnavailableWe're temporarily offline for maintenance. Please try again later.About
-----

[](#about)

You can follow me on 🐦 [Twitter](https://www.twitter.com/simondoestech) or ✉️ email me at simon\[-at-\]appfleet.uk.

---

[www.appfleet.uk](http://www.appfleet.uk)

[![](https://avatars3.githubusercontent.com/u/25485341?s=200&v=4)](https://avatars3.githubusercontent.com/u/25485341?s=200&v=4)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 78.8% 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 ~256 days

Total

5

Last Release

1934d ago

### Community

Maintainers

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

---

Top Contributors

[![sverraest](https://avatars.githubusercontent.com/u/7394603?v=4)](https://github.com/sverraest "sverraest (41 commits)")[![smartilabs](https://avatars.githubusercontent.com/u/6381175?v=4)](https://github.com/smartilabs "smartilabs (6 commits)")[![vdbelt](https://avatars.githubusercontent.com/u/11087503?v=4)](https://github.com/vdbelt "vdbelt (4 commits)")[![fuerbringer](https://avatars.githubusercontent.com/u/10528737?v=4)](https://github.com/fuerbringer "fuerbringer (1 commits)")

---

Tags

phpapibusinessrevolut

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/smartilabs-revolut-php/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[sverraest/revolut-php

PHP Bindings for the Revolut Business API

5057.1k3](/packages/sverraest-revolut-php)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

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