Pesquisar

Are you looking for test card numbers?

Would you like to contact support?

Atenção, esta página não se encontra disponível em Português
Payment-method icon

Ratepay for API only

Add Ratepay to an existing API-only integration.

Accept Ratepay payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

When making a Ratepay payment, you need to capture the payment after the goods have been sent. This triggers the invoice to be sent to the shopper.

Before you begin

These instructions explain how to add Ratepay to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

Before starting your integration:

  1. Contact Ratepay to get access to your test credentials.
  2. Make sure that you have set up your back end implementation.
  3. Add Ratepay in your test Customer Area.
  4. Implement Ratepay's device fingerprinting (DFP) and then collect the shopper's device fingerprint for risk evaluation.

Build your payment form for Ratepay

If you're using the /paymentMethods endpoint to show which payment methods are available to the shopper, in your request specify one of the following combinations of countryCode and amount.currency:

Country countryCode amount.currency
Austria AT EUR
Germany DE EUR
The Netherlands NL EUR
Switzerland CH CHF

The response indicates the available payment types:

  • paymentMethod.type: ratepay (Ratepay Open invoice) and ratepay_directdebit (Ratepay Direct debit). Note that Ratepay Direct debit is not available in Switzerland.

When the shopper selects a payment type, you will need to specify the corresponding paymentMethod.type value in your payment request.

We provide a Ratepay logo which you can use in your payment form. For more information, refer to Downloading logos.

Collect shopper details

To make a Ratepay payment, you also need to collect the following shopper details:

Name Description
firstName Shopper's first name.
lastName Shopper's last name.
dateOfBirth Shopper's date of birth.
telephoneNumber Shopper's phone number.
shopperEmail Shopper's email address.
billingAddress The address where to send the invoice.
deliveryAddress Only required if the delivery address is not the same as the billing address.

Calculate the device fingerprint

Before making a payment you need to implement Ratepay's device fingerprinting. Send the calculated device fingerprint when making a /payments request.

Make a payment

From your server, make a /payments request, specifying the following parameters:

Parameter Required Description
paymentMethod.type -white_check_mark- Set to ratepay.
shopperName.firstName -white_check_mark- Shopper's first name.
shopperName.lastName -white_check_mark- Shopper's last name.
telephoneNumber -white_check_mark- Shopper's telephone number.
shopperEmail -white_check_mark- Shopper's email address.
dateOfBirth -white_check_mark- Shopper's date of birth. Format ISO-8601: YYYY-MM-DD
billingAddress -white_check_mark- The address where to send the invoice.
deviceFingerprint -white_check_mark- A string containing the shopper's device fingerprint.
deliveryAddress -x- Only required if the delivery address is not the same as the billing address.
lineItems -white_check_mark- Price and product information about the purchased items. This is included on the invoice that Ratepay sends to the shopper.
curl https://checkout-test.adyen.com/v67/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
    "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
    "reference": "YOUR_ORDER_REFERENCE",
    "paymentMethod": {
        "type": "ratepay"
    },
    "amount": {
        "currency": "EUR",
        "value": "1000"
    },
    "deviceFingerprint": "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
    "countryCode": "NL",
    "dateOfBirth": "1970-07-10",
    "telephoneNumber": "+31858888138",
    "shopperEmail": "s.hopper@example.com",
    "shopperName": {
        "firstName": "Simon",
        "lastName": "Hopper"
    },
    "shopperReference": "YOUR_UNIQUE_SHOPPER_ID",
    "billingAddress": {
        "city": "Amsterdam",
        "country": "NL",
        "houseNumberOrName": "6-50",
        "postalCode": "1011 DJ",
        "street": "Simon Carmiggeltstraat"
    },
    "lineItems": [
        {
            "quantity": "1",
            "amountExcludingTax": "331",
            "taxPercentage": "2100",
            "description": "Shoes",
            "id": "Item #1",
            "taxAmount": "69",
            "amountIncludingTax": "400",
            "taxCategory": "High"
        },
        {
            "quantity": "2",
            "amountExcludingTax": "248",
            "taxPercentage": "2100",
            "description": "Socks",
            "id": "Item #2",
            "taxAmount": "52",
            "amountIncludingTax": "300",
            "taxCategory": "High"
        }
    ]
}
# Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen::Client.new
adyen.env = :test
adyen.api_key = "YOUR_X-API-KEY"

