Update User
Update user information. All fields are optional - only include fields that need to be updated.
curl --request PUT \
--url https://api.carbnconnect.com/onboarding/api/v1/users/{user_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"email_address": "user@example.com",
"phone_number": "+1XXXXXXXXXX",
"user_type": "individual",
"date_of_birth": "YYYY-MM-DD",
"consent_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"metadata": "{}",
"sharing_consent": true,
"identity": {
"identity_country_code": "DEU",
"identity_number": "XXXXXXXXXXXX",
"identity_document_name": "permanent_residency_id",
"identity_document_front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
"identity_document_back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD..."
},
"documents": [
{
"name": "steuer_id",
"type": "tax_document",
"issuing_country": "DEU",
"document_number": "<string>",
"document_front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
"document_back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
],
"address": {
"line1": "123 Main Street",
"city": "City Name",
"sub_division": "ST",
"country": "DEU",
"postal_code": "12345"
}
}
'import requests
url = "https://api.carbnconnect.com/onboarding/api/v1/users/{user_id}"
payload = {
"first_name": "John",
"last_name": "Doe",
"email_address": "user@example.com",
"phone_number": "+1XXXXXXXXXX",
"user_type": "individual",
"date_of_birth": "YYYY-MM-DD",
"consent_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"metadata": "{}",
"sharing_consent": True,
"identity": {
"identity_country_code": "DEU",
"identity_number": "XXXXXXXXXXXX",
"identity_document_name": "permanent_residency_id",
"identity_document_front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
"identity_document_back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD..."
},
"documents": [
{
"name": "steuer_id",
"type": "tax_document",
"issuing_country": "DEU",
"document_number": "<string>",
"document_front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
"document_back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
],
"address": {
"line1": "123 Main Street",
"city": "City Name",
"sub_division": "ST",
"country": "DEU",
"postal_code": "12345"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: 'John',
last_name: 'Doe',
email_address: 'user@example.com',
phone_number: '+1XXXXXXXXXX',
user_type: 'individual',
date_of_birth: 'YYYY-MM-DD',
consent_id: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
metadata: '{}',
sharing_consent: true,
identity: {
identity_country_code: 'DEU',
identity_number: 'XXXXXXXXXXXX',
identity_document_name: 'permanent_residency_id',
identity_document_front: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...',
identity_document_back: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...'
},
documents: [
{
name: 'steuer_id',
type: 'tax_document',
issuing_country: 'DEU',
document_number: '<string>',
document_front: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...',
document_back: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...'
}
],
address: {
line1: '123 Main Street',
city: 'City Name',
sub_division: 'ST',
country: 'DEU',
postal_code: '12345'
}
})
};
fetch('https://api.carbnconnect.com/onboarding/api/v1/users/{user_id}', 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://api.carbnconnect.com/onboarding/api/v1/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => 'John',
'last_name' => 'Doe',
'email_address' => 'user@example.com',
'phone_number' => '+1XXXXXXXXXX',
'user_type' => 'individual',
'date_of_birth' => 'YYYY-MM-DD',
'consent_id' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'metadata' => '{}',
'sharing_consent' => true,
'identity' => [
'identity_country_code' => 'DEU',
'identity_number' => 'XXXXXXXXXXXX',
'identity_document_name' => 'permanent_residency_id',
'identity_document_front' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...',
'identity_document_back' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...'
],
'documents' => [
[
'name' => 'steuer_id',
'type' => 'tax_document',
'issuing_country' => 'DEU',
'document_number' => '<string>',
'document_front' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...',
'document_back' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...'
]
],
'address' => [
'line1' => '123 Main Street',
'city' => 'City Name',
'sub_division' => 'ST',
'country' => 'DEU',
'postal_code' => '12345'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.carbnconnect.com/onboarding/api/v1/users/{user_id}"
payload := strings.NewReader("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email_address\": \"user@example.com\",\n \"phone_number\": \"+1XXXXXXXXXX\",\n \"user_type\": \"individual\",\n \"date_of_birth\": \"YYYY-MM-DD\",\n \"consent_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n \"metadata\": \"{}\",\n \"sharing_consent\": true,\n \"identity\": {\n \"identity_country_code\": \"DEU\",\n \"identity_number\": \"XXXXXXXXXXXX\",\n \"identity_document_name\": \"permanent_residency_id\",\n \"identity_document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"identity_document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n },\n \"documents\": [\n {\n \"name\": \"steuer_id\",\n \"type\": \"tax_document\",\n \"issuing_country\": \"DEU\",\n \"document_number\": \"<string>\",\n \"document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n ],\n \"address\": {\n \"line1\": \"123 Main Street\",\n \"city\": \"City Name\",\n \"sub_division\": \"ST\",\n \"country\": \"DEU\",\n \"postal_code\": \"12345\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.put("https://api.carbnconnect.com/onboarding/api/v1/users/{user_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email_address\": \"user@example.com\",\n \"phone_number\": \"+1XXXXXXXXXX\",\n \"user_type\": \"individual\",\n \"date_of_birth\": \"YYYY-MM-DD\",\n \"consent_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n \"metadata\": \"{}\",\n \"sharing_consent\": true,\n \"identity\": {\n \"identity_country_code\": \"DEU\",\n \"identity_number\": \"XXXXXXXXXXXX\",\n \"identity_document_name\": \"permanent_residency_id\",\n \"identity_document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"identity_document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n },\n \"documents\": [\n {\n \"name\": \"steuer_id\",\n \"type\": \"tax_document\",\n \"issuing_country\": \"DEU\",\n \"document_number\": \"<string>\",\n \"document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n ],\n \"address\": {\n \"line1\": \"123 Main Street\",\n \"city\": \"City Name\",\n \"sub_division\": \"ST\",\n \"country\": \"DEU\",\n \"postal_code\": \"12345\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.carbnconnect.com/onboarding/api/v1/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email_address\": \"user@example.com\",\n \"phone_number\": \"+1XXXXXXXXXX\",\n \"user_type\": \"individual\",\n \"date_of_birth\": \"YYYY-MM-DD\",\n \"consent_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n \"metadata\": \"{}\",\n \"sharing_consent\": true,\n \"identity\": {\n \"identity_country_code\": \"DEU\",\n \"identity_number\": \"XXXXXXXXXXXX\",\n \"identity_document_name\": \"permanent_residency_id\",\n \"identity_document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"identity_document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n },\n \"documents\": [\n {\n \"name\": \"steuer_id\",\n \"type\": \"tax_document\",\n \"issuing_country\": \"DEU\",\n \"document_number\": \"<string>\",\n \"document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n ],\n \"address\": {\n \"line1\": \"123 Main Street\",\n \"city\": \"City Name\",\n \"sub_division\": \"ST\",\n \"country\": \"DEU\",\n \"postal_code\": \"12345\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "under_review",
"documents": [
{
"name": "national_id",
"type": "identity_front"
},
{
"name": "national_id",
"type": "identity_back"
},
{
"name": "steuer_id",
"type": "tax_document"
}
],
"address": {
"line1": "123 Main Street",
"line2": null,
"city": "City Name",
"country": "DEU",
"region": null,
"sub_division": "ST",
"postal_code": "12345"
},
"first_name": "John",
"last_name": "Doe",
"email_address": "user@example.com",
"phone_number": "+1XXXXXXXXXX",
"date_of_birth": "YYYY-MM-DD",
"rejection_reasons": null,
"requirements": null
}Authorizations
API key for authentication. Must be included in the x-api-key header.
Path Parameters
Unique identifier of the user to update
Body
User update request - all fields are optional, only include fields that need to be updated
"John"
"Doe"
"user@example.com"
"+1XXXXXXXXXX"
individual "individual"
"YYYY-MM-DD"
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
"{}"
true
Show child attributes
Show child attributes
Additional supporting documents for user onboarding. Can include various document types such as proof of address, source of funds, etc.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
User updated successfully
Unique user identifier
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Current user status. under_review: Initial status when user is created (default). active: User has been approved and verified. paused: User account is temporarily paused. rejected: User has been rejected during KYC process. offboarded: User has been removed/offboarded from the system. incomplete: User profile is missing required information.
under_review, active, rejected, offboarded, incomplete "under_review"
List of uploaded documents (both identity and supporting documents)
Show child attributes
Show child attributes
[
{
"name": "national_id",
"type": "identity_front"
},
{
"name": "national_id",
"type": "identity_back"
},
{
"name": "steuer_id",
"type": "tax_document"
}
]Show child attributes
Show child attributes
User's first name
"John"
User's last name
"Doe"
User's email address
"user@example.com"
User's phone number
"+1XXXXXXXXXX"
User's date of birth
"YYYY-MM-DD"
Array of rejection reason objects (only populated for rejected users, null otherwise). Each object contains customer-facing reason, timestamp, and internal developer reason.
Show child attributes
Show child attributes
null
List of missing requirements for incomplete users (null when no requirements are missing)
null
curl --request PUT \
--url https://api.carbnconnect.com/onboarding/api/v1/users/{user_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"email_address": "user@example.com",
"phone_number": "+1XXXXXXXXXX",
"user_type": "individual",
"date_of_birth": "YYYY-MM-DD",
"consent_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"metadata": "{}",
"sharing_consent": true,
"identity": {
"identity_country_code": "DEU",
"identity_number": "XXXXXXXXXXXX",
"identity_document_name": "permanent_residency_id",
"identity_document_front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
"identity_document_back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD..."
},
"documents": [
{
"name": "steuer_id",
"type": "tax_document",
"issuing_country": "DEU",
"document_number": "<string>",
"document_front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
"document_back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
],
"address": {
"line1": "123 Main Street",
"city": "City Name",
"sub_division": "ST",
"country": "DEU",
"postal_code": "12345"
}
}
'import requests
url = "https://api.carbnconnect.com/onboarding/api/v1/users/{user_id}"
payload = {
"first_name": "John",
"last_name": "Doe",
"email_address": "user@example.com",
"phone_number": "+1XXXXXXXXXX",
"user_type": "individual",
"date_of_birth": "YYYY-MM-DD",
"consent_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"metadata": "{}",
"sharing_consent": True,
"identity": {
"identity_country_code": "DEU",
"identity_number": "XXXXXXXXXXXX",
"identity_document_name": "permanent_residency_id",
"identity_document_front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
"identity_document_back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD..."
},
"documents": [
{
"name": "steuer_id",
"type": "tax_document",
"issuing_country": "DEU",
"document_number": "<string>",
"document_front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
"document_back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
],
"address": {
"line1": "123 Main Street",
"city": "City Name",
"sub_division": "ST",
"country": "DEU",
"postal_code": "12345"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: 'John',
last_name: 'Doe',
email_address: 'user@example.com',
phone_number: '+1XXXXXXXXXX',
user_type: 'individual',
date_of_birth: 'YYYY-MM-DD',
consent_id: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
metadata: '{}',
sharing_consent: true,
identity: {
identity_country_code: 'DEU',
identity_number: 'XXXXXXXXXXXX',
identity_document_name: 'permanent_residency_id',
identity_document_front: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...',
identity_document_back: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...'
},
documents: [
{
name: 'steuer_id',
type: 'tax_document',
issuing_country: 'DEU',
document_number: '<string>',
document_front: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...',
document_back: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...'
}
],
address: {
line1: '123 Main Street',
city: 'City Name',
sub_division: 'ST',
country: 'DEU',
postal_code: '12345'
}
})
};
fetch('https://api.carbnconnect.com/onboarding/api/v1/users/{user_id}', 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://api.carbnconnect.com/onboarding/api/v1/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => 'John',
'last_name' => 'Doe',
'email_address' => 'user@example.com',
'phone_number' => '+1XXXXXXXXXX',
'user_type' => 'individual',
'date_of_birth' => 'YYYY-MM-DD',
'consent_id' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'metadata' => '{}',
'sharing_consent' => true,
'identity' => [
'identity_country_code' => 'DEU',
'identity_number' => 'XXXXXXXXXXXX',
'identity_document_name' => 'permanent_residency_id',
'identity_document_front' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...',
'identity_document_back' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...'
],
'documents' => [
[
'name' => 'steuer_id',
'type' => 'tax_document',
'issuing_country' => 'DEU',
'document_number' => '<string>',
'document_front' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...',
'document_back' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...'
]
],
'address' => [
'line1' => '123 Main Street',
'city' => 'City Name',
'sub_division' => 'ST',
'country' => 'DEU',
'postal_code' => '12345'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.carbnconnect.com/onboarding/api/v1/users/{user_id}"
payload := strings.NewReader("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email_address\": \"user@example.com\",\n \"phone_number\": \"+1XXXXXXXXXX\",\n \"user_type\": \"individual\",\n \"date_of_birth\": \"YYYY-MM-DD\",\n \"consent_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n \"metadata\": \"{}\",\n \"sharing_consent\": true,\n \"identity\": {\n \"identity_country_code\": \"DEU\",\n \"identity_number\": \"XXXXXXXXXXXX\",\n \"identity_document_name\": \"permanent_residency_id\",\n \"identity_document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"identity_document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n },\n \"documents\": [\n {\n \"name\": \"steuer_id\",\n \"type\": \"tax_document\",\n \"issuing_country\": \"DEU\",\n \"document_number\": \"<string>\",\n \"document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n ],\n \"address\": {\n \"line1\": \"123 Main Street\",\n \"city\": \"City Name\",\n \"sub_division\": \"ST\",\n \"country\": \"DEU\",\n \"postal_code\": \"12345\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.put("https://api.carbnconnect.com/onboarding/api/v1/users/{user_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email_address\": \"user@example.com\",\n \"phone_number\": \"+1XXXXXXXXXX\",\n \"user_type\": \"individual\",\n \"date_of_birth\": \"YYYY-MM-DD\",\n \"consent_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n \"metadata\": \"{}\",\n \"sharing_consent\": true,\n \"identity\": {\n \"identity_country_code\": \"DEU\",\n \"identity_number\": \"XXXXXXXXXXXX\",\n \"identity_document_name\": \"permanent_residency_id\",\n \"identity_document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"identity_document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n },\n \"documents\": [\n {\n \"name\": \"steuer_id\",\n \"type\": \"tax_document\",\n \"issuing_country\": \"DEU\",\n \"document_number\": \"<string>\",\n \"document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n ],\n \"address\": {\n \"line1\": \"123 Main Street\",\n \"city\": \"City Name\",\n \"sub_division\": \"ST\",\n \"country\": \"DEU\",\n \"postal_code\": \"12345\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.carbnconnect.com/onboarding/api/v1/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email_address\": \"user@example.com\",\n \"phone_number\": \"+1XXXXXXXXXX\",\n \"user_type\": \"individual\",\n \"date_of_birth\": \"YYYY-MM-DD\",\n \"consent_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n \"metadata\": \"{}\",\n \"sharing_consent\": true,\n \"identity\": {\n \"identity_country_code\": \"DEU\",\n \"identity_number\": \"XXXXXXXXXXXX\",\n \"identity_document_name\": \"permanent_residency_id\",\n \"identity_document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"identity_document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n },\n \"documents\": [\n {\n \"name\": \"steuer_id\",\n \"type\": \"tax_document\",\n \"issuing_country\": \"DEU\",\n \"document_number\": \"<string>\",\n \"document_front\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"document_back\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n ],\n \"address\": {\n \"line1\": \"123 Main Street\",\n \"city\": \"City Name\",\n \"sub_division\": \"ST\",\n \"country\": \"DEU\",\n \"postal_code\": \"12345\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "under_review",
"documents": [
{
"name": "national_id",
"type": "identity_front"
},
{
"name": "national_id",
"type": "identity_back"
},
{
"name": "steuer_id",
"type": "tax_document"
}
],
"address": {
"line1": "123 Main Street",
"line2": null,
"city": "City Name",
"country": "DEU",
"region": null,
"sub_division": "ST",
"postal_code": "12345"
},
"first_name": "John",
"last_name": "Doe",
"email_address": "user@example.com",
"phone_number": "+1XXXXXXXXXX",
"date_of_birth": "YYYY-MM-DD",
"rejection_reasons": null,
"requirements": null
}