kevin. Platform API
Search…
⌃K

One-time payment

One-time payments are simple to set up since no token, scope, or exchange code is required. To make a one-time payment, the user must first log in and select a bank account.
If you want your consumers to be able to bypass the login or account selection part of the bank payment process, then the account linking feature is a must-have. Once your client links their bank account, all the payments for the next 90 days can be done in one click.

Bank payment

  1. 1.
    Initiate payment by calling the /pis/payment endpoint with a bankPaymentMethod object:
PHP
Node.js
cURL
The example below is written using kevin. PHP library. All other possible attributes and their explanations can be found in the official API documentation.
1
use Kevin\Client;
2
​
3
$clientId = 'my-client-id';
4
$clientSecret = 'my-client-secret';
5
$options = ['error' => 'array', 'version' => '0.3', 'lang' => 'en'];
6
​
7
$kevinClient = new Client($clientId, $clientSecret, $options);
8
​
9
$attr = [
10
'Redirect-URL' => 'https://redirect.kevin.eu/payment.html',
11
'bankId' = 'SEB_LT',
12
'redirectPreferred' = false,
13
'description' => 'Test',
14
'currencyCode' => 'EUR',
15
'amount' => '0.01',
16
'bankPaymentMethod' => [
17
'endToEndId' => '1',
18
'creditorName' => 'John Smith',
19
'creditorAccount' => [
20
'iban' => 'LT000000000000000000'
21
],
22
],
23
];
24
​
25
$response = $kevinClient->payment()->initPayment($attr);
The example below is written using kevin. Node.js library. All other possible attributes and their explanations can be found in the official API documentation.
1
const kevin = require('@kevin.eu/kevin-platform-client');
2
​
3
const clientId = 'my-client-id';
4
const clientSecret = 'my-client-secret';
5
​
6
const client = new kevin.Client(clientId, clientSecret);
7
​
8
const options = {
9
headers: {
10
'Redirect-URL': 'https://redirect.kevin.eu/payment.html',
11
},
12
query: {
13
redirectPreferred: true
14
},
15
body: {
16
amount: '1.23',
17
currencyCode: 'EUR',
18
description: 'Lorem Ipsum',
19
bankPaymentMethod: {
20
creditorName: 'John Doe',
21
endToEndId: '123',
22
creditorAccount: {
23
iban: 'LT000000000000000000',
24
}
25
}
26
},
27
}
28
​
29
const payment = await client.payment.initiatePayment(options);
curl --request POST \
--url https://api.kevin.eu/platform/v0.3/pis/payment?bankId=SEB_LT&redirectPreferred=false \
--header 'Client-Id: my-client-id' \
--header 'Client-Secret: my-client-secret' \
--header 'Content-Type: application/json' \
--header 'Redirect-URL: https://redirect.kevin.eu/payment.html' \
--data '{
"amount": "0.01",
"currencyCode": "EUR",
"description": "Test",
"bankPaymentMethod": {
"creditorName": "John Doe",
"endToEndId": "1",
"creditorAccount": {
"iban": "LT000000000000000000"
}
}
}'
2. From the payment initiation request you will receive a confirmLink. The payment link can lead the user to kevin. frame page or bank environment. At the beginning, the payment will have a default started status group and remains in such status until client confirms the payment. The payment link expires after 7 days and cannot be reused.
{
"id": "e4dd60bb-574f-4a13-910a-57c9795d905f",
"bankStatus": "STRD",
"statusGroup": "started",
"confirmLink": "https://psd2.kevin.eu/payment/confirm?paymentId=e4dd60bb-574f-4a13-910a-57c9795d905f"
}
3. If you set the optional Webhook-URL header, as soon as the payment reaches its final status, we will send a request to your provided url. You can read more in the section below:

Bank selection

Bank selection can take place either on your or kevin. side. If you choose the first option, you must provide the bankId query parameter in your payment initiation request. The supported bank list can be obtained from the /auth/banks endpoint. Additionally, your custom checkout page must contain a Terms and Conditions agreement checkbox.
A default country in the kevin.'s frame page is determined by IP address. This behaviour could be overridden by passing country code as a query parameter (for more details please check Frame customisation). If a determined country does not have any banks integrated, the bank list will be empty.
If your project is a test one, you will receive a list of test banks only, which is different comparing to live project bank list. In such situation, payments are not real. Test banks have their own login credentials.
kevin. bank selection page