response = adyen.checkout.payments({
  :merchantAccount => "YOUR_MERCHANT_ACCOUNT",
  :countryCode => "NL",
  :amount => {
    :currency => "EUR",
    :value => 1000
  },
  :deviceFingerprint => "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
  :shopperReference => "YOUR_UNIQUE_SHOPPER_ID",
  :reference => "YOUR_ORDER_NUMBER",
  :paymentMethod => {
    :type => "ratepay"
  },
  :shopperName => {
       :firstName => "Simon",
       :lastName => "Hopper"
  },
  :telephoneNumber => "+31858888138",
  :shopperEmail => "s.shopper@example.com",
  :dateOfBirth => "1970-07-10",
  :billingAddress => {
     :street => "Simon Carmiggeltstraat",
     :houseNumberOrName => "136",
     :city => "Amsterdam",
     :postalCode => "1011DJ",
     :country => "NL"
  },
  :lineItems => [
    {
      :quantity => "1",
      :amountExcludingTax => "331",
      :taxPercentage => "2100",
      :description => "Shoes",
      :id => "Item #1",
      :taxAmount => "69",
      :amountIncludingTax => "400",
      :taxCategory => "High"
    },
    {
      :quantity => "2",
      :amountExcludingTax => "248",
      :taxPercentage => "2100",
      :description => "Socks",
      :id => "Item #2",
      :taxAmount => "52",
      :amountIncludingTax => "300",
      :taxCategory => "High"
    }
  ]
})
Client client = new Client("YOUR_API_KEY", Environment.TEST);

Checkout checkout = new Checkout(client);

PaymentsRequest paymentsRequest = new PaymentsRequest();
paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT");
paymentsRequest.setCountryCode("NL");

Amount amount = new Amount();
amount.setCurrency("EUR");
amount.setValue(1000L);

paymentsRequest.setDeviceFingerprint("eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...");

paymentsRequest.setAmount(amount);
paymentsRequest.setShopperReference("YOUR_UNIQUE_SHOPPER_ID");
paymentsRequest.setReference("YOUR_ORDER_NUMBER");
paymentsRequest.setChannel(PaymentsRequest.ChannelEnum.WEB);

DefaultPaymentMethodDetails defaultPaymentMethodDetails = new DefaultPaymentMethodDetails();
defaultPaymentMethodDetails.setType("ratepay");
paymentsRequest.setPaymentMethod(defaultPaymentMethodDetails);

Name shopperName = new Name();
shopperName.setFirstName("Simone");
shopperName.setLastName("Hopper");

paymentsRequest.setTelephoneNumber("+31858888138");
paymentsRequest.setShopperEmail("s.hopper@example.com");
paymentsRequest.setDateOfBirth("1970-07-10");

Address billingAddress = new Address();
billingAddress.setStreet("Simon Carmiggeltstraat");
billingAddress.setHouseNumberOrName("136");
billingAddress.setCity("Amsterdam");
billingAddress.setPostalCode("1011DJ");
billingAddress.setCountry("NL");

paymentsRequest.setBillingAddress(billingAddress);

List<LineItem> lineItems = new ArrayList<>();

lineItems.add(
        new LineItem()
                .quantity(1L)
                .amountExcludingTax(331L)
                .taxPercentage(2100L)
                .description("Shoes")
                .id("Item #1")
                .taxAmount(69L)
                .amountIncludingTax(400L)
                .taxCategory(LineItem.TaxCategoryEnum.HIGH)
);

lineItems.add(
        new LineItem()
                .quantity(2L)
                .amountExcludingTax(248L)
                .taxPercentage(2100L)
                .description("Socks")
                .id("Item #2")
                .taxAmount(52L)
                .amountIncludingTax(300L)
                .taxCategory(LineItem.TaxCategoryEnum.HIGH)
);

paymentsRequest.setLineItems(lineItems);

PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
// Set your X-API-KEY with the API key from the Customer Area.
$client = new \Adyen\Client();
$client->setXApiKey("YOUR_X-API-KEY");
$service = new \Adyen\Service\Checkout($client);

