Skip to main content
POST
/
customers
/
{uuid}
/
verify
Create KYC for a customer
curl --request POST \
  --url https://{subdomain}.truust.io/2.0/customers/{uuid}/verify \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "NATURAL",
  "first_name": "John",
  "last_name": "Doe",
  "vat_id": "12345678A",
  "legal_address": "Calle Mayor 1",
  "legal_city": "Madrid",
  "legal_zip": "28001",
  "legal_state": "Madrid",
  "legal_country": "ES"
}
'
import requests

url = "https://{subdomain}.truust.io/2.0/customers/{uuid}/verify"

payload = {
"type": "NATURAL",
"first_name": "John",
"last_name": "Doe",
"vat_id": "12345678A",
"legal_address": "Calle Mayor 1",
"legal_city": "Madrid",
"legal_zip": "28001",
"legal_state": "Madrid",
"legal_country": "ES"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'NATURAL',
first_name: 'John',
last_name: 'Doe',
vat_id: '12345678A',
legal_address: 'Calle Mayor 1',
legal_city: 'Madrid',
legal_zip: '28001',
legal_state: 'Madrid',
legal_country: 'ES'
})
};

fetch('https://{subdomain}.truust.io/2.0/customers/{uuid}/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.truust.io/2.0/customers/{uuid}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'NATURAL',
'first_name' => 'John',
'last_name' => 'Doe',
'vat_id' => '12345678A',
'legal_address' => 'Calle Mayor 1',
'legal_city' => 'Madrid',
'legal_zip' => '28001',
'legal_state' => 'Madrid',
'legal_country' => 'ES'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://{subdomain}.truust.io/2.0/customers/{uuid}/verify"

payload := strings.NewReader("{\n \"type\": \"NATURAL\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"vat_id\": \"12345678A\",\n \"legal_address\": \"Calle Mayor 1\",\n \"legal_city\": \"Madrid\",\n \"legal_zip\": \"28001\",\n \"legal_state\": \"Madrid\",\n \"legal_country\": \"ES\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://{subdomain}.truust.io/2.0/customers/{uuid}/verify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"NATURAL\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"vat_id\": \"12345678A\",\n \"legal_address\": \"Calle Mayor 1\",\n \"legal_city\": \"Madrid\",\n \"legal_zip\": \"28001\",\n \"legal_state\": \"Madrid\",\n \"legal_country\": \"ES\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{subdomain}.truust.io/2.0/customers/{uuid}/verify")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"NATURAL\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"vat_id\": \"12345678A\",\n \"legal_address\": \"Calle Mayor 1\",\n \"legal_city\": \"Madrid\",\n \"legal_zip\": \"28001\",\n \"legal_state\": \"Madrid\",\n \"legal_country\": \"ES\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "self": "<string>",
  "uuid": "<string>",
  "refused_reason": "<string>",
  "connections": {}
}
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}

Authorizations

Authorization
string
header
required

Use your account's Secret Key as the Bearer token.

Path Parameters

uuid
string
required

Customer UUID.

Body

application/json
type
enum<string>
required

Verification type. NATURAL for individuals, SOLETRADER for self-employed, LEGAL for companies.

Available options:
NATURAL,
SOLETRADER,
LEGAL
first_name
string
required
Maximum string length: 255
last_name
string
required
Maximum string length: 255
vat_id
string
required

Tax identification number (DNI, NIF, CIF, etc.).

Maximum string length: 255
Maximum string length: 255
Maximum string length: 255
Maximum string length: 255
Maximum string length: 255

ISO 3166-1 alpha-2 country code.

Maximum string length: 2

Company legal name. Required for LEGAL type.

Maximum string length: 255
birthday
string<date> | null
occupation
string | null
income_range
number | null
representative_name
string

Required for LEGAL type.

representative_email
string<email>

Required for LEGAL type.

representative_phone
string

Required for LEGAL type.

Response

KYC verification created

id
integer
self
string
uuid
string
type
enum<string>
Available options:
INDIVIDUAL,
SELFEMPLOYEE,
LEGAL
status
enum<string>
Available options:
CREATED,
PENDING,
VALIDATED,
REFUSED
refused_reason
string | null
connections
object

Hypermedia links to related resources.