---
title: "Terms of Service"
description: "Get your users to accept Adyen's Terms of Service"
url: "https://docs.adyen.com/marketplaces/onboard-users/terms-of-service"
source_url: "https://docs.adyen.com/marketplaces/onboard-users/terms-of-service.md"
canonical: "https://docs.adyen.com/marketplaces/onboard-users/terms-of-service"
last_modified: "2026-05-07T17:20:51+02:00"
language: "en"
---

# Terms of Service

Get your users to accept Adyen's Terms of Service

Your users must accept Adyen's Terms of Service before they can perform particular actions in your marketplace. 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](/marketplaces/onboard-users#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](/marketplaces/verification-requirements#legal-entity-type) that represents a physical person. For organizations, the document must be accepted by an authorized signatory 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.

## Requirements

Before you begin, take into account the following requirements and preparations.

| Requirement          | Description                                                                                                                                                                                                                                       |   |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| **Integration type** | You must have an Adyen for Platforms integration.                                                                                                                                                                                                 |   |
| **API credentials**  | You must have API credentials for the [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/latest/overview) (for example, **ws\[123456]@Scope.Company\[YourCompanyAccount]**)                                            |   |
| **Webhooks**         | Ensure that your server can receive and accept [standard webhooks](/development-resources/webhooks). Subscribe to the following webhooks:- [Configuration webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/latest/overview) |   |
| **Setup steps**      | Before you begin, make sure:- Make sure you created legal entities for:

  * The user that has a contractual relationship with your marketplace.
  * The individual legal entity who will accept the document.                                    |   |

## How it works

To generate the Terms of Service and have them accepted by your users, follow these steps:

1. Listen to the webhook to [confirm Terms of Service requirements](#get-updates).
2. Make an API request to [get the types of Terms of Service required](#get-required).
3. Make an API request to [generate the Terms of Service documents](#get-document).
4. [Present the Terms of Service document](#present-document) to your user.
5. Make an API request to [confirm that your user has accepted the Terms of Service](#accept-tos).
6. Optionally, make an API request to [see the Terms of Service information for a specific legal entity](#tos-for-le).

## 1. Confirm Terms of Service requirements

When you create an account holder, certain [capabilities](/marketplaces/verification-overview/capabilities) are requested for them. To check whether your user must accept the Terms of Service, listen to [balancePlatform.accountHolder.updated](https://docs.adyen.com/api-explorer/#/balanceplatform-webhooks/latest/post/balancePlatform.accountHolder.updated) webhooks.

If your user is required to accept Adyen's Terms of Service, it is indicated in the `verificationErrors` array.

**balancePlatform.accountHolder.updated webhook - with verification errors array**

```json
{
   "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"
}
```

## 2. Get the types of Terms of Service required

If your user is required to accept Adyen's Terms of Service, you must determine which types of documents they need to accept. Make a GET [/legalEntities/{id}/termsOfServiceStatus](https://docs.adyen.com/api-explorer/legalentity/latest/get/legalEntities/\(id\)/termsOfServiceStatus) request, specifying the [id](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) of the main legal entity in the path. For sole proprietorships, this is the individual legal entity ID of the owner.

Note that your user may need to accept more than one Terms of Service document.

In your test environment, only the document type `adyenForPlatformsAdvanced` is returned regardless of your actual integration. This is since all accounts use the same default configuration. In your live environment, the actual Terms of Service document types are returned.

**Response**

```json
{
    "termsOfServiceTypes": [
        "adyenForPlatformsAdvanced"
    ]
}
```

## 3. Generate the Terms of Service documents

To generate the Terms of Service documents, make a POST [/legalEntities/{id}/termsOfService](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService) request, specifying the [id](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) of the main legal entity in the path. For sole proprietorships, this is the individual legal entity ID of the owner.

| Parameter                                                                                                                                                            | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                   |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [type](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#request-type)                                                 | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The type of document based on the services and capabilities requested by the user and your platform integration.                                                                                                                                                                                                                                                              |
| [language](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#request-language)                                         | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The language used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English or **fr** for French. Note that French is only available for some integration types in certain countries/regions. Reach out to your Adyen contact for more information. |
| [termsOfServiceDocumentFormat](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#request-termsOfServiceDocumentFormat) |                                                                                             | The requested format for the Terms of Service document. Default value: **JSON**. Possible values: **JSON**, **PDF**, or **TXT**.                                                                                                                                                                                                                                              |

**Generate the Terms of Service document**

#### curl

```bash
curl https://kyc-test.adyen.com/lem/v3/legalEntities/LE00000000000000000000001/termsOfService \
-H 'x-api-key: ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY' \
-d '{
   "type": "adyenForPlatformsAdvanced",
   "language": "en"
}'
```

#### Java

```java
// Adyen Java API Library v33.0.0
import com.adyen.Client;
import com.adyen.enums.Environment;
import com.adyen.model.legalentitymanagement.*;
import java.time.OffsetDateTime;
import java.util.*;
import com.adyen.service.legalEntityManagement.*;

Client client = new Client("ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY", Environment.TEST);

// Create the request object(s)
GetTermsOfServiceDocumentRequest getTermsOfServiceDocumentRequest = new GetTermsOfServiceDocumentRequest()
  .language("en")
  .type(GetTermsOfServiceDocumentRequest.TypeEnum.ADYENFORPLATFORMSADVANCED);

// Send the request
TermsOfServiceApi service = new TermsOfServiceApi(client);
GetTermsOfServiceDocumentResponse response = service.getTermsOfServiceDocument("id", getTermsOfServiceDocumentRequest, null);
```

#### PHP

```php
<?php
// Adyen PHP API Library v24.0.0
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\LegalEntityManagement\GetTermsOfServiceDocumentRequest;
use Adyen\Service\LegalEntityManagement\TermsOfServiceApi;

$client = new Client();
$client->setXApiKey("ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY");
$client->setEnvironment(Environment::TEST);


// Create the request object(s)
$getTermsOfServiceDocumentRequest = new GetTermsOfServiceDocumentRequest();
$getTermsOfServiceDocumentRequest
  ->setLanguage("en")
  ->setType("adyenForPlatformsAdvanced");

// Send the request
$service = new TermsOfServiceApi($client);
$response = $service->getTermsOfServiceDocument('id', $getTermsOfServiceDocumentRequest);
```

#### C\#

```cs
// Adyen .net API Library v28.0.0
using Adyen;
using Environment = Adyen.Model.Environment;
using Adyen.Model;
using Adyen.Model.LegalEntityManagement;
using Adyen.Service.LegalEntityManagement;

var config = new Config()
{
    XApiKey = "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY",
    Environment = Environment.Test
};
var client = new Client(config);

// Create the request object(s)
GetTermsOfServiceDocumentRequest getTermsOfServiceDocumentRequest = new GetTermsOfServiceDocumentRequest
{
  Language = "en",
  Type = GetTermsOfServiceDocumentRequest.TypeEnum.AdyenForPlatformsAdvanced
};

// Send the request
var service = new TermsOfServiceService(client);
var response = service.GetTermsOfServiceDocument("id", getTermsOfServiceDocumentRequest);
```

#### NodeJS (JavaScript)

```js
// Adyen Node API Library v23.3.0
const { Client, LegalEntityManagementAPI } = require('@adyen/api-library');

const client = new Client({ apiKey: "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY", environment: "TEST" });

// Create the request object(s)
const getTermsOfServiceDocumentRequest = {
  type: "adyenForPlatformsAdvanced",
  language: "en"
}

// Send the request
const legalEntityManagementAPI = new LegalEntityManagementAPI(client);
const response = legalEntityManagementAPI.TermsOfServiceApi.getTermsOfServiceDocument("id", getTermsOfServiceDocumentRequest);
```

#### Go

```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/legalEntityManagement"
)
client := adyen.NewClient(&common.Config{
  ApiKey:      "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY",
  Environment: common.TestEnv,
})

// Create the request object(s)
getTermsOfServiceDocumentRequest := legalEntityManagement.GetTermsOfServiceDocumentRequest{
  Language: "en",
  Type: "adyenForPlatformsAdvanced",
}

// Send the request
service := client.LegalEntityManagement()
req := service.TermsOfServiceApi.GetTermsOfServiceDocumentInput("id").GetTermsOfServiceDocumentRequest(getTermsOfServiceDocumentRequest)
res, httpRes, err := service.TermsOfServiceApi.GetTermsOfServiceDocument(context.Background(), req)
```

#### Python

```py
# Adyen Python API Library v13.3.0
import Adyen

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY"
adyen.client.platform = "test" # The environment to use library in.

# Create the request object(s)
json_request = {
  "type": "adyenForPlatformsAdvanced",
  "language": "en"
}

# Send the request
result = adyen.legalEntityManagement.terms_of_service_api.get_terms_of_service_document(request=json_request, id="id")
```

#### Ruby

```rb
# Adyen Ruby API Library v10.1.1
require "adyen-ruby-api-library"

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY'
adyen.env = :test # Set to "live" for live environment

# Create the request object(s)
request_body = {
  :type => 'adyenForPlatformsAdvanced',
  :language => 'en'
}

# Send the request
result = adyen.legalEntityManagement.terms_of_service_api.get_terms_of_service_document(request_body, 'id')
```

#### NodeJS (TypeScript)

```ts
// Adyen Node API Library v23.3.0
import { Client, LegalEntityManagementAPI, Types } from "@adyen/api-library";

const client = new Client({ apiKey: "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY", environment: "TEST" });

// Create the request object(s)
const getTermsOfServiceDocumentRequest: Types.legalEntityManagement.GetTermsOfServiceDocumentRequest = {
  language: "en",
  type: Types.legalEntityManagement.GetTermsOfServiceDocumentRequest.TypeEnum.AdyenForPlatformsAdvanced
};

// Send the request
const legalEntityManagementAPI = new LegalEntityManagementAPI(client);
const response = legalEntityManagementAPI.TermsOfServiceApi.getTermsOfServiceDocument("id", getTermsOfServiceDocumentRequest);
```

The response returns the following information:

| Parameter                                                                                                                                                            | Description                                                                                                                      |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [document](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#responses-200-document)                                   | The generated document in the Base64-encoded format.                                                                             |
| [id](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#responses-200-id)                                               | The unique identifier of the organization legal entity.                                                                          |
| [language](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#responses-200-language)                                   | The language of the document.                                                                                                    |
| [type](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#responses-200-type)                                           | The type of document based on the services and capabilities requested by the user and your platform integration.                 |
| [termsOfServiceDocumentId](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#responses-200-termsOfServiceDocumentId)   | The unique identifier of the document.                                                                                           |
| [termsOfServiceDocumentFormat](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#request-termsOfServiceDocumentFormat) | The requested format for the Terms of Service document. Default value: **JSON**. Possible values: **JSON**, **PDF**, or **TXT**. |

**Response**

```json
{
  "id": "LE00000000000000000000001",
  "type": "adyenForPlatformsAdvanced",
  "language": "en",
  "document": "termsOfServiceDocumentResponse" ,
  "termsOfServiceDocumentId": "abc123",
  "termsOfServiceDocumentFormat": "JSON"
}
```

The response returns the [document](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/_id_/termsOfService#responses-200-document) and its unique [termsOfServiceDocumentId](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/_id_/termsOfService#responses-200-termsOfServiceDocumentId).

Your user may need to accept more than one Terms of Service document depending on your integration. In this case, every required [document](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/_id_/termsOfService#responses-200-document) and [termsOfServiceDocumentId](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/_id_/termsOfService#responses-200-termsOfServiceDocumentId) is returned in the response.

You will need to present the document to your user in the [next step](#present-document). Use the document ID when you confirm your user has [accepted the Terms of Service](#accept-tos).

## 4. Present the Terms of Service document to your user

You need to ask your user to review and accept the Terms of Service document. The process to do this depends on the format of the document.

### Tab: Format: JSON

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.

```js
const documentViewer = new AdyenDocumentViewer('#test');
const document = JSON.parse(decodeURIComponent(escape(window.atob(termsOfServiceDocumentResponse.document))));
documentViewer.render(document);
```

### Tab: Format: PDF or TXT

In the response from the previous step, take the Base64-encoded data from the [document](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/\(id\)/termsOfService#responses-200-document). Decode it and present it to your user in your UI.

## 5. Accept the Terms of Service

To confirm that your user has accepted the Terms of Service, make a PATCH [/legalEntities/{id}/termsOfService/termsOfServicedocumentid](https://docs.adyen.com/api-explorer/legalentity/latest/patch/legalEntities/\(id\)/termsOfService/\(termsofservicedocumentid\)) request, specifying the [id](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) of the main legal entity and the [termsOfServiceDocumentId](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities/_id_/termsOfService#responses-200-termsOfServiceDocumentId) of the document in the path. For sole proprietorships, include the legal entity ID of the owner in the path. For organizations, include the legal entity ID of the organization in the path.

In the body of the request, specify the following:

| Parameter                                                                                                                                                  | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                             |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [acceptedBy](https://docs.adyen.com/api-explorer/legalentity/latest/patch/legalEntities/_id_/termsOfService/_termsofservicedocumentid_#request-acceptedBy) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The individual legal entity [id](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) of the user accepting the Terms of Service. For sole proprietorships, this is the individual legal entity ID of the owner. For organizations, this is the legal entity ID of an authorized signatory for the organization. |
| [ipAddress](https://docs.adyen.com/api-explorer/legalentity/latest/patch/legalEntities/_id_/termsOfService/_termsofservicedocumentid_#request-ipAddress)   |                                                                                             | The IP address of the user.                                                                                                                                                                                                                                                                                                                             |

This request populates the Terms of Service document with the data of the main legal entity. For sole proprietorships, this is the information for the individual legal entity of the owner. For organizations, this means the document contains both the data for the organization and the individual legal entity of the authorized signatory who accepted the document.

**Accept Terms of Service document**

#### curl

```bash
curl https://kyc-test.adyen.com/lem/v3/legalEntities/LE00000000000000000000001/termsOfService/abc123 \
-H 'x-api-key: ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY' \
-H 'content-type: application/json' \
-X PATCH \
-d '{
    "acceptedBy" : "LE00000000000000000000002",
    "ipAddress" : "127.0.0.1"
}'
```

#### Java

```java
// Adyen Java API Library v33.0.0
import com.adyen.Client;
import com.adyen.enums.Environment;
import com.adyen.model.legalentitymanagement.*;
import java.time.OffsetDateTime;
import java.util.*;
import com.adyen.service.legalEntityManagement.*;

Client client = new Client("ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY", Environment.TEST);

// Create the request object(s)
AcceptTermsOfServiceRequest acceptTermsOfServiceRequest = new AcceptTermsOfServiceRequest()
  .ipAddress("127.0.0.1")
  .acceptedBy("LE00000000000000000000002");

// Send the request
TermsOfServiceApi service = new TermsOfServiceApi(client);
AcceptTermsOfServiceResponse response = service.acceptTermsOfService("id", "termsofservicedocumentid", acceptTermsOfServiceRequest, null);
```

#### PHP

```php
<?php
// Adyen PHP API Library v24.0.0
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\LegalEntityManagement\AcceptTermsOfServiceRequest;
use Adyen\Service\LegalEntityManagement\TermsOfServiceApi;

$client = new Client();
$client->setXApiKey("ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY");
$client->setEnvironment(Environment::TEST);


// Create the request object(s)
$acceptTermsOfServiceRequest = new AcceptTermsOfServiceRequest();
$acceptTermsOfServiceRequest
  ->setIpAddress("127.0.0.1")
  ->setAcceptedBy("LE00000000000000000000002");

// Send the request
$service = new TermsOfServiceApi($client);
$response = $service->acceptTermsOfService('id', 'termsofservicedocumentid', $acceptTermsOfServiceRequest);
```

#### C\#

```cs
// Adyen .net API Library v28.0.0
using Adyen;
using Environment = Adyen.Model.Environment;
using Adyen.Model;
using Adyen.Model.LegalEntityManagement;
using Adyen.Service.LegalEntityManagement;

var config = new Config()
{
    XApiKey = "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY",
    Environment = Environment.Test
};
var client = new Client(config);

// Create the request object(s)
AcceptTermsOfServiceRequest acceptTermsOfServiceRequest = new AcceptTermsOfServiceRequest
{
  IpAddress = "127.0.0.1",
  AcceptedBy = "LE00000000000000000000002"
};

// Send the request
var service = new TermsOfServiceService(client);
var response = service.AcceptTermsOfService("id", "termsofservicedocumentid", acceptTermsOfServiceRequest);
```

#### NodeJS (JavaScript)

```js
// Adyen Node API Library v23.3.0
const { Client, LegalEntityManagementAPI } = require('@adyen/api-library');

const client = new Client({ apiKey: "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY", environment: "TEST" });

// Create the request object(s)
const acceptTermsOfServiceRequest = {
  acceptedBy: "LE00000000000000000000002",
  ipAddress: "127.0.0.1"
}

// Send the request
const legalEntityManagementAPI = new LegalEntityManagementAPI(client);
const response = legalEntityManagementAPI.TermsOfServiceApi.acceptTermsOfService("id", "termsofservicedocumentid", acceptTermsOfServiceRequest);
```

#### Go

```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/legalEntityManagement"
)
client := adyen.NewClient(&common.Config{
  ApiKey:      "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY",
  Environment: common.TestEnv,
})

// Create the request object(s)
acceptTermsOfServiceRequest := legalEntityManagement.AcceptTermsOfServiceRequest{
  IpAddress: common.PtrString("127.0.0.1"),
  AcceptedBy: "LE00000000000000000000002",
}

// Send the request
service := client.LegalEntityManagement()
req := service.TermsOfServiceApi.AcceptTermsOfServiceInput("id","termsofservicedocumentid").AcceptTermsOfServiceRequest(acceptTermsOfServiceRequest)
res, httpRes, err := service.TermsOfServiceApi.AcceptTermsOfService(context.Background(), req)
```

#### Python

```py
# Adyen Python API Library v13.3.0
import Adyen

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY"
adyen.client.platform = "test" # The environment to use library in.

# Create the request object(s)
json_request = {
  "acceptedBy": "LE00000000000000000000002",
  "ipAddress": "127.0.0.1"
}

# Send the request
result = adyen.legalEntityManagement.terms_of_service_api.accept_terms_of_service(request=json_request, id="id", termsofservicedocumentid="termsofservicedocumentid")
```

#### Ruby

```rb
# Adyen Ruby API Library v10.1.1
require "adyen-ruby-api-library"

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY'
adyen.env = :test # Set to "live" for live environment

# Create the request object(s)
request_body = {
  :acceptedBy => 'LE00000000000000000000002',
  :ipAddress => '127.0.0.1'
}

# Send the request
result = adyen.legalEntityManagement.terms_of_service_api.accept_terms_of_service(request_body, 'id', 'termsofservicedocumentid')
```

#### NodeJS (TypeScript)

```ts
// Adyen Node API Library v23.3.0
import { Client, LegalEntityManagementAPI, Types } from "@adyen/api-library";

const client = new Client({ apiKey: "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY", environment: "TEST" });

// Create the request object(s)
const acceptTermsOfServiceRequest: Types.legalEntityManagement.AcceptTermsOfServiceRequest = {
  ipAddress: "127.0.0.1",
  acceptedBy: "LE00000000000000000000002"
};

// Send the request
const legalEntityManagementAPI = new LegalEntityManagementAPI(client);
const response = legalEntityManagementAPI.TermsOfServiceApi.acceptTermsOfService("id", "termsofservicedocumentid", acceptTermsOfServiceRequest);
```

The response returns the following information.

| Parameter                                                                                                                                                                                    | Description                                                                                                                                                                 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [acceptedBy](https://docs.adyen.com/api-explorer/legalentity/latest/patch/legalEntities/_id_/termsOfService/_termsofservicedocumentid_#responses-200-acceptedBy)                             | The individual legal entity [id](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) of the user who accepted the terms of service. |
| [id](https://docs.adyen.com/api-explorer/legalentity/latest/patch/legalEntities/_id_/termsOfService/_termsofservicedocumentid_#responses-200-id)                                             | The unique identifier of the accepted document.                                                                                                                             |
| [ipAddress](https://docs.adyen.com/api-explorer/legalentity/latest/patch/legalEntities/_id_/termsOfService/_termsofservicedocumentid_#responses-200-ipAddress)                               | The IP address of the user. Only if provided in the request.                                                                                                                |
| [language](https://docs.adyen.com/api-explorer/legalentity/latest/patch/legalEntities/_id_/termsOfService/_termsofservicedocumentid_#responses-200-language)                                 | The language of the document.                                                                                                                                               |
| [termsOfServiceDocumentId](https://docs.adyen.com/api-explorer/legalentity/latest/patch/legalEntities/_id_/termsOfService/_termsofservicedocumentid_#responses-200-termsOfServiceDocumentId) | The unique identifier of the document.                                                                                                                                      |
| [type](https://docs.adyen.com/api-explorer/legalentity/latest/patch/legalEntities/_id_/termsOfService/_termsofservicedocumentid_#responses-200-type)                                         | The type of document based on the services and capabilities requested by the user and your platform integration.                                                            |

**Terms of Service document accepted**

```json
{
    "acceptedBy": "LE00000000000000000000002",
    "id": "TOSA000AB00000000B2AAAB2BA0AA0",
    "ipAddress": "127.0.0.1",
    "language": "en",
    "termsOfServiceDocumentId": "abc123",
    "type": "adyenForPlatformsAdvanced"
}
```

## 6. (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](https://docs.adyen.com/api-explorer/legalentity/latest/get/legalEntities/\(id\)/termsOfServiceAcceptanceInfos) request with the [id](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) of the main legal entity in the path. For sole proprietorships, this is the individual legal entity ID of the owner.

**Get Terms of Service information for a legal entity**

#### curl

```bash
curl https://kyc-test.adyen.com/lem/v3/legalEntities/LE00000000000000000000001/termsOfServiceAcceptanceInfos \
-H 'x-api-key: ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY' \
-X GET \
```

#### Java

```java
// Adyen Java API Library v33.0.0
import com.adyen.Client;
import com.adyen.enums.Environment;
import com.adyen.model.legalentitymanagement.*;
import java.time.OffsetDateTime;
import java.util.*;
import com.adyen.service.legalEntityManagement.*;

Client client = new Client("ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY", Environment.TEST);
// Send the request
TermsOfServiceApi service = new TermsOfServiceApi(client);
GetTermsOfServiceAcceptanceInfosResponse response = service.getTermsOfServiceInformationForLegalEntity("id", null);
```

#### PHP

```php
<?php
// Adyen PHP API Library v24.0.0
use Adyen\Client;
use Adyen\Environment;
use Adyen\Service\LegalEntityManagement\TermsOfServiceApi;

$client = new Client();
$client->setXApiKey("ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY");
$client->setEnvironment(Environment::TEST);

// Send the request
$service = new TermsOfServiceApi($client);
$response = $service->getTermsOfServiceInformationForLegalEntity('id');
```

#### C\#

```cs
// Adyen .net API Library v28.0.0
using Adyen;
using Environment = Adyen.Model.Environment;
using Adyen.Model;
using Adyen.Model.LegalEntityManagement;
using Adyen.Service.LegalEntityManagement;

var config = new Config()
{
    XApiKey = "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY",
    Environment = Environment.Test
};
var client = new Client(config);

// Send the request
var service = new TermsOfServiceService(client);
var response = service.GetTermsOfServiceInformationForLegalEntity("id");
```

#### NodeJS (JavaScript)

```js
// Adyen Node API Library v23.3.0
const { Client, LegalEntityManagementAPI } = require('@adyen/api-library');

const client = new Client({ apiKey: "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY", environment: "TEST" });

// Send the request
const legalEntityManagementAPI = new LegalEntityManagementAPI(client);
const response = legalEntityManagementAPI.TermsOfServiceApi.getTermsOfServiceInformationForLegalEntity("id");
```

#### Go

```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/legalEntityManagement"
)
client := adyen.NewClient(&common.Config{
  ApiKey:      "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY",
  Environment: common.TestEnv,
})

// Send the request
service := client.LegalEntityManagement()
req := service.TermsOfServiceApi.GetTermsOfServiceInformationForLegalEntityInput("id")
res, httpRes, err := service.TermsOfServiceApi.GetTermsOfServiceInformationForLegalEntity(context.Background(), req)
```

#### Python

```py
# Adyen Python API Library v13.3.0
import Adyen

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY"
adyen.client.platform = "test" # The environment to use library in.

# Send the request
result = adyen.legalEntityManagement.terms_of_service_api.get_terms_of_service_information_for_legal_entity(id="id")
```

#### Ruby

```rb
# Adyen Ruby API Library v10.1.1
require "adyen-ruby-api-library"

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY'
adyen.env = :test # Set to "live" for live environment

# Send the request
result = adyen.legalEntityManagement.terms_of_service_api.get_terms_of_service_information_for_legal_entity('id')
```

#### NodeJS (TypeScript)

```ts
// Adyen Node API Library v23.3.0
import { Client, LegalEntityManagementAPI, Types } from "@adyen/api-library";

const client = new Client({ apiKey: "ADYEN_LEGAL_ENTITY_MANAGEMENT_API_KEY", environment: "TEST" });

// Send the request
const legalEntityManagementAPI = new LegalEntityManagementAPI(client);
const response = legalEntityManagementAPI.TermsOfServiceApi.getTermsOfServiceInformationForLegalEntity("id");
```

The response returns information about the Terms of Service document linked to the legal entity.

| Parameter                                                                                                                                                 | Description                                                                                                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [createdAt](https://docs.adyen.com/api-explorer/legalentity/latest/get/legalEntities/_id_/termsOfServiceAcceptanceInfos#responses-200-data-createdAt)     | The date the document was created.                                                                                                                        |
| [id](https://docs.adyen.com/api-explorer/legalentity/latest/get/legalEntities/_id_/termsOfServiceAcceptanceInfos#responses-200-data-id)                   | The unique identifier of the accepted document.                                                                                                           |
| [acceptedBy](https://docs.adyen.com/api-explorer/legalentity/latest/get/legalEntities/_id_/termsOfServiceAcceptanceInfos#responses-200-data-acceptedBy)   | The [id](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) of the individual who accepted the terms of service. |
| [acceptedFor](https://docs.adyen.com/api-explorer/legalentity/latest/get/legalEntities/_id_/termsOfServiceAcceptanceInfos#responses-200-data-acceptedFor) | The [id](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) of the main legal entity.                            |
| [type](https://docs.adyen.com/api-explorer/legalentity/latest/get/legalEntities/_id_/termsOfServiceAcceptanceInfos#responses-200-data-type)               | The type of document based on the services and capabilities requested by the user and your platform integration.                                          |

**Response**

```json
{
    "data": [
        {
            "acceptedBy": "LE00000000000000000000002",
            "acceptedFor": "LE00000000000000000000001",
            "createdAt": "2022-12-05T13:36:58.212253Z",
            "id": "TOSA000AB00000000B2AAAB2BA0AA0",
            "type": "adyenForPlatformsAdvanced"
        }
    ]
}
```