$params = [
  "merchantAccount" => "YOUR_MERCHANT_ACCOUNT",
  "countryCode" => "NL",
  "amount" => [
     "currency" => "EUR",
     "value" => 1000
  ],
  "deviceFingerprint" => "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
  "shopperReference" => "YOUR_UNIQUE_SHOPPER_ID",
  "reference" => "YOUR_ORDER_NUMBER",
  "paymentMethod" => [
     "type" => "ratepay"
  ],
   "shopperName" => [
       "firstName" => "Simon",
       "lastName" => "Hopper"
   ],
   "telephoneNumber" => "+31858888138",
   "shopperEmail" => "s.shopper@example.com",
   "dateOfBirth" => "1970-07-10",
   "billingAddress" => [
         "street" => "Simon Carmiggeltstraat",
         "houseNumberOrName" => "136",
         "city" => "Amsterdam",
         "postalCode" => "1011DJ",
         "country" => "NL"
    ],
  "lineItems" => [
     [
        "quantity" => "1",
        "amountExcludingTax" => "331",
        "taxPercentage" => "2100",
        "description" => "Shoes",
        "id" => "Item #1",
        "taxAmount" => "69",
        "amountIncludingTax" => "400",
        "taxCategory" => "High"
     ],
     [
        "quantity" => "2",
        "amountExcludingTax" => "248",
        "taxPercentage" => "2100",
        "description" => "Socks",
        "id" => "Item #2",
        "taxAmount" => "52",
        "amountIncludingTax" => "300",
        "taxCategory" => "High"
     ]
  ]
];

$result = $service->payments($params);

// Check if further action is needed
if (array_key_exists("action", $result)){
   // Pass the action object to your frontend.
   // $result["action"]
}
else {
   // No further action needed, pass the resultCode to your front end
   // $result['resultCode']
}
# Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen.Adyen()
adyen.client.xapikey = 'YOUR_X-API-KEY'

