NAV Navbar

Accept payments

Overview

The Revolut Merchant account is a sub account under your current Revolut Business account. As a Revolut Business customer, you can use your Revolut Merchant account and the Merchant API to accept online payments straight into your Merchant account. In addition, you can manage orders and customers.

Depending on how your e-commerce website is hosted, you can choose the corresponding checkout method to accept payments to your Merchant account:

Get started

1. Apply for a Merchant account

Before you begin, apply for a Merchant account in your Revolut Business account. You need to provide required information, for example, website of operation, volume of payments, category of your merchant activities, and then submit your application.

If your application is successful, you receive an email notification and can access your Merchant account right away.

For any questions, reach out to support via our in-app chat.

2. Generate the API key

After you successfully apply for a Merchant account in your Revolut Business Account, generate the production API key. You need it as part of the authorization header for each Merchant API request.

Complete the following steps to generate the production API key:

  1. Log in to your Revolut Business portal.
  2. From the left sidebar menu, click Merchant, and then click the API tab on the page.
  3. Under the Product API key section, generate the production API key.

Screenshot 2020-02-10 at 15 43 13

Note: Use this key only for the production environment. For the Revolut Business Sandbox environment, use the sandbox API key. For more information, see Test in the Sandbox environment

Tutorials

Accept your first payment

This tutorial walks you through the steps to accept the first payment. The tutorial assumes that you run your own e-commerce website and manage its code and files.

Check the following high-level procedure to integrate a Revolut Checkout Widget (widget) with the Merchant API:

  1. Server side: Create an order via the Merchant API request.
  2. Client side: Install the widget by adding RevolutCheckout to your application.
  3. Client side: Choose the option to collect card details and call the widget instance.

Before you start this tutorial, ensure that you have completed the following steps:

1. Create an order

Note: The information on this page assumes that you are pushing changes to the production environment. To test in the Revolut Business Sandbox environment, replace the endpoint address https://merchant.revolut.com/ with https://sandbox-merchant.revolut.com/ and use the Sandbox API key in the headers of requests.

Request

  POST https://merchant.revolut.com/api/1.0/orders
  Authorization: `Bearer [yourAPIKey]`

Body of the request

{
  "amount": 999,
  "currency": "EUR"
}

When a user decides to make a purchase on your e-commerce website, on the server side, you create an order by sending a POST request to https://merchant.revolut.com/api/1.0/orders. You must include the authorization header in the request, which is in the following format:

Bearer [yourAPIKey]

Where [yourAPIKey] is the production API key that you generated from your Merchant account.

Note: You must create an order for each purchase.

Here’s an example request:

Response

{
  "id": "<ID>",
  "public_id": "<PUBLIC_ID>",
  "type": "PAYMENT",
  "state": "PENDING",
  "created_date": "2020-10-15T07:46:40.648108Z",
  "updated_date": "2020-10-15T07:46:40.648108Z",
  "order_amount": {
    "value": 10000,
    "currency": "GBP"
  }
}

When the order is created successfully, the Merchant API returns a response like this:

Note: From the response, save the public_id, which is a temporary token generated for every order a customer initiates on the website. It’s also the identifier passed from the server side to the client side to call the widget instance. When the order is paid, the public_id expires.

2. Install the widget

When the order is successfully created, on the client side, you install the widget.

Embed script

