Revolut Business Module
A Node.JS module by Pollex
This module provides an interface to the Revolut Business API, which can be used in a Node.JS application or even a client-side browser.
This module is available in the NPM repository, just execute the below command to install it!
$ npm i @pollex/revolut
$ yarn add @pollex/revolut
This ReadMe contains the basics, head over to the Github Wiki for more information!
Let's get you up and running quickly. Starting with the most important part of this library, the RevolutBroker. The broker handles the main communication between the API and this library. This is also where you put your API key and optionally enable debug/sandbox mode.
Identified vs Resolved
A.K.A. why doesn't my entity have information. Ideally every entity is synchronised with the API, this however is not the case. Instead, every time you need an entity you can resolve it with
.get(), which returns a promise containing the entity with it's latest information from the API.
Instead of returning a promise every time you want to reference an entity, you get an identified entity. This means the entity only contains the entity' id and not it's properties. If you need it's properties, you will need to resolve it with
Let's start with creating the broker, the most important piece:
const RevolutBroker = ;// Optional extra boolean parameter indicating sandbox mode.const broker = 'YOU API KEY HERE';
Every entity needs a broker, however the broker is automagically passed to related entities. So you won't have to use it constantly!
So I would like to know my business accounts:
const Account = ;// broker defined as previous example// GetAll returns a promise!Account;
Paying to a CounterParty
Paying requires you to have an Account to pay from and a CounterAccount, which is the account of the counterparty to pay to. However a CounterAccount can't be resolved directly. Instead you have to resolve a CounterParty and get the account from the
// Assuming you have an Account and CounterAccount entityconst payment = Account;// A payment is not executed on creationpayment;
For more information like transfering money and retrieving counterparties and -accounts, see the wiki on github!
This library is licensed under AGPL-3.0