result = adyen.checkout.payments({
  "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
  "countryCode": "NL",
  "amount": {
      "currency": "EUR",
      "value": 1000
   },
   "deviceFingerprint": "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
   "shopperReference": "YOUR_UNIQUE_SHOPPER_ID",
   "reference": "YOUR_ORDER_NUMBER",
   "paymentMethod": {
      "type":"ratepay"
   },
   "shopperName": {
      "firstName": "Simon",
      "lastName": "Hopper"
   },
   "telephoneNumber": "+31858888138",
   "shopperEmail":"s.shopper@example.com",
   "dateOfBirth":"1970-07-10",
   "billingAddress": {
         "street":"Simon Carmiggeltstraat",
         "houseNumberOrName":"136",
         "city":"Amsterdam",
         "postalCode":"1011DJ",
         "country":"NL"
    },
   "lineItems":[
      {
         "quantity":"1",
         "amountExcludingTax":"331",
         "taxPercentage":"2100",
         "description":"Shoes",
         "id":"Item #1",
         "taxAmount":"69",
         "amountIncludingTax":"400",
         "taxCategory":"High"
      },
      {
         "quantity":"2",
         "amountExcludingTax":"248",
         "taxPercentage":"2100",
         "description":"Socks",
         "id":"Item #2",
         "taxAmount":"52",
         "amountIncludingTax":"300",
         "taxCategory":"High"
      }
   ]
})
var paymentRequest = new Adyen.Model.Checkout.PaymentRequest
{
    MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
    CountryCode = "NL",
    Amount = new Adyen.Model.Checkout.Amount("EUR", 1000),
    ShopperReference = "YOUR_UNIQUE_SHOPPER_ID",
    Reference = "YOUR_ORDER_NUMBER",
    Channel = Adyen.Model.Checkout.PaymentRequest.ChannelEnum.Web,
    TelephoneNumber = "+31858888138",
    ShopperEmail = "s.hopper@example.com",
    DateOfBirth = new DateTime(1970,07,10),

    LineItems = new List<LineItem>
    {
        new LineItem(AmountIncludingTax: 400, AmountExcludingTax: 331, Quantity: 1, TaxPercentage: 2100, Id: "Item #1", TaxAmount: 69, Description: "Shoes", TaxCategory: LineItem.TaxCategoryEnum.High),
        new LineItem(AmountIncludingTax: 300, AmountExcludingTax: 248, Quantity: 2, TaxPercentage: 2100, Id: "Item #2", TaxAmount: 52, Description: "Socks", TaxCategory: LineItem.TaxCategoryEnum.High)
    },
    PaymentMethod = new DefaultPaymentMethodDetails
    {
        Type = "ratepay",

        BillingAddress = new Address(Country: "NL")
        {
            Street = "Simon Carmiggeltstraat",
            HouseNumberOrName = "136",
            City = "Amsterdam",
            PostalCode = "1011DJ"
        },
    },
    ShopperName = new Name
    {
        FirstName = "Simone",
        LastName = "Hopper",
    },
    DeviceFingerprint = "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ..."
};
// Set your X-API-KEY with the API key from the Customer Area.
const {Client, Config, CheckoutAPI} = require('@adyen/api-library');
const config = new Config();
// Set your X-API-KEY with the API key from the Customer Area.
config.apiKey = '[API_KEY]';
config.merchantAccount = '[MERCHANT_ACCOUNT]';
const client = new Client({ config });
client.setEnvironment("TEST");
const checkout = new CheckoutAPI(client);
checkout.payments({
  merchantAccount: "YOUR_MERCHANT_ACCOUNT",
  countryCode:"NL",
  amount: {
     currency: "EUR",
     value: "1000"
  },
  deviceFingerprint: "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
  shopperReference: "YOUR_UNIQUE_SHOPPER_ID",
  reference: "YOUR_ORDER_NUMBER",
  paymentMethod: {
    type: "ratepay"
   },
  shopperName: {
    firstName: "Simon",
    lastName: "Hopper"
   },
  telephoneNumber: "+31858888138",
  shopperEmail: "s.shopper@example.com",
  dateOfBirth: "1970-07-10",
  billingAddress: {
    street: "Simon Carmiggeltstraat",
    houseNumberOrName: "136",
    city: "Amsterdam",
    postalCode: "1011DJ",
    country: "NL"
  },
  lineItems: [
     {
        quantity: "1",
        amountExcludingTax: "331",
        taxPercentage: "2100",
        description: "Shoes",
        id: "Item 1",
        taxAmount: "69",
        amountIncludingTax: "400",
        taxCategory: "High"
     },
     {
        quantity: "2",
        amountExcludingTax: "248",
        taxPercentage: "2100",
        description: "Socks",
        id: "Item 2",
        taxAmount: "52",
        amountIncludingTax: "300",
        taxCategory: "High"
     }
  ]
}).then(res => res);
Parameter Required Description
paymentMethod.type -white_check_mark- Set to ratepay_directdebit. Ratepay Direct Debit is not available in Switzerland.
shopperName.firstName -white_check_mark- Shopper's first name.
shopperName.lastName -white_check_mark- Shopper's last name.
telephoneNumber -white_check_mark- Shopper's telephone number.
shopperEmail -white_check_mark- Shopper's email address.
dateOfBirth -white_check_mark- Shopper's date of birth. Format ISO-8601: YYYY-MM-DD.
billingAddress -white_check_mark- The address where to send the invoice.
deviceFingerprint -white_check_mark- A string containing the shopper's device fingerprint.
deliveryAddress -x- Only required if the delivery address is not the same as the billing address.
lineItems -white_check_mark- Price and product information about the purchased items. This is included on the invoice that Ratepay sends to the shopper.
bankAccount.countryCode -white_check_mark- Shopper's country. Format: ISO 3166-1 alpha-2.
bankAccount.iban -white_check_mark- Shopper's International Bank Account Number (IBAN).
bankAccount.ownerName -white_check_mark- Name of the bank account holder.
curl https://checkout-test.adyen.com/v67/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
    "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
    "countryCode": "NL",
    "amount": {
        "currency": "EUR",
        "value": 1000
    },
    "bankAccount": {
        "countryCode": "NL",
        "iban": "NL87123456781234567890",
        "ownerName": "Simon Hopper"
    },
    "deviceFingerprint": "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
    "shopperReference": "YOUR_UNIQUE_SHOPPER_ID",
    "reference": "YOUR_ORDER_NUMBER",
    "paymentMethod": {
        "type": "ratepay"
    },
    "shopperName": {
        "firstName": "Simon",
        "lastName": "Hopper"
    },
    "telephoneNumber": "+31858888138",
    "shopperEmail": "s.shopper@example.com",
    "dateOfBirth": "1970-07-10",
    "billingAddress": {
        "street": "Simon Carmiggeltstraat",
        "houseNumberOrName": "136",
        "city": "Amsterdam",
        "postalCode": "1011DJ",
        "country": "NL"
    },
    "lineItems": [
        {
            "quantity": "1",
            "amountExcludingTax": "331",
            "taxPercentage": "2100",
            "description": "Shoes",
            "id": "Item #1",
            "taxAmount": "69",
            "amountIncludingTax": "400",
            "taxCategory": "High"
        },
        {
            "quantity": "2",
            "amountExcludingTax": "248",
            "taxPercentage": "2100",
            "description": "Socks",
            "id": "Item #2",
            "taxAmount": "52",
            "amountIncludingTax": "300",
            "taxCategory": "High"
        }
    ]
}'
# Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen::Client.new
adyen.env = :test
adyen.api_key = "YOUR_X-API-KEY"

