When verifying users on your platform, the verification checks performed by Adyen can return a range of error messages. In your test environment, all verification checks are passed by default when the required fields and documents are provided.
To test your error handling flow, you can force a scenario where one or more verification checks fail. This allows you to reproduce an unsuccessful verification flow, including the result and corresponding verification codes.
Before you begin
Make sure that you have API credentials for the Legal Entity Management APIand Configuration API.
Step 1: Make an API request
Using the Legal Entity Management API, you can include a x-requested-verification-code in the header of your API request.
You can use requested verification codes for the following endpoints:
Use a suberror code as your requested verification code. You can include one code at a time in your request header. Requested verification codes can only be used in your test environment.
In this example, you want to test the 1_3004
suberror code The name and residence country couldn't be verified
for an individual legal entity. This triggers the following verification checks:
- Name and date of birth check
- Residency country check
In the header of your POST /legalEntities request, include x-requested-verification-code: 1_3004
.
Step 2: Create account holder
For error tests for legal entities, you need to create an account holder for the legal entity of the organization, individual, or sole proprietorship. For error tests for documents or transfer instruments, you need to create an account holder for the legal entity who owns the resource.
Step 3: Get verification results
To get updates about the verification status and results, you can:
- Listen to the balancePlatform.accountHolder.updated or
- Make a GET API request for the particular legal entity, document, or transfer instrument.
Make a GET /legalEntities/{id} request, specifying the id in the path.
The response returns the specified requested verification code and associated error codes.
Step 4: Test the remediating flow
Using the Legal Entity Management API, you can also test your verification error handling through the remediating flow. In your test environment, include the x-requested-verification-code: 0_0001
in the header of your API request.
The requested verification code can be used for the following endpoints:
If successful, the requested verification code resolves any suberrors associated with the legal entity, document, or transfer instrument.
Make a PATCH /legalEntities/{id} request, specifying the id in the path and x-requested-verification-code: 0_0001
in the API header.