Configuring Revolut Bank with SQL-Ledger

by Armaghan Saqib, Thursday, November 24, 2022, 08:30 (522 days ago)
edited by Armaghan Saqib, Thursday, November 24, 2022, 09:45

Step 1: Generate a private and public certificate

openssl genrsa -out privatecert.pem 2048
openssl req -new -x509 -key privatecert.pem -out publiccert.cer -days 1825

(source: https://developer.revolut.com/docs/manage-accounts/get-started/make-your-first-api-requ...

Step 2: Add certificate

Add your certificate by copying contents of publiccert.cer to your revolut account as shown in the screen shots below:

[image]

[image]


Revolut will generate a 'Client ID' which you need to add to your sql-ledger defaults along with other revolut settings. This ID is shown in the screen shot below.

[image]


Step 3: Configure SQL-Ledger

[image]

  • Revolut Client ID: Copy this from Revolute certificate page.
  • Revolut Private Key: Copy contents of privatecert.pem to this field.
  • Revolut API URL: This should be 'https://sandbox-b2b.revolut.com/api/1.0' for sandbox account or 'https://b2b.revolut.com/api/1.0' for real account.
  • Revolut JWT Domain: This must be domain name of your sql-ledger server.
  • SQL-Ledger Path: This must be folder part after server domain. So if you access your sql-ledger with 'https://ledger123.net/sql-ledger/' then it will be '/sql-ledger'


Step 4: Enable Access in Revolut

Click on the 'Enable Access' button in revolut and enable access for sql-ledger.

[image]


Step 5: Access Revolut data in SQL-Ledger.

Once you enable access, you will be redirected to revolut module in sql-ledger and you can view your accounts and transactions on this page.

[image]

[image]

Configuring Revolut Bank with SQL-Ledger

by sweitmann, Thursday, December 08, 2022, 14:17 (508 days ago) @ Armaghan Saqib

Hi Armaghan,

I have followed the instructions and when I select 'Import--Revolut' I can see the accounts. Then I click on one of the accounts and enter From and To date, and select the Bank Account in the first dropdown and the Clearing Account in the second dropdown.

After I then select Import -> YES and click Continue I get:

Not an ARRAY reference at /var/www/html/sql-ledger/revolut/index.pl line 262.
257
my $table_data = HTML::Table->new(
258
-class => 'table table-border',
259
-head => [qw/date type amount balance currency description state card_number merchant_name/],
260
);
261
262
for my $item ( @{$hash} ) {
263
my $transdate = substr( $item->{created_at}, 0, 10 );
264
$table_data->addRow(
265
$transdate,
266
$item->{type},
267
$c->nf->format_price($item->{legs}->[0]->{amount},2),

Any ideas?

Configuring Revolut Bank with SQL-Ledger

by sweitmann, Thursday, February 16, 2023, 12:18 (438 days ago) @ sweitmann

Hi Armaghan,

Thanks for sorting it out!

Now it runs smoothly and we can import and automatically book all the transactions without any issues.

Regards

RSS Feed of thread