response = adyen.checkout.payments({
  :merchantAccount => "YOUR_MERCHANT_ACCOUNT",
  :countryCode => "NL",
  :amount => {
    :currency => "EUR",
    :value => 1000
  },
  :bankAccount => {
      :countryCode => "NL",
      :iban => "NL87123456781234567890",
      :ownerName => "Simon Hopper"
  },
  :deviceFingerprint => "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
  :shopperReference => "YOUR_UNIQUE_SHOPPER_ID",
  :reference => "YOUR_ORDER_NUMBER",
  :paymentMethod => {
    :type => "ratepay"
  },
  :shopperName => {
       :firstName => "Simon",
       :lastName => "Hopper"
  },
  :telephoneNumber => "+31858888138",
  :shopperEmail => "s.shopper@example.com",
  :dateOfBirth => "1970-07-10",
  :billingAddress => {
     :street => "Simon Carmiggeltstraat",
     :houseNumberOrName => "136",
     :city => "Amsterdam",
     :postalCode => "1011DJ",
     :country => "NL"
  },
  :lineItems => [
    {
      :quantity => "1",
      :amountExcludingTax => "331",
      :taxPercentage => "2100",
      :description => "Shoes",
      :id => "Item #1",
      :taxAmount => "69",
      :amountIncludingTax => "400",
      :taxCategory => "High"
    },
    {
      :quantity => "2",
      :amountExcludingTax => "248",
      :taxPercentage => "2100",
      :description => "Socks",
      :id => "Item #2",
      :taxAmount => "52",
      :amountIncludingTax => "300",
      :taxCategory => "High"
    }
  ]
})
Client client = new Client("YOUR_API_KEY", Environment.TEST);

Checkout checkout = new Checkout(client);

PaymentsRequest paymentsRequest = new PaymentsRequest();
paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT");
paymentsRequest.setCountryCode("NL");

Amount amount = new Amount();
amount.setCurrency("EUR");
amount.setValue(1000L);

BankAccount bankAccount = new BankAccount();
amount.setCountryCode("NL");
amount.setIban("NL87123456781234567890");
amount.setOwnerName("Simon Hopper");

paymentsRequest.setDeviceFingerprint("eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...");

paymentsRequest.setAmount(amount);
paymentsRequest.setShopperReference("YOUR_UNIQUE_SHOPPER_ID");
paymentsRequest.setReference("YOUR_ORDER_NUMBER");
paymentsRequest.setChannel(PaymentsRequest.ChannelEnum.WEB);

DefaultPaymentMethodDetails defaultPaymentMethodDetails = new DefaultPaymentMethodDetails();
defaultPaymentMethodDetails.setType("ratepay");
paymentsRequest.setPaymentMethod(defaultPaymentMethodDetails);

Name shopperName = new Name();
shopperName.setFirstName("Simone");
shopperName.setLastName("Hopper");

paymentsRequest.setTelephoneNumber("+31858888138");
paymentsRequest.setShopperEmail("s.hopper@example.com");
paymentsRequest.setDateOfBirth("1970-07-10");

Address billingAddress = new Address();
billingAddress.setStreet("Simon Carmiggeltstraat");
billingAddress.setHouseNumberOrName("136");
billingAddress.setCity("Amsterdam");
billingAddress.setPostalCode("1011DJ");
billingAddress.setCountry("NL");

paymentsRequest.setBillingAddress(billingAddress);

List<LineItem> lineItems = new ArrayList<>();

lineItems.add(
        new LineItem()
                .quantity(1L)
                .amountExcludingTax(331L)
                .taxPercentage(2100L)
                .description("Shoes")
                .id("Item #1")
                .taxAmount(69L)
                .amountIncludingTax(400L)
                .taxCategory(LineItem.TaxCategoryEnum.HIGH)
);

lineItems.add(
        new LineItem()
                .quantity(2L)
                .amountExcludingTax(248L)
                .taxPercentage(2100L)
                .description("Socks")
                .id("Item #2")
                .taxAmount(52L)
                .amountIncludingTax(300L)
                .taxCategory(LineItem.TaxCategoryEnum.HIGH)
);

paymentsRequest.setLineItems(lineItems);

PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
// Set your X-API-KEY with the API key from the Customer Area.
$client = new \Adyen\Client();
$client->setXApiKey("YOUR_X-API-KEY");
$service = new \Adyen\Service\Checkout($client);

$params = [
  "merchantAccount" => "YOUR_MERCHANT_ACCOUNT",
  "countryCode" => "NL",
  "amount" => [
    "currency" => "EUR",
    "value" => 1000
  ],
  "bankAccount" => [
    "countryCode" => "NL",
    "iban" => "NL87123456781234567890",
    "ownerName" => "Simon Hopper"
  ],
  "deviceFingerprint" => "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
  "shopperReference" => "YOUR_UNIQUE_SHOPPER_ID",
  "reference" => "YOUR_ORDER_NUMBER",
  "paymentMethod" => [
    "type" => "ratepay"
  ],
  "shopperName" => [
    "firstName" => "Simon",
    "lastName" => "Hopper"
  ],
  "telephoneNumber" => "+31858888138",
  "shopperEmail" => "s.shopper@example.com",
  "dateOfBirth" => "1970-07-10",
  "billingAddress" => [
    "street" => "Simon Carmiggeltstraat",
    "houseNumberOrName" => "136",
    "city" => "Amsterdam",
    "postalCode" => "1011DJ",
    "country" => "NL"
  ],
  "lineItems" => [
    [
      "quantity" => "1",
      "amountExcludingTax" => "331",
      "taxPercentage" => "2100",
      "description" => "Shoes",
      "id" => "Item #1",
      "taxAmount" => "69",
      "amountIncludingTax" => "400",
      "taxCategory" => "High"
    ],
    [
      "quantity" => "2",
      "amountExcludingTax" => "248",
      "taxPercentage" => "2100",
      "description" => "Socks",
      "id" => "Item #2",
      "taxAmount" => "52",
      "amountIncludingTax" => "300",
      "taxCategory" => "High"
    ]
  ]
];

$result = $service->payments($params);

// Check if further action is needed
if (array_key_exists("action", $result)){
   // Pass the action object to your frontend.
   // $result["action"]
}
else {
   // No further action needed, pass the resultCode to your front end
   // $result['resultCode']
}
# Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen.Adyen()
adyen.client.xapikey = 'YOUR_X-API-KEY'

