Requirements
How it works
Here is how the OAuth flow works with Adyen open banking:- In your client app, the account holder selects to give access to their payment data with Adyen.
- Your client app redirects the account holder to Adyen’s authentication interface so they can authenticate and give their consent to access their account data. Depending on the consent they give, you can check their account details, view the balance on their account, or initiate a payment.
- Adyen generates an authorization code and returns it to your client app through the redirect URL.
-
Your server uses the authorization code to get an access token. The access token is needed for two things:
- To authenticate open banking requests to Adyen for this account holder.
- To get the account holder’s consent ID, which is needed to get their account details.
-
Your server uses the access token to create a consent and get a
consentId.
consentId, you can make requests to Adyen open banking APIs to retrieve the account holder’s Adyen business account details.
Implement Adyen connect button
In your app or on your website, implement a Connect with Adyen button. This button sends a GET/bankoauth/authorize request to your server, which redirects the account holder to an Adyen dialog for authentication and consent. Use the URL from the next step to get the account holder’s consent.
Redirect account holder for authentication
To redirect the account holder so they can authenticate and give consent:-
Make a GET
/bankoauth/authorizerequest with the following query parameters: Note that this request does not require any type of authorization.By including these parameters, the authorization server can properly authenticate the account holder. Here is an example of a GET request: Get authentication instructions for the account holder - Embed the HTML code that you receive in the response into your app or website so the account holder can authenticate with their Adyen business account.
-
After the account holder has authenticated, get the
codethat is sent back to your client’sredirect_uri. You need this code in the next step, to get an access token. This redirect will include the following query parameters in the URL.An example of a redirect URL may look like this: Redirect URL with authorization code
Get an access token
To exchange the authorization code from the previous step for an access token:-
From the server, make a POST
/tokenrequest with the following parameters in the request body:Authentication type: useclient_idandclient_secretfor basic authentication. Get access token -
From the response, save the
access_tokenand therefresh_token. You need theaccess_tokenin the next step, to get aconsentId. The response contains the following fields:ResponseIf you lose the refresh token, there is no way to recover the granted access. You will need to redirect the account holder for authentication again.
Create a consent
To create a new consent use the access token to get aconsentId. This consentId is needed to get the account details for the account holder. This consent needs to be approved by the account holder to continue.
-
Make a POST
/consentsrequest with the following parameters in the request body. The request header includes theTPP-Signature-Certificate: QSEALCertificate, which is the full eIDAS certificate encoded in Base64 format.Create a new consent -
The response contains the
consentStatus,consentId, and links to requested resources. From the response, save theconsentId, you need this for the Adyen open banking requests to get the account details for this account holder. You can continue to poll the endpoint until you receive an updatedconsentStatus.- If you want to get information about consent authorization and to determine where your account holder is in the authentication flow, you will need the
authorization-id-consent. This is the last set of characters at the end of thescaStatuslink below. Save thisauthorization-id-consentto use in the get authorization information.
- If you want to get information about consent authorization and to determine where your account holder is in the authentication flow, you will need the
Refresh an access token
Because the access token is short-lived, a new access token has to be requested regularly to continue using open banking APIs. To find your original refresh token, see the response from get an access token. To refresh an access token:-
Make a POST request to the
/tokenendpoint. Provide the following parameters in the request body:Authentication type: useclient_idandclient_secretfor basic authentication. Refresh access token -
From the response, save the new
access_tokenandrefresh_token. The response contains the following fields:
Next steps
Consent interface
Required. Learn how to manage user consents with our dedicated endpoints.
AISP interface
Learn how to consume our dedicated AISP endpoints.
PISP interface
Learn how to consume our dedicated PISP endpoints.
PIISP interface
Learn how to consume our dedicated PIISP endpoints.