<head>
<title>Shop</title>
<script>!function(e,o,t){e[t]=function(n,r){var c={sandbox:"https://sandbox-
merchant.revolut.com/embed.js",prod:"https://merchant.revolut.com/
embed.js",dev:"https://merchant.revolut.codes/
embed.js"},d=o.createElement("script");d.id="revolut-checkout",d.src=c[r]||
c.prod,d.async=!0,o.head.appendChild(d);var s={then:function(r,c)
{d.onload=function(){r(e[t](n))},d.onerror=function()
{o.head.removeChild(d),c&&c(new Error(t+" is failed to
load"))}}};return"function"==typeof Promise?Promise.resolve(s):s}}
(window,document,"RevolutCheckout");</script>
</head>

Step 1: Install the NPM package

npm install @revolut/checkout

Step 2: Import the ES module

import RevolutCheckout from "@revolut/checkout";
RevolutCheckout("XXX", "prod").then((instance) => {
  // work with instance
});

To install the Revolut Checkout Widget, you need to add RevolutCheckout to your checkout page in one of the following ways:

Note: The script is requested asynchronously, so you don’t need to worry about the content that blocks the loading of the page.

Add the embed script

Add the embed script to the document head of your checkout HTML page.

Install the widget’s NPM package

Step 1. Run the command to install the widget’s NPM package.

Step 2. Import the ES module to the javascript code as follows:

3. Call the widget instance

Choose one of the following options to integrate with the widget to collect card details:

You design your implementation to call the widget instance as follows:

  1. When the user clicks Pay, the payment pop-up window opens. To achieve this, you create a button and attach a click event listener to it that triggers RC.payWithPopup(options).
  2. The user enters the required card details and the optional personal details, and then moves to the payment processing.
  3. After the payment is processed, you can redirect the user to the appropriate page to handle the success or failed status of the order.

Code snippet

<button id="pay-button">Pay</button>
<script>
  RevolutCheckout("<PUBLIC_ID>").then(function (RC) {
    var payButton = document.getElementById("pay-button");
    // On click open payment pop-up
    payButton.addEventListener("click", function () {
      RC.payWithPopup({
        // (optional) name of the customer
        name: "First Last",
        // (optional) email of the customer
        email: "customer@example.com",
        // (optional) phone of the customer
        phone: "+447950630319",
        // (optional) billing address of the customer
        billingAddress: {
          countryCode: "UK",
          region: "Greater London",
          city: "London",
          streetLine1: "Revolut",
          streetLine2: "1 Canada Square",
          postcode: "EC2V 6DN",
        },
        // (optional) shipping address of the customer
        shippingAddress: {
          countryCode: "UK",
          region: "Greater London",
          city: "London",
          streetLine1: "Revolut",
          streetLine2: "1 Canada Square",
          postcode: "EC2V 6DN",
        },
        // Callback called when payment finished successfully
        onSuccess() {
          window.alert("Thank you!");
        },
        // Callback in case some error happened
        onError(message) {
          window.alert("Oh no :(");
        },
        // (optional) Callback in case user cancelled a transaction
        onCancel() {
          window.alert("Payment cancelled!");
        },
      });
    });
  });
</script>

Implement the code snippet on the right side of this page, where:

Congratulations! You’ve successfully integrated the widget with the Merchant API to the checkout page and accepted your first payment for the order.

What’s next

Charge a customer’s saved payment method

You can save your customers’ card details to be able to charge them at a later time. This is useful in the following use cases:

To do that, you:

  1. Save the card details of a customer.
  2. Charge the customer’s saved payment method.

1. Save the card details of a customer

There are two approaches to save the card details of a customer:

Create a customer first

  1. Create a customer and note down the id of the customer object.
  2. Create an order with the amount, currency, and customer_id parameters in the body of the request.
  3. Make the payment via the Revolut Checkout Widget with options.savePaymentMethodFor = customer or merchant.
  4. Payment method is created and attached to the customer.

Create an order first

  1. Create an order with the amount and currency parameters.
  2. Make the payment via the Revolut Checkout Widget with options.savePaymentMethodFor = customer or merchant. Note: customer_email must be provided when you create an order or when the customer is making the payment; otherwise, an error is returned.
  3. When the payment is successful, a customer is created with the email.
  4. Payment method is associated with the customer and customer_id is attached to the order automatically.

2. Charge the saved payment method

When you’ve created a customer and saved the customer’s payment method successfully, you can charge this payment method later without the customer being on the checkout page, for example, to charge for recurring transactions. You can also use this approach to speed up the checkout process when the customer is on the checkout page, for example, for 1-click buy flow.

Complete the following steps:

Create an Order

POST /api/1.0/orders
{
  "amount": 100,
  "currency": "GBP",
  "customer_id": "6c7c97a8-cfc1-4cf3-8b38-26a74fdf1fae"
}

Confirm the Order

POST /api/1.0/orders/6a1353a8-3054-40ee-ab39-97a11e4c5f2a/confirm
  1. Create an order with the amount, currency and customer_id parameters in the body of the request.

  2. Confirm the order to take payment from this customer using the saved payment method.

Notes:

Test in the Sandbox environment

Use the Revolut Business Sandbox environment to test your Merchant account integration before you push the code changes to the production environment. To get started, complete the following steps:

Specify the Sandbox environment

type RevolutCheckout = (
  token: string,
  mode?: 'prod' | 'sandbox' = 'sandbox`
) => Promise<Instance>;
  1. Sign up for a Sandbox account on Revolut Business Sandbox environment.
  2. Change the address of the endpoints that you want to test from https://merchant.revolut.com/ to https://sandbox-merchant.revolut.com/.
  3. Get the Sandbox API key and use it in the headers of requests on your server side.
  4. Specify the sandbox environment in the second parameter of RevolutCheckout.

Use test cards

To test your various payment flows for a variety of scenarios, you can use the following test card numbers that Revolut provides.

Note: These cards work only in the Revolut Business Sandbox environment.

Test for successful payments

Use the following test cards to simulate a successful payment in the Sandbox environment. You can also use them to test the use case of charging a customer's saved payment method.

Use any 3-digit CVV and any future expiry date (MM/YY).

Card PAN Brand
4929420573595709 VISA
5281438801804148 MASTERCARD

Test for error cases

Use the following test cards to create payments that produce error codes in the Sandbox environment. This is useful when you want to:

Use any 3-digit CVV and any future expiry date (MM/YY).

Card PAN Case
4242424242424242 DECLINED
4929573638125985 DECLINED due to insufficient funds
4532336743874205 DECLINED due to card being expired
2720998837779594 DECLINED due to Do Not Honour

This error happens when your customer's bank declines the transaction due to internal reasons. For example, their fraud rules might have been triggered or a temporary hold may have been applied to this card.
5145014175946025 DECLINED due to CVV code being incorrect
5445850727830242 DECLINED due to invalid postal code

This error is most common for cards issued in the UK, US, Australia, New Zealand or Canada.
2223000010479399 Order stuck in PROCESSING state

This card is useful to test what would happen with your implementation if the order took longer than expected to complete.

Change to the production environment

When you are confident that everything works as expected on the Revolut Business Sandbox environment, you can revert the endpoint address back to https://merchant.revolut.com/ in both the Merchant API requests and embed script, and replace the Sandbox API key with Production API key in the Merchant API requests.

Now you are ready to accept real payments!

Plugins

If you have your website running on WooCommerce, Prestashop, or Magento e-commerce platform, install the corresponding plugin that Revolut has created. This is a simple way to start accepting payments straight into Revolut Merchant Accounts without having to integrate with Merchant API.

Before you begin to install and configure the plugins, ensure that you have completed the following steps:

WooCommerce

The Revolut Gateway for WooCommerce plugin enables you to accept online payments via your WooCommerce store easily.

Then, configure the plugin to test in the Sandbox environment or use it in the production environment.

Install the WooCommerce plugin

You can install the Revolut Gateway for WooCommerce plugin either in a quick way or manually install it when you don’t have the Internet access to the WooCommerce store.

Quick installation

Complete the following steps to install the plugin directly from your admin section:

  1. Log in to your WooCommerce dashboard as the admin role.
  2. From the left sidebar menu, click Plugins.
  3. On the top of the page, click Add New next to the Plugins page title.
  4. Locate the Search plugins field on the top right of the page and search for Revolut Gateway for WooCommerce. You should see the plugin from the search result. Make sure the plugin has the name By Revolut.
  5. Click Install Now to install the plugin.
  6. When the installation is done, click Activate.

Congratulations! You have activated the Revolut Gateway for WooCommerce plugin.

Manual installation

  1. Log in to your WooCommerce dashboard as the admin role.
  2. From the left sidebar menu, Click Plugins.

  3. On the top of the page, click Add New next to the Plugins page title. You are then redirected to the following page.

  4. Click Upload Plugin next to Add Plugins page title.

  5. Download the latest version of the plugin from the Wordpress Official marketplace.

  6. Upload the plugin that you downloaded in .zip format:

  7. When the installation is done, click Activate Plugin.

Congratulations! You have activated the Revolut Gateway for WooCommerce plugin.

Configure the WooCommerce plugin

Configure the Revolut Gateway for WooCommerce plugin to test in the Sandbox environment or use in the production environment.

Test in the Sandbox environment

  1. Log in to your WooCommerce dashboard as the admin role.
  2. From the left sidebar menu, click Plugins.
  3. Under WooCommerce Revolut Gateway plugin, click Settings. You are then direct to the following page:

  4. Select the Enable Revolut check box.

  5. Select the Revolut Sandbox check box.

  6. In the API Key field, add your Sandbox API key. For more information about getting the Sandbox API key, see Test in the Sandbox environment.

  7. Click Save changes to apply the changes.

Now you can start testing payments using our test cards.

Use in the production environment

  1. Return to your WooCommerce dashboard as the admin role.
  2. From the left sidebar menu, click Plugins.
  3. Under WooCommerce Revolut Gateway plugin, click Settings.
  4. Select the Enable Revolut check box.
  5. Clear the Revolut Sandbox check box.
  6. In the API Key field, add your production API key. For more information about generating the API key, see Get started: 2. Generate the API key.
  7. Click Save changes to apply the changes.

Now you can start accepting real payments in your WooCommerce online store.

Prestashop 1.7

The Revolut Gateway for Prestashop 1.7 plugin enables you to accept online payments via your Prestashop 1.7 store easily.

Install the Prestashop plugin

  1. Log in to your Prestashop 1.7 dashboard as the admin role.
  2. From the left sidebar menu, click IMPROVE > Module > Module Catalog.
  3. On the top right of the page, click Upload a module.
  4. Download the Revolut Gateway for Prestashop 1.7 .zip file.
  5. Upload the plugin in .zip format that you downloaded. Then, wait for the installation to finish. It should not take a long time.
  6. When the installation is done, you're ready to go. Click Configure to set up the plugin.

Configure the plugin

  1. Log in to your Prestashop 1.7 dashboard as the admin role.
  2. From the left sidebar menu, click IMPROVE > Module > Module Manager.
  3. Scroll down to the Other section, and locate the plugin that you installed.
  4. In the plugin section, Click Upgrade to expand the menu, and then select Configure.
  5. Complete the fields in the Settings section and click Save:
    • Enable plugin: Set to Yes to enable the Revolut Payment Gateway plugin on your Prestashop website. By default, it’s set to Yes.
    • Title: Enter the title displayed on the checkout page.
    • Description: Enter the description displayed on the checkout page.
    • Mode: Depending on which environment to use the plugin in, set to Sandbox or Live.
    • API key: Enter the Sandbox API key or the Production API key.
    • Enable “Authorize Only” mode:
      • To check the card for validity only but not charge the account until the order is approved, select this check box.
      • To charge the debit/credit card when the order is placed, clear this check box.
    • Setup webhook: Set up the webhook to synchronize your Prestashop orders when an order is completed on Revolut's side.
    • Order Status for completed order: Choose the status for an order to be considered as a completed order on the Revolut’s side. By default, Payment accepted is selected.
  6. Complete the fields in the Advanced mode section and click Save:
    • Customize your order status: You can customize your orders' status for each possible action in the Revolut payment module. If set to Yes, you can see the following two options:
    • Order Status for triggering the refund on Revolut: Select the status that triggers when an order is refunded. By default, Refunded is selected.
    • Order Status for triggering the capture on Revolut: Select the status that triggers when an order is captured. By default, Payment accepted is selected.

Perform the operations

Capture an order from Prestashop's admin panel

With this plugin, you can handle the capture of the orders from Prestashop's admin panel.

To do it, complete the following steps:

  1. In the Setting section, enable "Authorize Only" mode. When a customer places an order, the status of the order in Prestashop will be Awaiting check payment by default.
  2. To capture the funds for a specific order, change the status to Payment accepted.

You can change which status captures the funds by modifying the settings as explained above in the Advanced mode section of the settings.

Refund an order from Prestashop's admin panel

After the funds of an order have been captured, you can refund the amount of an order using Prestashop's admin panel.

To do so, in the Advanced mode section, change the status of Order Status for triggering the refund on Revolut to Refunded.

Test the plugin in the Sandbox environment

You can make test payments using the plugin in the Sandbox environment.

To do that, complete the following steps:

  1. Log in to your Prestashop 1.7 dashboard as the admin role.
  2. From the left sidebar menu, click IMPROVE > Module > Module Manager.
  3. Scroll down to the Other section, and locate the plugin that you installed.
  4. In the plugin section, Click Upgrade to expand the menu, and then select Configure.
  5. Complete the fields in the Settings section:
    • Enable plugin?: Set to Yes.
    • Mode: Set to Sandbox.
    • API Key (sandbox mode): Enter the Sandbox API key.
  6. On the bottom right of the Settings section, click Save to apply the changes.

For more information about testing the integration, see Test in the Sandbox environment.

Use the plugin in the production environment

When you are ready to start accepting payments in your store using the Revolut Gateway for Prestashop plugin, complete the following steps:

  1. Log in to your Prestashop 1.7 dashboard as the admin role.
  2. From the left sidebar menu, click IMPROVE > Module > Module Manager.
  3. Scroll down to the Other section, and locate the plugin that you installed.
  4. In the plugin section, Click Upgrade to expand the menu, and then select Configure.
  5. Complete the fields in the Settings section:
    • Enable plugin?: Set to Yes.
    • Mode: Set to Live.
    • API Key (live mode): Enter the Production API key.
  6. On the bottom right of the Settings section, click Save to apply the changes.

Magento 2

The Revolut Gateway for Magento 2 plugin enables you to accept online payments via your Magento 2 store easily.

Install the Magento plugin

Complete the following steps to install the Revolut Gateway for Magento 2 plugin manually:

Terminal (Step 3)

$ unzip revolutgatewayformagento2.zip

Terminal (Step 4)

$ php bin/magento setup:upgrade
$ php bin/magento setup:di:compile
$ php bin/magento setup:static-content:deploy

Terminal (Step 5)

$ php bin/magento cache:flush
  1. Download the Revolut Gateway for Magento 2 .zip file.
  2. Locate the /app/code directory inside the root directory. (Note: You might need to create it yourself.)
  3. Extract the plugin in .zip format that you downloaded in the /app/code directory.
  4. Open a terminal in the magento2 root folder and run the commands in the provided code block to install the plugin.
  5. When the installation is done, flush the Magento 2 cache using the admin panel or the terminal command on the right.

Now, log in to to your store's admin panel and navigate to Stores > Configuration > Sales > Payment Methods > Revolut. You should see Revolut under Other payment methods.

Troubleshooting

If you have troubles running the commands in Step 4:

The Revolut Gateway for Magento 2 plugin is compatible only with Magento versions 2.1.x, 2.2.x or 2.3.x.

Configure the Magento plugin

When you’ve successfully installed the Magento plugin, configure the plugin properly to enable you to perform operations.

To do that, complete the following steps:

  1. Log in to to your store's admin panel and navigate to Stores > Configuration > Sales > Payment Methods > Revolut.
  2. Click Configure to expand the Required Settings and the Additional Settings section.
  3. In the Required settings section, complete the fields:
    • Select Mode: Select Sandbox or Live for the payment gateway mode.
    • API Key (sandbox mode) or API Key (live mode): Enter the API Key for sandbox mode or live mode.
  4. In the Additional Settings section, complete the fields:
    • Enable plugin : Select Yes to enable the Revolut gateway.
    • Title : Enter the title displayed on the checkout page.
    • Payment Action : Select between Authorize Only and Authorize And Capture:
      • Authorize Only : To check the card for validity only but not charge the account until the order is approved.
      • Authorize and Capture: To charge the debit/credit card when the order is placed.
    • Always hide postcode: To allow customers to provide their postcode as part of card details, select No. By default ,this is set as No.
    • Payment from Applicable Countries: Select whether to accept payments from all allowed countries or only specific countries.
      • All Allowed Countries: Enable all the allowed countries to make payments.
    • Specific Countries: Select one or more countries (using the Control or SHIFT key) to accept payments from in the Payment from Specific Countries list.
    • New Order Status : Set the order status for new orders as Processing or Suspected Fraud:
      • Processing: The payment is made successfully and an order invoice is issued.
      • Suspected Fraud: No invoice is issued.
    • Sort Order : The order of the Revolut payment method that is displayed on the checkout page. For example, if you set this field to 0, the Revolut payment is displayed as the first payment method.
    • Minimum Order Total : If the order amount is less than this figure, the Revolut payment method is not displayed on the checkout page.
    • Maximum Order in Total: If the order amount is greater than this figure, the Revolut payment method is not displayed on the checkout page.
  5. On the top right of the page, click Save Config to apply the changes.

Perform the operations

Capture an order from Magento's admin panel

With this plugin, you can handle the capture of the orders from Magento's admin panel.

To do so, complete the following steps:

  1. Log in to to your store's admin panel and navigate to Stores > Configuration > Sales > Payment Methods > Revolut.
  2. Click Configure to expand the Required Settings and the Additional Settings section.
  3. In the Additional settings section, set the Payment Action to Authorize Only, so that when a customer places an order, the status of the order in Magento is Processing by default.
  4. From the store's admin panel, navigate to Sales > Orders. Select the order that has been placed and click to View to display the order details view.
  5. Click Invoice on the top banner of the order details view.
  6. Scroll to the bottom and, under the Invoice Totals section, make sure you have selected the Capture online option.
  7. Click Submit Invoice to capture the funds for this order.

Refund an order from Magento's admin panel

When the amount of an order has been captured and an invoice has been generated, you can refund the total or partial amount of an order using Magento's admin panel.

To do so, complete the following steps:

  1. From the store's admin panel, navigate to Sales > Invoices.
  2. Select the invoice of the order you would like to refund, and then click View.
  3. On the top banner, click Credit Memo.
  4. Scroll down to the Items to Refund section and select what items you would like to refund.
  5. Scroll further down and click Refund when you're ready to process the refund.

Test the plugin in the Sandbox environment

You can make test payments using the plugin in the Sandbox environment.

To do that, complete the following steps:

  1. Log in to to your store's admin panel and navigate to Stores > Configuration > Sales > Payment Methods > Revolut.
  2. Click Configure to expand the Required Settings and the Additional Settings section.
  3. Complete the fields:
  1. On the top right of the page, click Save Config to apply the changes.

For more information about testing the integration, see Test in the Sandbox environment.

Use the plugin in the production environment

When you are ready to start accepting payments in your store using the Revolut Gateway for Magento plugin, complete the following steps:

  1. Log in to to your store's admin panel and navigate to Stores > Configuration > Sales > Payment Methods > Revolut.
  2. Click Configure to expand the Required Settings and the Additional Settings section.
  3. Complete the fields:
  1. On the top right of the page, click Save Config to apply the changes.

Errors

The API uses the following error codes:

CODE MEANING
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your access token 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.