result = adyen.checkout.payments({
    "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
    "countryCode": "NL",
    "amount": {
        "currency": "EUR",
        "value": 1000
    },
    "bankAccount": {
        "countryCode": "NL",
        "iban": "NL87123456781234567890",
        "ownerName": "Simon Hopper"
    },
    "deviceFingerprint": "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
    "shopperReference": "YOUR_UNIQUE_SHOPPER_ID",
    "reference": "YOUR_ORDER_NUMBER",
    "paymentMethod": {
        "type": "ratepay"
    },
    "shopperName": {
        "firstName": "Simon",
        "lastName": "Hopper"
    },
    "telephoneNumber": "+31858888138",
    "shopperEmail": "s.shopper@example.com",
    "dateOfBirth": "1970-07-10",
    "billingAddress": {
        "street": "Simon Carmiggeltstraat",
        "houseNumberOrName": "136",
        "city": "Amsterdam",
        "postalCode": "1011DJ",
        "country": "NL"
    },
    "lineItems": [
        {
            "quantity": "1",
            "amountExcludingTax": "331",
            "taxPercentage": "2100",
            "description": "Shoes",
            "id": "Item #1",
            "taxAmount": "69",
            "amountIncludingTax": "400",
            "taxCategory": "High"
        },
        {
            "quantity": "2",
            "amountExcludingTax": "248",
            "taxPercentage": "2100",
            "description": "Socks",
            "id": "Item #2",
            "taxAmount": "52",
            "amountIncludingTax": "300",
            "taxCategory": "High"
        }
    ]
})
var paymentRequest = new Adyen.Model.Checkout.PaymentRequest
{
    MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
    CountryCode = "NL",
    Amount = new Adyen.Model.Checkout.Amount("EUR", 1000),
    BankAccount = new BankAccount
    {
        countryCode = "NL",
        iban = "NL87123456781234567890",
        ownerName = "Simon Hopper"
    },
    ShopperReference = "YOUR_UNIQUE_SHOPPER_ID",
    Reference = "YOUR_ORDER_NUMBER",
    Channel = Adyen.Model.Checkout.PaymentRequest.ChannelEnum.Web,
    TelephoneNumber = "+31858888138",
    ShopperEmail = "s.hopper@example.com",
    DateOfBirth = new DateTime(1970,07,10),

    LineItems = new List<LineItem>
    {
        new LineItem(AmountIncludingTax: 400, AmountExcludingTax: 331, Quantity: 1, TaxPercentage: 2100, Id: "Item #1", TaxAmount: 69, Description: "Shoes", TaxCategory: LineItem.TaxCategoryEnum.High),
        new LineItem(AmountIncludingTax: 300, AmountExcludingTax: 248, Quantity: 2, TaxPercentage: 2100, Id: "Item #2", TaxAmount: 52, Description: "Socks", TaxCategory: LineItem.TaxCategoryEnum.High)
    },
    PaymentMethod = new DefaultPaymentMethodDetails
    {
        Type = "ratepay"
    },
    BillingAddress = new Address(Country: "NL")
    {
        Street = "Simon Carmiggeltstraat",
        HouseNumberOrName = "136",
        City = "Amsterdam",
        PostalCode = "1011DJ"
    },
    ShopperName = new Name
    {
        FirstName = "Simone",
        LastName = "Hopper",
    },
    DeviceFingerprint = "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ..."
};
// Set your X-API-KEY with the API key from the Customer Area.
const {Client, Config, CheckoutAPI} = require('@adyen/api-library');
const config = new Config();
// Set your X-API-KEY with the API key from the Customer Area.
config.apiKey = '[API_KEY]';
config.merchantAccount = '[MERCHANT_ACCOUNT]';
const client = new Client({ config });
client.setEnvironment("TEST");
const checkout = new CheckoutAPI(client);
checkout.payments({
  merchantAccount: "YOUR_MERCHANT_ACCOUNT",
  countryCode: "NL",
  amount: {
     currency: "EUR",
     value: "1000"
  },
  bankAccount: {
      countryCode: "NL",
      iban: "NL87123456781234567890",
      ownerName: "Simon Hopper"
  },
  deviceFingerprint: "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZ...",
  shopperReference: "YOUR_UNIQUE_SHOPPER_ID",
  reference: "YOUR_ORDER_NUMBER",
  paymentMethod: {
    type: "ratepay"
   },
  shopperName: {
    firstName: "Simon",
    lastName: "Hopper"
   },
  telephoneNumber: "+31858888138",
  shopperEmail: "s.shopper@example.com",
  dateOfBirth: "1970-07-10",
  billingAddress: {
    street: "Simon Carmiggeltstraat",
    houseNumberOrName: "136",
    city: "Amsterdam",
    postalCode: "1011DJ",
    country: "NL"
  },
  lineItems: [
     {
        quantity: "1",
        amountExcludingTax: "331",
        taxPercentage: "2100",
        description: "Shoes",
        id: "Item 1",
        taxAmount: "69",
        amountIncludingTax: "400",
        taxCategory: "High"
     },
     {
        quantity: "2",
        amountExcludingTax: "248",
        taxPercentage: "2100",
        description: "Socks",
        id: "Item 2",
        taxAmount: "52",
        amountIncludingTax: "300",
        taxCategory: "High"
     }
  ]
}).then(res => res);

The /payments response contains:

  • additionalData.openinvoicedata.descriptor: The purpose of the payment which you should print on the invoice. The shopper provides it when making a bank transfer, so Ratepay can match the payment to the transaction.
  • resultCode: Use this to present the payment result to your shopper.
  • pspReference: Our unique reference for the payment.
  • merchantReference: Your reference from the /payments request.
/payments response
{
  "additionalData": {
        "openinvoicedata.descriptor": "DN0099661Y8"
    },
  "pspReference":"881567437271705K",
  "resultCode":"Authorised",
  "merchantReference":"YOUR_ORDER_NUMBER"
}

Present the payment result

Use the resultCode that you received in the /payments response to present the payment result to your shopper.
The resultCode values you can receive for Ratepay are:

resultCode Description Action to take
Authorised The payment was successfully authorised. Inform the shopper that the payment was successful. You can also add a message, for example: Thank you for your order. Your purchase order number is XYZ.
After the goods have been sent, you also need to capture the payment.
Cancelled The shopper cancelled the payment. Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.
Refused The payment was refused by Ratepay. Ask the shopper to try the payment again using a different payment method.

Capture the payment

This section only applies to Ratepay Open invoice. You don't need to capture the payment when paying with Ratepay Direct debit.

