Use the Authentication SDK to integrate this verification flow directly into your transaction history request.
Requirements
Before you begin, take into account the following requirements, limitations, and preparations.| Requirement | Description |
|---|---|
| Integration type | This feature is supported with an Adyen for Platforms or a Classic integration. |
| API credentials | You must have an API key (recommended) or basic authentication username and password to access this API. Ensure that you have asked your Adyen contact to assign the following role to your API credential: - TransferService Webservice Retrieve role |
| Setup steps | Before you begin: Make sure that you have installed the Authentication SDK. Make sure that you have registered a device for your user. |
How it works
To retrieve transaction history, verify device eligibility, trigger a secure challenge via the SDK, and retrieve the data, perform the following:- Check SCA eligibility
- Initiate a request for your user’s transaction history using the
sdkOutputthat you got when you checked the device for SCA eligibility. - Authenticate your user with the Authentication SDK.
- Get the transaction history using the
sdkOutputfrom the authentication step.
Check SCA eligibility
Before requesting the transaction history, you must check for SCA eligibility and initiate the process to authenticate your users. The following tabs explain how to check for SCA eligibility and initiate authentication using Kotlin, Swift, or JavaScript.- Android (Kotlin)
- iOS (Swift)
- Web (JavaScript)
- Android (Kotlin)
- iOS (Swift)
- Web (JavaScript)
To initiate authentication on an Android device:To check if the Android device is eligible for SCA:
-
Initiate the
AdyenAuthenticationclass in your Activity or Fragment. Initiate authenticationprivate lateinit var adyenAuthentication: AdyenAuthentication override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) adyenAuthentication = AdyenAuthentication(this) } -
Check if SCA is available on the device.
Check SCA eligibility
The function returns an
lifecycleScope.launch { val availabilityResult: AvailabilityResult = adyenAuthentication.checkAvailability() if (availabilityResult is AvailabilityResult.Available) { availabilityResult.sdkOutput } }sdkOutput. -
Pass the
sdkOutputto your server.
To initiate authentication on an iOS device:To check if the iOS device is eligible for SCA:
-
Initialize the
AuthenticationServiceclass. Initialize authentication servicelet configuration = AuthenticationService.Configuration( localizedRegistrationReason: registrationReason, localizedAuthenticationReason: authenticationReason, appleTeamIdendtifier: appleTeamIdentifier ) let authenticationService = AuthenticationService(configuration: configuration) -
Check if SCA is available on the device.
Check SCA eligibility
The function returns an
let sdkOutput = try authenticationService.checkSupport() /// send the sdkOutput to your backendsdkOutput. -
Pass the
sdkOutputto your server.
To initiate authentication on a web browser on your web-enabled device:To check if the web browser on your web-enabled device is eligible for SCA:
-
Import the node package in your application.
RelyingPartyNameis the name the user will be presented with when creating or validating aWebAuthnoperation. We recommend that the value of theRelyingPartyNamebe the merchant name or the URL domain. Import web sdk and initiate authenticationIf the user’s browser supports SCA, the function returnsimport ScaWebauthn from '@adyen/bpscaweb'; const scaWebauthn = ScaWebauthn.create({ relyingPartyName: 'merchant', }); const sdkOutput = await scaWebauthn.checkAvailability().catch((error) => /* SCA_UNAVAILABLE error*/);sdkOutputto exchange in requests to the server. If SCA is not supported, the method throws anSCA_UNAVAILABLEerror. -
Pass the
sdkOutputto your server.
sdkOutput when initiating a request for transaction history.Initiate a request for the transaction history
To request the transaction history for the specified balance account:-
Make a GET /transactions request, specifying the following parameter in the header:
Provide the following query parameters:
Request header Description WWW-AuthenticateSCA realm: Transaction.auth-param1: Base64-encoded value of sdkOutput you get when you initiate authentication..Request transaction historyParameter Required Description balanceAccountId 
Unique identifier of the balance account to get the transaction history for. createdSince 
Only include transactions that have been created on or after this point in time. The value must be in ISO 8601 format. For example, 2022-05-30T15:07:40Z. createdUntil 
Only include transactions that have been created on or before this point in time. The value must be in ISO 8601 format. For example, 2022-05-31T15:07:40Z. curl
curl https://balanceplatform-api-test.adyen.com/btl/v4/transactions?balanceAccountId=BA00000000000000000000002&createdSince=2022-05-30T15:07:40Z&createdUntil=2022-05-31T15:07:40Z \ -H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \ -H 'content-type: application/json' \ -H 'WWW-Authenticate: SCA realm="Transaction" auth-param1="eyJjaGFsbGVuZ2UiOiJiVlV6ZW5wek0waFNl..."' \ -X GET \ -d '{ }'Java
// Adyen Java API Library v33.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.transfers.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.transfers.*; Client client = new Client("ADYEN_BALANCE_PLATFORM_API_KEY", Environment.TEST); // Send the request TransactionsApi service = new TransactionsApi(client); TransactionSearchResponse response = service.getAllTransactions("String", "String", "String", "String", "String", LocalDateTime.parse("2025-01-01T15:00:00");, LocalDateTime.parse("2025-01-01T15:00:00");, 1, null);PHP
<?php // Adyen PHP API Library v24.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Service\Transfers\TransactionsApi; $client = new Client(); $client->setXApiKey("ADYEN_BALANCE_PLATFORM_API_KEY"); $client->setEnvironment(Environment::TEST); $requestOptions['queryParams'] = array('balancePlatform' => 'string', 'paymentInstrumentId' => 'string', 'accountHolderId' => 'string', 'balanceAccountId' => 'string', 'cursor' => 'string', 'createdSince' => 'date-time', 'createdUntil' => 'date-time', 'limit' => 'integer'); // Send the request $service = new TransactionsApi($client); $response = $service->getAllTransactions($requestOptions);C#
// Adyen .net API Library v28.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Transfers; using Adyen.Service.Transfers; var config = new Config() { XApiKey = "ADYEN_BALANCE_PLATFORM_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Send the request var service = new TransactionsService(client); var response = service.GetAllTransactions(balancePlatform: "string", paymentInstrumentId: "string", accountHolderId: "string", balanceAccountId: "string", cursor: "string", createdSince: DateTime.Parse("2025-01-01T15:00:00"), createdUntil: DateTime.Parse("2025-01-01T15:00:00"), limit: 1);NodeJS (JavaScript)
// Adyen Node API Library v23.3.0 const { Client, TransfersAPI } = require('@adyen/api-library'); const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" }); // Send the request const transfersAPI = new TransfersAPI(client); const response = transfersAPI.TransactionsApi.getAllTransactions("string", "string", "string", "string", "string", Date.now(), Date.now(), 1);Go
// Adyen Go API Library v17.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v17/src/common" "github.com/adyen/adyen-go-api-library/v17/src/adyen" "github.com/adyen/adyen-go-api-library/v17/src/transfers" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", Environment: common.TestEnv, }) // Send the request service := client.Transfers() req := service.TransactionsApi.GetAllTransactionsInput() req = req.BalancePlatform("string").PaymentInstrumentId("string").AccountHolderId("string").BalanceAccountId("string").Cursor("string").CreatedSince(DateTime.Parse("2025-01-01T15:00:00")).CreatedUntil(DateTime.Parse("2025-01-01T15:00:00")).Limit(1) res, httpRes, err := service.TransactionsApi.GetAllTransactions(context.Background(), req)Python
# Adyen Python API Library v13.3.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_BALANCE_PLATFORM_API_KEY" adyen.client.platform = "test" # The environment to use library in. query_parameters = { "balancePlatform" : "string", "paymentInstrumentId" : "string", "accountHolderId" : "string", "balanceAccountId" : "string", "cursor" : "string", "createdSince" : "date-time", "createdUntil" : "date-time", "limit" : "integer" } # Send the request result = adyen.transfers.transactions_api.get_all_transactions(query_parameters=query_parameters)Ruby
# Adyen Ruby API Library v10.1.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY' adyen.env = :test # Set to "live" for live environment # Create the request object(s) query_params = { :balancePlatform => 'string', :paymentInstrumentId => 'string', :accountHolderId => 'string', :balanceAccountId => 'string', :cursor => 'string', :createdSince => 'date-time', :createdUntil => 'date-time', :limit => 'integer' } # Send the request result = adyen.transfers.transactions_api.get_all_transactions(query_params: query_params)NodeJS (TypeScript)
// Adyen Node API Library v23.3.0 import { Client, TransfersAPI, Types } from "@adyen/api-library"; const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" }); // Send the request const transfersAPI = new TransfersAPI(client); const response = transfersAPI.TransactionsApi.getAllTransactions("string", "string", "string", "string", "string", Date.now(), Date.now(), 1); -
In the response, note the following field in the header:
auth-param1: Base64-encoded blob of data.
auth-param1when authenticating your user using the SDK. Response{ "type": "https://docs.adyen.com/errors/unauthorized", "title": "Unauthorized", "status": 401, "errorCode": "00_401" } -
Pass
auth-param1to the SDK assdkInput.
Authenticate your user
After initiating the request, you have 10 minutes to complete the authentication process and finalize the request.To authenticate your user with the Authentication SDK:- Trigger the SDK and pass the
auth-param1value from the previous step assdkInput.
Authenticate with SCA SDKIf successful, the SDK generates a Base64-encoded
lifecycleScope.launch {
if (adyenAuthentication.hasCredential("sdkInput")) {
// Authenticate existing credential
val authenticationResult: AuthenticationResult = adyenAuthentication.authenticate("sdkInput")
when (authenticationResult) {
is AuthenticationResult.AuthenticationSuccessful -> {
authenticationResult.sdkOutput
}
is AuthenticationResult.Canceled -> {
// User cancelled the authentication flow
}
is AuthenticationResult.Error -> {
// Unexpected error
authenticationResult.errorMessage
}
is AuthenticationResult.AuthenticationError -> {
// FIDO API Error
authenticationResult.authenticationError
}
}
} else {
// None of the existing credentials exist in this device
}
}
sdkOutput data blob.Authenticate with SCA SDKThe SDK uses the Apple DeviceCheck framework to generate a Base64-encoded
delegatedAuthenticationSession.authenticate(withBase64URLString: sdkInput) { [weak self] result in
switch result {
case let .success(sdkOutput):
/// send the sdkOutput to the backend
case let .failure(error):
/// authentication failed
}
}
sdkOutput data blob. To do this, the SDK authenticates the user using Touch ID, Face ID, or the device passcode. To enable Face ID support, add NSFaceIDUsageDescription to Info.plist.Authenticate with SCA SDKIf successful, the SDK generates a Base64-encoded
const sdkOutput = await scaWebauthn.authenticate(sdkInput);
sdkOutput data blob.- Pass
sdkOutputto your server.
Get the transaction history
To finalize the request to get the transaction history:-
Make a GET /transactions request, specifying the following parameter in the request header.
Get user transaction history
Request header Description WWW-AuthenticateSCA realm: Transaction.auth-param1: Base64-encoded value of sdkOutput you get when you initiate authentication.curl
curl https://balanceplatform-api-test.adyen.com/btl/v4/transactions?balanceAccountId=BA00000000000000000000002&createdSince=2022-05-30T15:07:40Z&createdUntil=2022-05-31T15:07:40Z \ -H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \ -H 'content-type: application/json' \ -H 'WWW-Authenticate: SCA realm="Transaction" auth-param1="CeCcEEJf2UPC7pB0K7AtEgLZX7cTvnqNznJF..."' \ -X GET \ -d '{ }'Java
// Adyen Java API Library v33.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.transfers.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.transfers.*; Client client = new Client("ADYEN_BALANCE_PLATFORM_API_KEY", Environment.TEST); // Send the request TransactionsApi service = new TransactionsApi(client); TransactionSearchResponse response = service.getAllTransactions("String", "String", "String", "String", "String", LocalDateTime.parse("2025-01-01T15:00:00");, LocalDateTime.parse("2025-01-01T15:00:00");, 1, null);PHP
<?php // Adyen PHP API Library v24.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Service\Transfers\TransactionsApi; $client = new Client(); $client->setXApiKey("ADYEN_BALANCE_PLATFORM_API_KEY"); $client->setEnvironment(Environment::TEST); $requestOptions['queryParams'] = array('balancePlatform' => 'string', 'paymentInstrumentId' => 'string', 'accountHolderId' => 'string', 'balanceAccountId' => 'string', 'cursor' => 'string', 'createdSince' => 'date-time', 'createdUntil' => 'date-time', 'limit' => 'integer'); // Send the request $service = new TransactionsApi($client); $response = $service->getAllTransactions($requestOptions);C#
// Adyen .net API Library v28.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Transfers; using Adyen.Service.Transfers; var config = new Config() { XApiKey = "ADYEN_BALANCE_PLATFORM_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Send the request var service = new TransactionsService(client); var response = service.GetAllTransactions(balancePlatform: "string", paymentInstrumentId: "string", accountHolderId: "string", balanceAccountId: "string", cursor: "string", createdSince: DateTime.Parse("2025-01-01T15:00:00"), createdUntil: DateTime.Parse("2025-01-01T15:00:00"), limit: 1);NodeJS (JavaScript)
// Adyen Node API Library v23.3.0 const { Client, TransfersAPI } = require('@adyen/api-library'); const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" }); // Send the request const transfersAPI = new TransfersAPI(client); const response = transfersAPI.TransactionsApi.getAllTransactions("string", "string", "string", "string", "string", Date.now(), Date.now(), 1);Go
// Adyen Go API Library v17.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v17/src/common" "github.com/adyen/adyen-go-api-library/v17/src/adyen" "github.com/adyen/adyen-go-api-library/v17/src/transfers" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", Environment: common.TestEnv, }) // Send the request service := client.Transfers() req := service.TransactionsApi.GetAllTransactionsInput() req = req.BalancePlatform("string").PaymentInstrumentId("string").AccountHolderId("string").BalanceAccountId("string").Cursor("string").CreatedSince(DateTime.Parse("2025-01-01T15:00:00")).CreatedUntil(DateTime.Parse("2025-01-01T15:00:00")).Limit(1) res, httpRes, err := service.TransactionsApi.GetAllTransactions(context.Background(), req)Python
# Adyen Python API Library v13.3.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_BALANCE_PLATFORM_API_KEY" adyen.client.platform = "test" # The environment to use library in. query_parameters = { "balancePlatform" : "string", "paymentInstrumentId" : "string", "accountHolderId" : "string", "balanceAccountId" : "string", "cursor" : "string", "createdSince" : "date-time", "createdUntil" : "date-time", "limit" : "integer" } # Send the request result = adyen.transfers.transactions_api.get_all_transactions(query_parameters=query_parameters)Ruby
# Adyen Ruby API Library v10.1.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY' adyen.env = :test # Set to "live" for live environment # Create the request object(s) query_params = { :balancePlatform => 'string', :paymentInstrumentId => 'string', :accountHolderId => 'string', :balanceAccountId => 'string', :cursor => 'string', :createdSince => 'date-time', :createdUntil => 'date-time', :limit => 'integer' } # Send the request result = adyen.transfers.transactions_api.get_all_transactions(query_params: query_params)NodeJS (TypeScript)
// Adyen Node API Library v23.3.0 import { Client, TransfersAPI, Types } from "@adyen/api-library"; const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" }); // Send the request const transfersAPI = new TransfersAPI(client); const response = transfersAPI.TransactionsApi.getAllTransactions("string", "string", "string", "string", "string", Date.now(), Date.now(), 1); -
Use the content of the data array to present the transaction information to your user.
Response
{ "data": [ { "balancePlatform": "YOUR_BALANCE_PLATFORM", "creationDate": "2023-08-10T14:51:20+02:00", "id": "EVJN42272224222B5JB8BRC84N686ZEUR", "accountHolder": { "description": "Your description for the account holder", "id": "AH00000000000000000000001" }, "amount": { "currency": "USD", "value": -1000 }, "balanceAccount": { "description": "Your description for the account holder", "id": "BA00000000000000000000001" }, "bookingDate": "2023-08-10T14:51:33+02:00", "status": "booked", "transfer": { "id": "3JNC3O5ZVFLLGV4B", "reference": "Your internal reference for the transfer" }, "valueDate": "2023-08-10T14:51:20+02:00" }, { "balancePlatform": "YOUR_BALANCE_PLATFORM", "creationDate": "2023-08-10T15:34:31+02:00", "id": "EVJN4227C224222B5JB8G3Q89N2NB6EUR", "accountHolder": { "description": "Your description for the account holder", "id": "AH00000000000000000000001" }, "amount": { "currency": "USD", "value": 123 }, "balanceAccount": { "description": "Your description for the account holder", "id": "BA00000000000000000000001" }, "bookingDate": "2023-08-10T15:34:40+02:00", "status": "booked", "transfer": { "id": "48POO45ZVG11166J", "reference": "Your internal reference for the transfer" }, "valueDate": "2023-08-10T15:34:31+02:00" } ], "_links": { "next": { "href": "https://balanceplatform-api-test.adyen.com/btl/v4/transactions?balancePlatform=YOUR_BALANCE_PLATFORM&createdUntil=2023-08-20T13%3A07%3A40Z&createdSince=2023-08-10T10%3A50%3A40Z&cursor=S2B-c0p1N0tdN0l6RGhYK1YpM0lgOTUyMDlLXElyKE9LMCtyaFEuMj1NMHgidCsrJi1ZNnhqXCtqVi5JPGpRK1F2fCFqWzU33JTojSVNJc1J1VXhncS10QDd6JX9FQFl5Zn0uNyUvSXJNQTo" } } }