Your users must accept Adyen's Terms of Service before they can perform particular actions in your platform. If you build your own UI to collect data to onboard your users, you must generate a Terms of Service document, show the document to your users, and ask them to accept it. If you are using hosted onboarding, your user will complete this step as part of the onboarding process.
The Terms of Service document must be accepted by an individual legal entity that represents a physical person. The document can be accepted on behalf of the legal entity of the individual person or the legal entity of the organization. For example:
- A cardholder accepts the document on their own behalf.
- The owner of a restaurant accepts the document on behalf of the legal entity that represents the business.
Before you begin
Make sure that you have API credentials for the Legal Entity Management API and that you have created legal entities for:
- The user that has a contractual relationship with your platform.
- The individual legal entity who will accept the document.
Step 1: Confirm Terms of Service requirements
When you create an account holder, certain capabilities are requested for them. To check whether your user must accept the Terms of Service, listen to balancePlatform.accountHolder.updated webhooks.
If your user is required to accept Adyen's Terms of Service, it is indicated in the verificationErrors
array.
{
"data":{
"accountHolder":{
"capabilities":{
"sendToTransferInstrument":{
"allowed":"false",
"enabled":"true",
"problems":[
{
"entity":{
"id":"LE00000000000000000000001",
"type":"LegalEntity"
},
"verificationErrors":[
{
"code":"2_902",
"message":"Terms Of Service forms are not accepted.",
"remediatingActions":[
{
"code":"2_902",
"message":"Accept TOS"
}
],
"type":"invalidInput"
}
]
}
],
"requested":"true",
"verificationStatus":"invalid"
}
},
"description":"Test Account holder",
"reference":"YOUR_INTERNAL_IDENTIFIER",
"id":"AH00000000000000000000001",
"legalEntityId":"LE00000000000000000000001",
"status":"Active"
},
"balancePlatform":"YOUR_BALANCE_PLATFORM"
},
"environment":"test",
"type":"balancePlatform.accountHolder.updated"
}
Step 2: Generate the Terms of Service document
To generate the Terms of Service document, make a POST /legalEntities/{id}/termsOfService request, specifying the id of the main legal entity in the path.
Parameter | Required | Description |
---|---|---|
type | ![]() |
The type of document based on the services and capabilities requested by the user and your platform integration. |
language | ![]() |
The language used for the Terms of Service document, specified by the two letter ISO 639-1 language code. For example, nl for Dutch. |
The response returns the following information:
Parameter | Description |
---|---|
document | The generated document in the Base64-encoded format. |
id | The unique identifier of the organization legal entity. |
language | The language of the document. |
type | The type of document based on the services and capabilities requested by the user and your platform integration. |
termsOfServiceDocumentId | The unique identifier of the document. |
The response returns the document and its unique termsOfServiceDocumentId.
Your user may need to accept more than one Terms of Service document depending on your integration. In this case, every required document and termsOfServiceDocumentId is returned in the response.
You will need to present the document to your user in the next step. Use the document ID when you confirm your user has accepted the Terms of Service.
Step 3: Present the Terms of Service document to your user
You need to ask your user to review and accept the Terms of Service document. To present the document to your user, you can use the Adyen Document Viewer to render the document in your website.
Before passing the document to the Adyen Document Viewer, you need to decode it.
const documentViewer = new AdyenDocumentViewer('#test');
const document = JSON.parse(decodeURIComponent(escape(window.atob(termsOfServiceDocumentResponse.document))));
documentViewer.render(document);
Install the Adyen Document Viewer package:
npm install @adyen/adyen-document-viewer --save
Import the Adyen Document Viewer Node package into your application. You can add your own styling by overriding the rules in the CSS file.
import AdyenDocumentViewer from '@adyen/adyen-document-viewer';
import '@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css';
Step 4: Accept the Terms of Service
To confirm that your user has accepted the Terms of Service, make a PATCH /legalEntities/{id}/termsOfService/termsOfService/termsOfServicedocumentid request, specifying the id of the main legal entity and the termsOfServiceDocumentId of the document in the path.
In the body of the request, specify the following:
Parameter | Required | Description |
---|---|---|
acceptedBy | ![]() |
The id of the user accepting the Terms of Service. |
ipAddress | The IP address of the user. |
This request populates the document with the data for the main legal entity and the individual legal entity ID of the user who accepted the document.
curl https://kyc-test.adyen.com/lem/v3/legalEntities/LE00000000000000000000001/termsOfService/abc123 \
-H 'x-api-key: YOUR_SCOPE_COMPANY_API_KEY' \
-H 'content-type: application/json' \
-X PATCH \
-d '{
"acceptedBy" : "LE00000000000000000000002",
"ipAddress" : "127.0.0.1"
}'
The response returns the following information.
Parameter | Description |
---|---|
acceptedBy | The id of the individual who accepted the terms of service. |
id | The unique identifier of the accepted document. |
ipAddress | The IP address of the user. Only if provided in the request. |
language | The language of the document. |
termsOfServiceDocumentId | The unique identifier of the document. |
type | The type of document based on the services and capabilities requested by the user and your platform integration. |
Step 5 (Optional): Get the Terms of Service information for a legal entity
To see the Terms of Service information for a legal entity, make a GET /legalEntities/{id}/termsOfServiceAcceptanceInfos request with the id of the main legal entity in the path.
The response returns information about the Terms of Service document linked to the legal entity.
Parameter | Description |
---|---|
createdAt | The date the document was created. |
id | The unique identifier of the accepted document. |
acceptedBy | The id of the individual who accepted the terms of service. |
acceptedFor | The id of the main legal entity. |
type | The type of document based on the services and capabilities requested by the user and your platform integration. |