After the goods have been sent, you also need to capture the payment. All Ratepay payments have to be manually captured, even if you have enabled automatic capture for other payment methods. Capturing the payment is what triggers the invoice to be sent to the shopper.

Partial captures

To partially capture a Ratepay payment, specify in your /payments/{paymentPspReference}/captures request:

  • modificationAmount: The amount that the shopper should pay. 
  • additionalData.openinvoicedata: Price and product information for the items that the shopper should pay for.

Although the field names are different, the information in additionalData.openinvoicedata is the same as what you provided in lineItems when making a /payments request:

openinvoicedata lineItems Description
itemAmount amountExcludingTax The price for one item, without the tax, in minor units.
itemVatAmount taxAmount The tax amount for one item, in minor units.
itemVatPercentage taxPercentage The tax percentage, in minor units.

The following example shows how to make a partial capture request if the shopper only kept one pair of socks from the two included in the original payment request.

/capture request
{
   "originalReference":"COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "modificationAmount":{
      "currency":"EUR",
      "value":"700"
   },
   "additionalData":{
      "openinvoicedata.numberOfLines":"2",
      "openinvoicedata.line1.currencyCode":"EUR",
      "openinvoicedata.line1.description":"Shoes",
      "openinvoicedata.line1.itemAmount":"331",
      "openinvoicedata.line1.itemVatAmount":"69",
      "openinvoicedata.line1.itemVatPercentage":"2100",
      "openinvoicedata.line1.numberOfItems":"1",
      "openinvoicedata.line1.vatCategory":"High",
      "openinvoicedata.line1.itemId":"Item #1",
      "openinvoicedata.line2.currencyCode":"EUR",
      "openinvoicedata.line2.description":"Socks",
      "openinvoicedata.line2.itemAmount":"248",
      "openinvoicedata.line2.itemVatAmount":"52",
      "openinvoicedata.line2.itemVatPercentage":"2100",
      "openinvoicedata.line2.numberOfItems":"1",
      "openinvoicedata.line2.vatCategory":"High",
      "openinvoicedata.line2.itemId":"Item #2",
   },
   "reference":"YOUR_CAPTURE_REFERENCE"
}

Any unclaimed amount that is left after partially capturing a payment should be manually cancelled.

To set up multiple partial captures, contact our Support Team. Multiple partial captures will create a new invoice for each capture.

Refunds and cancellations

If a Ratepay payment has not yet been captured, you can cancel it. If the Ratepay payment has already been captured and you want to return the funds to the shopper, you need to refund it.

Partial refunds

To partially refund a Ratepay payment, specify in your /payments/{paymentPspReference}/refunds request:

  • modificationAmount: The amount to be refunded to the shopper.
  • additionalData.acquirerReference: The acquirerReference of the capture. This is needed if there are multiple partial captures available for the payment. When refunding in your Customer Area, you can add the acquirerReference manually as well.
  • additionalData.openinvoicedata: Price and product information about the returned items.

Although the field names are different, the information in additionalData.openinvoicedata is the same as what you provided in lineItems when making a /payments request:

openinvoicedata lineItems Description
itemAmount amountExcludingTax The price for one item, without the tax, in minor units.
itemVatAmount taxAmount The tax amount for one item, in minor units.
itemVatPercentage taxPercentage The tax percentage, in minor units.

The following example shows how to make a partial refund request if the shopper returned the shoes included in the original payment request.

/refund request
{
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "originalReference":"COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
   "modificationAmount":{
      "currency":"EUR",
      "value":"400"
   },
   "additionalData":{
      "openinvoicedata.numberOfLines":"1",
      "openinvoicedata.line1.currencyCode":"EUR",
      "openinvoicedata.line1.description":"Shoes",
      "openinvoicedata.line1.itemAmount":"331",
      "openinvoicedata.line1.itemVatAmount":"69",
      "openinvoicedata.line1.itemVatPercentage":"2100",
      "openinvoicedata.line1.numberOfItems":"1",
      "openinvoicedata.line1.vatCategory":"High"
   },
   "reference":"YOUR_REFUND_REFERENCE"
}

Test and go live

Before you can accept live Ratepay payments, you need to submit a request for Ratepay in your live Customer Area, and provide us your Ratepay live credentials.
Ratepay provides test data and recommendations on how to test some of the most common scenarious.
You can check the status of the test payments in your Customer Area > Transactions > Payments.

See also