Download the PHP package sverraest/revolut-php without Composer
On this page you can find all versions of the php package sverraest/revolut-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package revolut-php
RevolutPHP
(Unofficial) PHP API Client and bindings for the Revolut Business API.
Using this PHP API Client you can interact with your:
- ๐ฐ Accounts
- ๐ข Counterparties
- ๐ธ Payments
- ๐ฐ๏ธ Payment Drafts
- ๐ Transfers
- ๐ Transactions
- ๐น Rates
- ๐ฑ Exchanges
- ๐ Webhooks
Revolut Business API does not support - ๐งพ Invoices
Installation
Requires PHP 7.0 or higher
The recommended way to install revolut-php is through Composer:
First, install Composer:
Next, install the latest revolut-php:
Finally, you need to require the library in your PHP application:
Development
- Run
composer test
andcomposer phpcs
before creating a PR to detect any obvious issues. - Please create issues for this specific API Binding under the issues section.
- Contact Revolut directly for official Revolut For Business API support.
Quick Start
RevolutPHP\Auth\Provider
Start by following the authentication instructions in the Revolut API docs:
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
:
You can now redirect the user to the authorisation flow in the Revolut for Business app:
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:
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:
RevolutPHP\Client
If you want to get a production
client:
If you want to get a sandbox
client:
If you want to pass additional GuzzleHTTP options:
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
๐ฐ Accounts
Get all accounts
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Accounts
Get one account
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Accounts/operation/getAccount
Get account details
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Accounts/operation/getAccountDetails
๐ข Counterparties
Add a Counterparty
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Counterparties/operation/addCounterparty
Delete a Counterparty
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Counterparties/operation/deleteCounterparty
Get all Counterparties
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Counterparties/operation/getCounterparties
Get a specific Counterparty
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Counterparties/operation/getCounterparty
๐ธ Payments
Create a payment
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payments/operation/createPayment
Schedule a payment (for up to 30 days in the future)
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payments/operation/createPayment
๐ฐ๏ธ Payment Drafts
Get all Payment Drafts
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payment-Drafts/operation/getPaymentDrafts
Get a specific Payment Draft
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payment-Drafts/operation/getPaymentDraft
Create a Payment Draft
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payment-Drafts/operation/createPaymentDraft
Delete a payment draft
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payment-Drafts/operation/deletePaymentDraft
๐ Transfers
Transfer money between your accounts
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Transfers/operation/createTransfer
๐ Transactions
Get a specific transaction (Transfer, Payment)
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payments/operation/getTransaction
Get a specific transaction by requestId (Transfer, Payment)
You can fetch a transaction by the requestId that you specified on creation. See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payments/operation/getTransaction
Cancel a scheduled transaction
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payments/operation/cancelTransaction
Get all transactions
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payments/operation/getTransactions
Get all transactions with filters applied
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Payments/operation/getTransactions
Default 'count' is 100 if you want to retreive more transactions even with dates selected you should specify bigger 'count'. Highiest value of 'count' is 1000.
๐น Rates
Get exchange rates
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Exchanges
๐ฑ Exchanges
Exchange currency
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Exchanges/operation/exchangeMoney
๐ Webhooks
Create a webhook
See more at https://developer.revolut.com/docs/api-reference/business/#tag/Webhooks/operation/setupWebhook
Frameworks
If you're looking to use this PHP API Client in a specific PHP framework you currently have the following options:
Framework | Package |
---|---|
Symfony | https://github.com/sverraest/revolut-php-bundle |
Laravel | https://github.com/vdbelt/laravel-revolut |
Errors
Currently the following errors are defined in the Revolut Business API.
Error | Description |
---|---|
400 Bad request | Your request is invalid. |
401 Unauthorized | Your API key is wrong. |
403 Forbidden | Access to the requested resource or action is forbidden. |
404 Not Found | The requested resource could not be found. |
405 Method Not Allowed | You tried to access an endpoint with an invalid method. |
406 Not Acceptable | You requested a format that isn't JSON. |
429 Too Many Requests | You're sending too many requests. |
500 Internal Server Error | We had a problem with our server. Try again later. |
503 Service Unavailable | We're temporarily offline for maintenance. Please try again later. |
About
You can follow me on ๐ฆ Twitter or โ๏ธ email me at simon[-at-]appfleet.uk.
www.appfleet.uk