Payment flow

With the redirectPreferred query parameter, you can determine the payment flow. If set to true, flow will be based mostly on the bank side. Otherwise, if set to false and the bank supports such feature, on kevin. side. To verify if such feature is supported, you can get the information about banks from the /auth/banks endpoint.

Card payment

Card data input must happen on kevin. side.
Take a note that card payment method is not enabled by default. You can confirm that by looking at your project settings. If you want the access, please contact us at [email protected] for the additional agreement.
  1. 1.
    Initiate payment by calling the /pis/payment endpoint with both bankPaymentMethod and cardPaymentMethod objects, and set paymentMethodPreferred to card:
PHP
Node.js
cURL
The example below is written using kevin. PHP library. All other possible attributes and their explanations can be found in the official API documentation.
1
use Kevin\Client;
2
​
3
$clientId = 'my-client-id';
4
$clientSecret = 'my-client-secret';
5
$options = ['error' => 'array', 'version' => '0.3', 'lang' => 'en'];
6
​
7
$kevinClient = new Client($clientId, $clientSecret, $options);
8
​
9
$attr = [
10
'Redirect-URL' => 'https://redirect.kevin.eu/payment.html',
11
'description' => 'Test',
12
'currencyCode' => 'EUR',
13
'amount' => '0.01',
14
'bankPaymentMethod' => [
15
'endToEndId' => '1',
16
'creditorName' => 'John Smith',
17
'creditorAccount' => [
18
'iban' => 'LT000000000000000000'
19
],
20
],
21
'cardPaymentMethod' => [],
22
'paymentMethodPreferred' => 'card',
23
];
24
​
25
$response = $kevinClient->payment()->initPayment($attr);
The example below is written using kevin. Node.js library. All other possible attributes and their explanations can be found in the official API documentation.
1
const kevin = require('@kevin.eu/kevin-platform-client');
2
​
3
const clientId = 'my-client-id';
4
const clientSecret = 'my-client-secret';
5
​
6
const client = new kevin.Client(clientId, clientSecret);
7
​
8
const options = {
9
headers: {
10
'Redirect-URL': 'https://redirect.kevin.eu/payment.html',
11
},
12
query: {
13
redirectPreferred: true
14
},
15
body: {
16
amount: '1.23',
17
currencyCode: 'EUR',
18
description: 'Lorem Ipsum',
19
bankPaymentMethod: {
20
creditorName: 'John Doe',
21
endToEndId: '123',
22
creditorAccount: {
23
iban: 'LT000000000000000000',
24
}
25
},
26
cardPaymentMethod: {}
27
},
28
}
29
​
30
const payment = await client.payment.initiatePayment(options);
curl --request POST \
--url https://api.kevin.eu/platform/v0.3/pis/payment?paymentMethodPreferred=card \
--header 'Client-Id: my-client-id' \
--header 'Client-Secret: my-client-secret' \
--header 'Content-Type: application/json' \
--header 'Redirect-URL: https://redirect.kevin.eu/payment.html' \
--data '{
"amount": "0.01",
"currencyCode": "EUR",
"description": "Test",
"bankPaymentMethod" => {
"endToEndId" => "1",
"creditorName" => "John Smith",
"creditorAccount" => {
"iban" => "LT000000000000000000"
},
},
"cardPaymentMethod": {}
}'
2. From the payment initiation request you will receive a confirmLink. The payment link can lead the user to kevin. frame page only for card data input. The payment link expires after 7 days and cannot be reused.
{
"id": "e4dd60bb-574f-4a13-910a-57c9795d905f",
"hybridStatus": "created",
"statusGroup": "started",
"confirmLink": "https://psd2.kevin.eu/payment/confirm?paymentId=e4dd60bb-574f-4a13-910a-57c9795d905f"
}
3. If you set the optional Webhook-URL header, as soon as the payment reaches its final status, we will send a request to your provided url. You can read more in the section below:

Choose payment method

Payment can be created without specifying the preferred payment type and be determined by the user. If you ignore the optional paymentMethodPreferred query parameter, preferable payment method will be chosen on kevin. frame page:
kevin. payment method selection page

Card redirect

kevin. allows users to redirect their clients from card payments to bank account payments. In most cases, the system recognises the bank based on the card number and redirects the client to finish the payment via their bank account.