Connect Revolut Business to Rig

    Revolut Business is a multi-currency business bank. Rig syncs your accounts, transactions and counterparties into your warehouse, so cash position and spend sit beside your other finance data. The connection uses a certificate you create, a client ID and a refresh token, so setup takes a few terminal commands.

    Before you start

    • You need these Revolut Business permissions to configure the API: Manage Integrations and Manage API under API & Integrations, and View Business under Billing.
    • You need a terminal with openssl. On Windows, Revolut recommends WSL.
    • Plan about 15 minutes. The authorisation code you collect in step 5 is valid for two minutes, so have the token command ready first.

    Step 1: Create a certificate and register it with Revolut

    Revolut identifies Rig by a certificate pair. You keep the private key and give Revolut the public certificate.

    1. In a terminal, run openssl genrsa -out privatecert.pem 2048.
    2. Run openssl req -new -x509 -key privatecert.pem -out publiccert.cer -days 1825. Answer at least one prompt, such as Country Name.
    3. In the Revolut Business web app, click the gear icon, then go to APIs and choose Business API.
    4. In the API Certificates section, click Add API certificate.
    5. Paste the full contents of publiccert.cer into X509 public key, including the BEGIN CERTIFICATE and END CERTIFICATE lines.
    6. Set OAuth redirect URI to https://www.example.com. Rig signs its requests for the www.example.com domain, and Revolut requires that domain to match the redirect URI.
    7. Give the certificate a clear title and click Continue.
    8. Copy the ClientID shown in the certificate details. This is the Client ID you give Rig.

    IP whitelisting
    Revolut lets you restrict a certificate to a list of IP addresses. Leave it empty for Rig, or contact us for the addresses to add.

    Step 2: Authorise the application and get a refresh token

    You make one signed request to Revolut to obtain a refresh token, which does not expire.

    1. In the folder holding privatecert.pem, create header.json containing {"alg": "RS256", "typ": "JWT"}.
    2. Create payload.json with iss set to www.example.com, sub set to your Client ID, aud set to https://revolut.com, and exp set to a Unix timestamp in seconds a few days ahead. Enter exp as a number.
    3. Follow Revolut's "Generate a client assertion" commands to sign the header and payload with your private key. This produces client_assertion.txt, your JWT.
    4. In the Business API settings, open your certificate and click Enable access. To limit what you grant, add &scope=READ to the address Revolut opens.
    5. Click Authorise and complete the two-factor prompt. Revolut redirects to your redirect URI with a code in the address. It is valid for two minutes.
    6. Straight away, send the token request from Revolut's guide: a POST to https://b2b.revolut.com/api/1.0/auth/token with grant_type=authorization_code, your code, client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer and your JWT as client_assertion.
    7. Copy the refresh_token from the response.

    Keep the JWT and refresh token private
    Revolut warns that anyone holding the JWT and refresh token can reach your banking data. Do not share them or paste them anywhere but Rig. The JWT is only needed for this step, because Rig signs its own requests with the private key.

    Step 3: Prepare the private key for Rig

    Rig takes the whole PEM key on one line, with line breaks written as the characters \n.

    1. Run awk 'NF {printf "%s\\n", $0}' privatecert.pem in the same folder.
    2. Copy the single line of output, from -----BEGIN to the final \n.

    Step 4: Connect it in Rig

    Adding a source needs a workspace owner, or a role with the Manage connections permission, on a workspace where you manage your own connections. If the Connectors tab says “Data ingestion for this workspace is managed by Rig”, ask an owner or Rig support to add the source.

    1. In Rig, open Connections, choose the Connectors tab and go to Sources & actions.
    2. Search for Revolut Business, open the card and click Connect.
    3. Client ID: The ClientID from your certificate details.
    4. Private key (PEM, escaped newlines): The single line you prepared in step 3.
    5. Refresh token: The refresh_token from Revolut's response.
    6. Earliest transaction date: The first date to load transactions from. Leave 2020-01-01T00:00:00Z as it is for everything since then.
    7. Click Continue. Rig checks the credentials and lists the streams it can reach, so choose the ones you want and click Connect.
    8. The source then syncs on its schedule, which is nightly unless you change it. To load data straight away, click Sync on its row; Test pulls a small sample first if you want to check the connection.

    What Rig pulls in

    Revolut Business lands in its own revolut_business schema in your warehouse:

    • Accounts: every business account, with its currency and balance fields.
    • Transactions: one row per transaction leg, so a transfer that touches two accounts can appear as more than one row.
    • Counterparties: every saved counterparty.

    Transactions load incrementally from the earliest date you set. Accounts and counterparties are re-read in full each sync.

    Good to know

    • Revolut access tokens last 40 minutes and Rig requests a new one using the refresh token, which does not expire.
    • Refreshing an access token invalidates the previous one, so avoid running other scripts with the same refresh token while Rig syncs.
    • Keep your private key. The certificate in Revolut stays valid for the 1825 days set in step 1, and you need the same key if you ever repeat the authorisation.
    • To disconnect Revolut Business, click the bin icon on the source's row under Sources & actions. Only whoever connected the source or a workspace owner can do this, and data already synced stays in the warehouse.

    What people use this for

    • Track multi-currency balances and cash position
    • Analyse spend by counterparty and category
    • Reconcile transfers and card payments

    More ideas for using Revolut Business

    Was this guide helpful?