- Get the device registered for a card
- Associate payment instruments to a registered device
- Deregister a device from a specific card
Requirements
Ensure that your API credential has the following role:- Bank SCA Webservice Role
Get the device registered for a card
After the device is registered, you use the API to get information about the SCA device connected to a specific card such as the device ID, the name of the device, and the type of the device. You can use this information to build user interfaces or to check the payment instrument’s devices before associating more. To get the SCA device registered for a specific card:-
Make a GET /registeredDevices request. Include the following query parameter:
The following example shows a GET /registeredDevices request for the
Query parameter Required Description paymentInstrumentId 
Limits the returned list to SCA devices registered for this card. paymentInstrumentIdPI00000000000000000000001. Example GET /registeredDevices requestcurl
curl --request GET 'https://balanceplatform-api-test.adyen.com/bcl/v2/registeredDevices?paymentInstrumentId=PI00000000000000000000001' \ --header 'X-API-Key:ADYEN_BALANCE_PLATFORM_API_KEY'Java
// Adyen Java API Library v33.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.balanceplatform.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.balancePlatform.*; Client client = new Client("", Environment.TEST); // Create the request object(s) RegisterSCARequest registerSCARequest = new RegisterSCARequest(); // Send the request ManageScaDevicesApi service = new ManageScaDevicesApi(client); RegisterSCAResponse response = service.initiateRegistrationOfScaDevice(registerSCARequest, null);PHP
<?php // Adyen PHP API Library v24.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\BalancePlatform\RegisterSCARequest; use Adyen\Service\BalancePlatform\ManageScaDevicesApi; $client = new Client(); $client->setXApiKey(""); $client->setEnvironment(Environment::TEST); // Create the request object(s) $registerSCARequest = new RegisterSCARequest(); $registerSCARequest; // Send the request $service = new ManageScaDevicesApi($client); $response = $service->initiateRegistrationOfScaDevice($registerSCARequest);C#
// Adyen .net API Library v28.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.BalancePlatform; using Adyen.Service.BalancePlatform; var config = new Config() { XApiKey = "", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) RegisterSCARequest registerSCARequest = new RegisterSCARequest }; // Send the request var service = new ManageScaDevicesService(client); var response = service.InitiateRegistrationOfScaDevice(registerSCARequest);NodeJS (JavaScript)
// Adyen Node API Library v23.3.0 const { Client, BalancePlatformAPI } = require('@adyen/api-library'); const client = new Client({ apiKey: "", environment: "TEST" }); // Create the request object(s) const registerSCARequest = { } // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = balancePlatformAPI.ManageScaDevicesApi.initiateRegistrationOfScaDevice(registerSCARequest);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/balancePlatform" ) client := adyen.NewClient(&common.Config{ ApiKey: "", Environment: common.TestEnv, }) // Create the request object(s) registerSCARequest := balancePlatform.RegisterSCARequest, } // Send the request service := client.BalancePlatform() req := service.ManageScaDevicesApi.InitiateRegistrationOfScaDeviceInput().RegisterSCARequest(registerSCARequest) res, httpRes, err := service.ManageScaDevicesApi.InitiateRegistrationOfScaDevice(context.Background(), req)Python
# Adyen Python API Library v13.3.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "" adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { } # Send the request result = adyen.balancePlatform.manage_sca_devices_api.initiate_registration_of_sca_device(request=json_request)Ruby
# Adyen Ruby API Library v10.1.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = '' adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { } # Send the request result = adyen.balancePlatform.manage_sca_devices_api.initiate_registration_of_sca_device(request_body)NodeJS (TypeScript)
// Adyen Node API Library v23.3.0 import { Client, BalancePlatformAPI, Types } from "@adyen/api-library"; const client = new Client({ apiKey: "", environment: "TEST" }); // Create the request object(s) const registerSCARequest: Types.balancePlatform.RegisterSCARequest = }; // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = balancePlatformAPI.ManageScaDevicesApi.initiateRegistrationOfScaDevice(registerSCARequest); -
In the response, note the following parameters:
Example GET /registeredDevices response
Response parameter Description data Contains data about the device registered for SCA. data.id The unique identifier of the registered SCA device. data.name The name of the SCA device. You can show this name to your user to help them identify the device. data.paymentInstrumentId The unique identifier of the card for which the SCA device is registered. data.type ios, android { "data": [ { "id": "BSDR00000000000000000000000001", "name": "android_1709902088787", "paymentInstrumentId": "PI00000000000000000000001", "type": "android" } ], "itemsTotal": 1, "link": { "first": { "href": "https://balanceplatform-api-test.adyen.com/bcl/v2/registeredDevices?pageNumber=0&paymentInstrumentId=PI00000000000000000000001" }, "last": { "href": "https://balanceplatform-api-test.adyen.com/bcl/v2/registeredDevices?pageNumber=0&paymentInstrumentId=PI00000000000000000000001" }, "self": { "href": "https://balanceplatform-api-test.adyen.com/bcl/v2/registeredDevices?pageNumber=0&paymentInstrumentId=PI00000000000000000000001" } }, "pagesTotal": 1 }
Associate cards to a registered device
After you register a device, you can connect additional payment instruments to the device using the Configuration API. This enables a single device to handle authentication for multiple payment instruments. You can associate up to five payment instruments to a device per /registeredDevices/{deviceId}/associations API request. Each payment instrument can only be linked to one device. To add payment instruments to a registered device:-
From your server, initiate the association by making a POST /registeredDevices/{deviceId}/associations request with the user’s device ID as a path parameter. In the request body, specify up to five payment instrument IDs in the ids array.
Initiate the association
curl
curl https://balanceplatform-api-test.adyen.com/bcl/v2/registeredDevices/{deviceId}/associations \ -H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "ids": [ "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005" ], "type": "PaymentInstrument" }'Java
// Adyen Java API Library v35.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.balanceplatform.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.balancePlatform.*; Client client = new Client("ADYEN_BALANCE_PLATFORM_API_KEY", Environment.TEST); // Create the request object(s) AssociationInitiateRequest associationInitiateRequest = new AssociationInitiateRequest() .ids(Arrays.asList("PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005")) .type(AssociationInitiateRequest.TypeEnum.PAYMENTINSTRUMENT); // Send the request ManageScaDevicesApi service = new ManageScaDevicesApi(client); AssociationInitiateResponse response = service.initiateAssociationBetweenScaDeviceAndResource("deviceId", associationInitiateRequest, null);PHP
<?php // Adyen PHP API Library v27.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\BalancePlatform\AssociationInitiateRequest; use Adyen\Service\BalancePlatform\ManageScaDevicesApi; $client = new Client(); $client->setXApiKey("ADYEN_BALANCE_PLATFORM_API_KEY"); $client->setEnvironment(Environment::TEST); // Create the request object(s) $associationInitiateRequest = new AssociationInitiateRequest(); $associationInitiateRequest ->setIds(array("PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005")) ->setType("PaymentInstrument"); // Send the request $service = new ManageScaDevicesApi($client); $response = $service->initiateAssociationBetweenScaDeviceAndResource('deviceId', $associationInitiateRequest);C#
// Adyen .net API Library v31.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.BalancePlatform; using Adyen.Service.BalancePlatform; var config = new Config() { XApiKey = "ADYEN_BALANCE_PLATFORM_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) AssociationInitiateRequest associationInitiateRequest = new AssociationInitiateRequest { Ids = { "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005" }, Type = AssociationInitiateRequest.TypeEnum.PaymentInstrument }; // Send the request var service = new ManageScaDevicesService(client); var response = service.InitiateAssociationBetweenScaDeviceAndResource("deviceId", associationInitiateRequest);NodeJS (JavaScript)
// Adyen Node API Library v26.0.0 const { Client, BalancePlatformAPI } = require('@adyen/api-library'); const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" }); // Create the request object(s) const associationInitiateRequest = { ids: [ "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005" ], type: "PaymentInstrument" } // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = balancePlatformAPI.ManageScaDevicesApi.initiateAssociationBetweenScaDeviceAndResource("deviceId", associationInitiateRequest);Go
// Adyen Go API Library v20.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v20/src/common" "github.com/adyen/adyen-go-api-library/v20/src/adyen" "github.com/adyen/adyen-go-api-library/v20/src/balancePlatform" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) associationInitiateRequest := balancePlatform.AssociationInitiateRequest{ Ids: []string{ "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005", }, Type: "PaymentInstrument", } // Send the request service := client.BalancePlatform() req := service.ManageScaDevicesApi.InitiateAssociationBetweenScaDeviceAndResourceInput("deviceId").AssociationInitiateRequest(associationInitiateRequest) res, httpRes, err := service.ManageScaDevicesApi.InitiateAssociationBetweenScaDeviceAndResource(context.Background(), req)Python
# Adyen Python API Library v13.4.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_BALANCE_PLATFORM_API_KEY" adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "ids": [ "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005" ], "type": "PaymentInstrument" } # Send the request result = adyen.balancePlatform.manage_sca_devices_api.initiate_association_between_sca_device_and_resource(request=json_request, deviceId="deviceId")Ruby
# Adyen Ruby API Library v10.2.0 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) request_body = { :ids => [ 'PI00000000000000000000001', 'PI00000000000000000000002', 'PI00000000000000000000003', 'PI00000000000000000000004', 'PI00000000000000000000005' ], :type => 'PaymentInstrument' } # Send the request result = adyen.balancePlatform.manage_sca_devices_api.initiate_association_between_sca_device_and_resource(request_body, 'deviceId')NodeJS (TypeScript)
The response contains a Base64-encoded string, which our Authentication SDKs uses to authenticate the requested association. You do not need to decode or validate this string. POST /association response// Adyen Node API Library v26.0.0 import { Client, BalancePlatformAPI, Types } from "@adyen/api-library"; const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" }); // Create the request object(s) const associationInitiateRequest: Types.balancePlatform.AssociationInitiateRequest = { ids: ["PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005"], type: Types.balancePlatform.AssociationInitiateRequest.TypeEnum.PaymentInstrument }; // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = balancePlatformAPI.ManageScaDevicesApi.initiateAssociationBetweenScaDeviceAndResource("deviceId", associationInitiateRequest);{ "sdkInput": "eyJtZXNzYWdlIjogIkFuIGV4YW1wbGUgZW5jb2RlZCBtZXNzYWdlLiBUaGlzIGlzIHdoYXQgeW91IG1pZ2h0IGdldCBvdXQgb2YgdGhlIGF1dGhlbnRpY2F0aW9uIFNESy4gSG93ZXZlciwgeW91IHdvdWxkIG5vdCBuZWVkIHRvIGRlY29kZSBpdCAtLSBqdXN0IGtlZXAgaXQgZW5jb2RlZCwgb2theT8ifQ==" } -
Pass the resulting
sdkInputto your client. -
On your client, initialize the SDK and call the
authenticate()method using thesdkInputfrom your server as an argument. Theauthenticate()method prompts the user to respond to a challenge, for example, Touch ID, Face ID, or the device password.
- Android (Kotlin)
- iOS (Swift)
- Web (JavaScript)
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.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.import ScaWebauthn from '@adyen/bpscaweb';
// Initialize the scaWebauthn instance
const scaWebauthn = ScaWebauthn.create({
relyingPartyName: 'YOUR_MERCHANT_NAME',
});
// Launch the authentication flow
const authenticationResult = await scaWebauthn.authenticate(sdkInput)
.catch((error) => {
// Example: NotAllowedError: The operation either timed out or was not allowed.
// See https://webidl.spec.whatwg.org/#idl-DOMException-error-names for possible webauthn errors.
});
authenticate() function returns a Base64-encoded string that contains data about the user authentication and challenge. You can check that the authentication result is not empty to verify that the authentication was successful. You do not need to decode or validate this string.Authentication resultconsole.log(authenticationResult)
// eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0=
- Pass the authentication result to your server.
-
On your server, finalize the association by making a PATCH /registeredDevices/{deviceId}/associations request using the device ID as a path parameter. In the request body, specify the following:
Finalize the assocation
Parameter Required Description ids 
An array of the payment instrument IDs that you want to associate. These IDs must be the same that you sent in the POST request in step 1. strongCustomerAuthentication.sdkOutput 
The data returned from the client-side authenticate()method.type 
The type of resource that you are associating with the SCA device. Possible value: PaymentInstrument curl
curl https://balanceplatform-api-test.adyen.com/bcl/v2/registeredDevices/{deviceId}/associations \ -H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \ -H 'content-type: application/json' \ -X PATCH \ -d '{ "ids": [ "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005" ], "strongCustomerAuthentication": { "sdkOutput": "eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0=" }, "type": "PaymentInstrument" }'Java
// Adyen Java API Library v35.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.balanceplatform.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.balancePlatform.*; Client client = new Client("ADYEN_BALANCE_PLATFORM_API_KEY", Environment.TEST); // Create the request object(s) AssociationDelegatedAuthenticationData associationDelegatedAuthenticationData = new AssociationDelegatedAuthenticationData() .sdkOutput("eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0="); AssociationFinaliseRequest associationFinaliseRequest = new AssociationFinaliseRequest() .strongCustomerAuthentication(associationDelegatedAuthenticationData) .ids(Arrays.asList("PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005")) .type(AssociationFinaliseRequest.TypeEnum.PAYMENTINSTRUMENT); // Send the request ManageScaDevicesApi service = new ManageScaDevicesApi(client); AssociationFinaliseResponse response = service.completeAssociationBetweenScaDeviceAndResource("deviceId", associationFinaliseRequest, null);PHP
<?php // Adyen PHP API Library v27.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\BalancePlatform\AssociationDelegatedAuthenticationData; use Adyen\Model\BalancePlatform\AssociationFinaliseRequest; use Adyen\Service\BalancePlatform\ManageScaDevicesApi; $client = new Client(); $client->setXApiKey("ADYEN_BALANCE_PLATFORM_API_KEY"); $client->setEnvironment(Environment::TEST); // Create the request object(s) $associationDelegatedAuthenticationData = new AssociationDelegatedAuthenticationData(); $associationDelegatedAuthenticationData ->setSdkOutput("eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0="); $associationFinaliseRequest = new AssociationFinaliseRequest(); $associationFinaliseRequest ->setStrongCustomerAuthentication($associationDelegatedAuthenticationData) ->setIds(array("PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005")) ->setType("PaymentInstrument"); // Send the request $service = new ManageScaDevicesApi($client); $response = $service->completeAssociationBetweenScaDeviceAndResource('deviceId', $associationFinaliseRequest);C#
// Adyen .net API Library v31.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.BalancePlatform; using Adyen.Service.BalancePlatform; var config = new Config() { XApiKey = "ADYEN_BALANCE_PLATFORM_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) AssociationDelegatedAuthenticationData associationDelegatedAuthenticationData = new AssociationDelegatedAuthenticationData { SdkOutput = "eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0=" }; AssociationFinaliseRequest associationFinaliseRequest = new AssociationFinaliseRequest { StrongCustomerAuthentication = associationDelegatedAuthenticationData, Ids = { "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005" }, Type = AssociationFinaliseRequest.TypeEnum.PaymentInstrument }; // Send the request var service = new ManageScaDevicesService(client); var response = service.CompleteAssociationBetweenScaDeviceAndResource("deviceId", associationFinaliseRequest);NodeJS (JavaScript)
// Adyen Node API Library v26.0.0 const { Client, BalancePlatformAPI } = require('@adyen/api-library'); const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" }); // Create the request object(s) const associationFinaliseRequest = { ids: [ "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005" ], strongCustomerAuthentication: { sdkOutput: "eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0=" }, type: "PaymentInstrument" } // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = balancePlatformAPI.ManageScaDevicesApi.completeAssociationBetweenScaDeviceAndResource("deviceId", associationFinaliseRequest);Go
// Adyen Go API Library v20.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v20/src/common" "github.com/adyen/adyen-go-api-library/v20/src/adyen" "github.com/adyen/adyen-go-api-library/v20/src/balancePlatform" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) associationDelegatedAuthenticationData := balancePlatform.AssociationDelegatedAuthenticationData{ SdkOutput: "eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0=", } associationFinaliseRequest := balancePlatform.AssociationFinaliseRequest{ StrongCustomerAuthentication: associationDelegatedAuthenticationData, Ids: []string{ "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005", }, Type: "PaymentInstrument", } // Send the request service := client.BalancePlatform() req := service.ManageScaDevicesApi.CompleteAssociationBetweenScaDeviceAndResourceInput("deviceId").AssociationFinaliseRequest(associationFinaliseRequest) res, httpRes, err := service.ManageScaDevicesApi.CompleteAssociationBetweenScaDeviceAndResource(context.Background(), req)Python
# Adyen Python API Library v13.4.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_BALANCE_PLATFORM_API_KEY" adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "ids": [ "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005" ], "strongCustomerAuthentication": { "sdkOutput": "eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0=" }, "type": "PaymentInstrument" } # Send the request result = adyen.balancePlatform.manage_sca_devices_api.complete_association_between_sca_device_and_resource(request=json_request, deviceId="deviceId")Ruby
# Adyen Ruby API Library v10.2.0 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) request_body = { :ids => [ 'PI00000000000000000000001', 'PI00000000000000000000002', 'PI00000000000000000000003', 'PI00000000000000000000004', 'PI00000000000000000000005' ], :strongCustomerAuthentication => { :sdkOutput => 'eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0=' }, :type => 'PaymentInstrument' } # Send the request result = adyen.balancePlatform.manage_sca_devices_api.complete_association_between_sca_device_and_resource(request_body, 'deviceId')NodeJS (TypeScript)
If the association is successful, the API responds with a list of payment instrument IDs. To verify the association, get a list of registered devices for each of the payment instruments. PATCH /association response// Adyen Node API Library v26.0.0 import { Client, BalancePlatformAPI, Types } from "@adyen/api-library"; const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" }); // Create the request object(s) const associationDelegatedAuthenticationData: Types.balancePlatform.AssociationDelegatedAuthenticationData = { sdkOutput: "eyJtZXNzYWdlIjogIlRoaXMgaXMgd2hhdCB5b3UgbWlnaHQgZ2V0IGFzIGEgcmVzdWx0IGZvciB0aGUgYXV0aGVudGljYXRlKCkgbWV0aG9kLiBJdCB3aWxsIGhhdmUgbG90cyBvZiBkaWZmZXJlbnQgaW5mb3JtYWl0b24gaW4gaXQsIGJ1dCB0aGVyZSBpcyBubyByZWFzb24gZm9yIHlvdSB0byBkZWNvZGUgaXQgb3IgaW5zcGVjdCBpdC4gV2Ugd2lsbCBoYW5kbGUgdGhhdCBmb3IgeW91ISBTbywgZmVlbCBmcmVlIHRvIGRlY29kZSBpdC4gSG93ZXZlciwgZG8gbm90IHJlLWVuY29kZSBpdCBhbmQgZXhwZWN0IHRoZSBzYW1lIHJlc3VsdC4gVGhlIFNESyBlbmNvZGVzIHRoZSBibG9iIGluIGEgc3BlY2lmaWMgd2F5LCBhbmQgaWYgeW91IGRlY29kZSBpdCBhbmQgcmUtZW5jb2RlIGl0LCB5b3UgbWlnaHQgaW50cm9kdWNlIHByb2JsZW1zLiBTbywganVzdCBsZWF2ZSBpdCBlbmNvZGVkIG9rYXk/In0=" }; const associationFinaliseRequest: Types.balancePlatform.AssociationFinaliseRequest = { strongCustomerAuthentication: associationDelegatedAuthenticationData, ids: ["PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005"], type: Types.balancePlatform.AssociationFinaliseRequest.TypeEnum.PaymentInstrument }; // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = balancePlatformAPI.ManageScaDevicesApi.completeAssociationBetweenScaDeviceAndResource("deviceId", associationFinaliseRequest);{ "deviceId":"BSDR4294N223223N5M6J9T2BP46HVK", "type":"PaymentInstrument", "ids":[ "PI00000000000000000000001", "PI00000000000000000000002", "PI00000000000000000000003", "PI00000000000000000000004", "PI00000000000000000000005" ] }
Troubleshooting device association
The following examples show some common issues you may encounter during the association process.**Device limit reached
POST /associations response{
"type": "https://docs.adyen.com/errors/unprocessable-entity",
"errorCode": "00_422",
"title": "Unprocessable entity",
"detail": "Device limit reached, please delete a device and try again",
"requestId": "5ffa18b720392054047e8b33cc271d98",
"status": 422
}
Solution
To avoid this error, all payment instrument IDs passed in the POST /registeredDevices/{deviceId}/associations call need to be deregistered.- Get a list of registered devices.
- If the payment instrument has a device in its
dataarray, deregister the device.
Challenge not found
PATCH /associations response{
"type": "https://docs.adyen.com/errors/unprocessable-entity",
"errorCode": "00_422",
"title": "Unprocessable entity",
"detail": "Challenge not found",
"requestId": "de2c4f16b79a883ad1989122bad98d15",
"status": 422
}
sdkOuput that is specific to the client device. If you send an sdkOutput that does not correspond to the device that you want to associate, then you get a “Challenge not found” error.Solution
Ensure that the device ID used in the initial POST /registeredDevices/{deviceId}/associations request matches the one used in the PATCH /registeredDevices/{deviceId}/associations request. As long as the IDs match between the POST and the PATCH, the “Challenge not found” error will be prevented.**NotAllowedError: The operation either timed out or was not allowed.
The client-sideauthenticate() method failed because the user canceled the challenge. This is similar to other client-side errors that can occur. These are standard errors for WebAuthn. Go to Web IDL standard for a list of possible exception error names.Solution
To avoid this error, tell your user before the authentication process begins that they are about to be asked to authenticate.To handle this error, return the user to the previous step and ask them to retry. You can reuse the samesdkInput when you retry authenticate() in the same session.Deregister a device from a card
You can deregister an SCA device from a card by making a DELETE /registeredDevices/{id} request. You can do this when, for example:- Your user will no longer use a registered device.
- A registered device has been compromised.
- Get the ID of the device that you want to deregister.
-
Make a DELETE /registeredDevices/{id} request and include the following parameters:
The following example shows a request to deregister an SCA device with
Parameter Type Required Description id Path 
The unique identifier of the SCA device that you want to deregister. paymentInstrumentId Query 
The unique identifier of the card from which you want to deregister the device. idBSDR00000000000000000000000001 from thepaymentInstrumentIdPI00000000000000000000001. Example DELETE /registeredDevices/{id} requestcurl
curl --request DELETE 'https://balanceplatform-api-test.adyen.com/bcl/v2/registeredDevices/BSDR00000000000000000000000001?paymentInstrumentId=PI00000000000000000000001' \ --header 'X-API-Key;'Java
// Adyen Java API Library v26.2.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.service.balancePlatform.*; Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Send the request ManageScaDevicesApi service = new ManageScaDevicesApi(client); service.deleteRegistrationOfScaDevice("id", "String", null);PHP
// Adyen PHP API Library v18.2.0 use Adyen\Client; use Adyen\Environment; use Adyen\Service\BalancePlatform\ManageScaDevicesApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); $client->setEnvironment(Environment::TEST); $requestOptions['queryParams'] = array('paymentInstrumentId' => 'string'); // Send the request $service = new ManageScaDevicesApi($client); $service->deleteRegistrationOfScaDevice('id', $requestOptions);C#
// Adyen .net API Library v16.1.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Service.BalancePlatform; var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Send the request var service = new ManageScaDevicesService(client); service.DeleteRegistrationOfScaDevice("id", paymentInstrumentId: "string");NodeJS (JavaScript)
// Adyen Node API Library v17.2.0 // Require the parts of the module you want to use const { Client, BalancePlatformAPI } = require('@adyen/api-library'); // Initialize the client object const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); balancePlatformAPI.ManageScaDevicesApi.deleteRegistrationOfScaDevice("id", "string");Go
// Adyen Go API Library v10.2.0 import ( "context" "github.com/adyen/adyen-go-api-library/v9/src/common" "github.com/adyen/adyen-go-api-library/v9/src/adyen" "github.com/adyen/adyen-go-api-library/v9/src/balancePlatform" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Send the request service := client.BalancePlatform() req := service.ManageScaDevicesApi.DeleteRegistrationOfScaDeviceInput("id") req = req.PaymentInstrumentId("string") service.ManageScaDevicesApi.DeleteRegistrationOfScaDevice(context.Background(), req)Python
# Adyen Python API Library v12.5.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" adyen.client.platform = "test" # The environment to use library in. query_parameters = { "paymentInstrumentId" : "string" } # Send the request adyen.balancePlatform.manage_sca_devices_api.delete_registration_of_sca_device(id="id", query_parameters=query_parameters)Ruby
# Adyen Ruby API Library v9.5.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' adyen.env = :test # Set to "live" for live environment # Create the request object(s) query_params = { :paymentInstrumentId => 'string' } # Send the request adyen.balancePlatform.manage_sca_devices_api.delete_registration_of_sca_device('id', query_params: query_params)NodeJS (TypeScript)
// Adyen Node API Library v17.2.0 // Require the parts of the module you want to use import { Client, BalancePlatformAPI, Types } from "@adyen/api-library"; // Initialize the client object const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); balancePlatformAPI.ManageScaDevicesApi.deleteRegistrationOfScaDevice("id", "string"); - Verify that you receive a 204 HTTP response with no content. This indicates that the request succeeded.