curl --request POST \
--url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders \
--header 'Content-Type: application/json' \
--data '
{
"createdAt": "2025-01-01T00:00:00Z",
"deletedAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z",
"addresses": {},
"contact": {
"mobilePhone": "+1555555555",
"otherPhone": "+1555555555",
"primaryEmail": "john.doe@example.com",
"secondaryEmail": "john.doe@example.com"
},
"document": "91315026015",
"externalId": "G4K7N8M2",
"id": "00000000-0000-0000-0000-000000000000",
"legalPerson": {
"activity": "Electronic devices development",
"foundingDate": "2025-01-01",
"representative": {
"document": "91315026015",
"email": "john.doe@example.com",
"name": "John Doe",
"role": "CFO"
},
"size": "Medium",
"status": "Active",
"tradeName": "Lerian Studio",
"type": "Limited Liability"
},
"metadata": {},
"name": "John Doe",
"naturalPerson": {
"birthDate": "1990-01-01",
"civilStatus": "Single",
"fatherName": "John Doe",
"favoriteName": "John",
"gender": "Male",
"motherName": "Jane Doe",
"nationality": "Brazilian",
"socialName": "John Doe",
"status": "Active"
},
"type": "NATURAL_PERSON"
}
'import requests
url = "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders"
payload = {
"createdAt": "2025-01-01T00:00:00Z",
"deletedAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z",
"addresses": {},
"contact": {
"mobilePhone": "+1555555555",
"otherPhone": "+1555555555",
"primaryEmail": "john.doe@example.com",
"secondaryEmail": "john.doe@example.com"
},
"document": "91315026015",
"externalId": "G4K7N8M2",
"id": "00000000-0000-0000-0000-000000000000",
"legalPerson": {
"activity": "Electronic devices development",
"foundingDate": "2025-01-01",
"representative": {
"document": "91315026015",
"email": "john.doe@example.com",
"name": "John Doe",
"role": "CFO"
},
"size": "Medium",
"status": "Active",
"tradeName": "Lerian Studio",
"type": "Limited Liability"
},
"metadata": {},
"name": "John Doe",
"naturalPerson": {
"birthDate": "1990-01-01",
"civilStatus": "Single",
"fatherName": "John Doe",
"favoriteName": "John",
"gender": "Male",
"motherName": "Jane Doe",
"nationality": "Brazilian",
"socialName": "John Doe",
"status": "Active"
},
"type": "NATURAL_PERSON"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
createdAt: '2025-01-01T00:00:00Z',
deletedAt: '2025-01-01T00:00:00Z',
updatedAt: '2025-01-01T00:00:00Z',
addresses: {},
contact: {
mobilePhone: '+1555555555',
otherPhone: '+1555555555',
primaryEmail: 'john.doe@example.com',
secondaryEmail: 'john.doe@example.com'
},
document: '91315026015',
externalId: 'G4K7N8M2',
id: '00000000-0000-0000-0000-000000000000',
legalPerson: {
activity: 'Electronic devices development',
foundingDate: '2025-01-01',
representative: {
document: '91315026015',
email: 'john.doe@example.com',
name: 'John Doe',
role: 'CFO'
},
size: 'Medium',
status: 'Active',
tradeName: 'Lerian Studio',
type: 'Limited Liability'
},
metadata: {},
name: 'John Doe',
naturalPerson: {
birthDate: '1990-01-01',
civilStatus: 'Single',
fatherName: 'John Doe',
favoriteName: 'John',
gender: 'Male',
motherName: 'Jane Doe',
nationality: 'Brazilian',
socialName: 'John Doe',
status: 'Active'
},
type: 'NATURAL_PERSON'
})
};
fetch('https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders', 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://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders",
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([
'createdAt' => '2025-01-01T00:00:00Z',
'deletedAt' => '2025-01-01T00:00:00Z',
'updatedAt' => '2025-01-01T00:00:00Z',
'addresses' => [
],
'contact' => [
'mobilePhone' => '+1555555555',
'otherPhone' => '+1555555555',
'primaryEmail' => 'john.doe@example.com',
'secondaryEmail' => 'john.doe@example.com'
],
'document' => '91315026015',
'externalId' => 'G4K7N8M2',
'id' => '00000000-0000-0000-0000-000000000000',
'legalPerson' => [
'activity' => 'Electronic devices development',
'foundingDate' => '2025-01-01',
'representative' => [
'document' => '91315026015',
'email' => 'john.doe@example.com',
'name' => 'John Doe',
'role' => 'CFO'
],
'size' => 'Medium',
'status' => 'Active',
'tradeName' => 'Lerian Studio',
'type' => 'Limited Liability'
],
'metadata' => [
],
'name' => 'John Doe',
'naturalPerson' => [
'birthDate' => '1990-01-01',
'civilStatus' => 'Single',
'fatherName' => 'John Doe',
'favoriteName' => 'John',
'gender' => 'Male',
'motherName' => 'Jane Doe',
'nationality' => 'Brazilian',
'socialName' => 'John Doe',
'status' => 'Active'
],
'type' => 'NATURAL_PERSON'
]),
CURLOPT_HTTPHEADER => [
"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://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders"
payload := strings.NewReader("{\n \"createdAt\": \"2025-01-01T00:00:00Z\",\n \"deletedAt\": \"2025-01-01T00:00:00Z\",\n \"updatedAt\": \"2025-01-01T00:00:00Z\",\n \"addresses\": {},\n \"contact\": {\n \"mobilePhone\": \"+1555555555\",\n \"otherPhone\": \"+1555555555\",\n \"primaryEmail\": \"john.doe@example.com\",\n \"secondaryEmail\": \"john.doe@example.com\"\n },\n \"document\": \"91315026015\",\n \"externalId\": \"G4K7N8M2\",\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n \"legalPerson\": {\n \"activity\": \"Electronic devices development\",\n \"foundingDate\": \"2025-01-01\",\n \"representative\": {\n \"document\": \"91315026015\",\n \"email\": \"john.doe@example.com\",\n \"name\": \"John Doe\",\n \"role\": \"CFO\"\n },\n \"size\": \"Medium\",\n \"status\": \"Active\",\n \"tradeName\": \"Lerian Studio\",\n \"type\": \"Limited Liability\"\n },\n \"metadata\": {},\n \"name\": \"John Doe\",\n \"naturalPerson\": {\n \"birthDate\": \"1990-01-01\",\n \"civilStatus\": \"Single\",\n \"fatherName\": \"John Doe\",\n \"favoriteName\": \"John\",\n \"gender\": \"Male\",\n \"motherName\": \"Jane Doe\",\n \"nationality\": \"Brazilian\",\n \"socialName\": \"John Doe\",\n \"status\": \"Active\"\n },\n \"type\": \"NATURAL_PERSON\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders")
.header("Content-Type", "application/json")
.body("{\n \"createdAt\": \"2025-01-01T00:00:00Z\",\n \"deletedAt\": \"2025-01-01T00:00:00Z\",\n \"updatedAt\": \"2025-01-01T00:00:00Z\",\n \"addresses\": {},\n \"contact\": {\n \"mobilePhone\": \"+1555555555\",\n \"otherPhone\": \"+1555555555\",\n \"primaryEmail\": \"john.doe@example.com\",\n \"secondaryEmail\": \"john.doe@example.com\"\n },\n \"document\": \"91315026015\",\n \"externalId\": \"G4K7N8M2\",\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n \"legalPerson\": {\n \"activity\": \"Electronic devices development\",\n \"foundingDate\": \"2025-01-01\",\n \"representative\": {\n \"document\": \"91315026015\",\n \"email\": \"john.doe@example.com\",\n \"name\": \"John Doe\",\n \"role\": \"CFO\"\n },\n \"size\": \"Medium\",\n \"status\": \"Active\",\n \"tradeName\": \"Lerian Studio\",\n \"type\": \"Limited Liability\"\n },\n \"metadata\": {},\n \"name\": \"John Doe\",\n \"naturalPerson\": {\n \"birthDate\": \"1990-01-01\",\n \"civilStatus\": \"Single\",\n \"fatherName\": \"John Doe\",\n \"favoriteName\": \"John\",\n \"gender\": \"Male\",\n \"motherName\": \"Jane Doe\",\n \"nationality\": \"Brazilian\",\n \"socialName\": \"John Doe\",\n \"status\": \"Active\"\n },\n \"type\": \"NATURAL_PERSON\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"createdAt\": \"2025-01-01T00:00:00Z\",\n \"deletedAt\": \"2025-01-01T00:00:00Z\",\n \"updatedAt\": \"2025-01-01T00:00:00Z\",\n \"addresses\": {},\n \"contact\": {\n \"mobilePhone\": \"+1555555555\",\n \"otherPhone\": \"+1555555555\",\n \"primaryEmail\": \"john.doe@example.com\",\n \"secondaryEmail\": \"john.doe@example.com\"\n },\n \"document\": \"91315026015\",\n \"externalId\": \"G4K7N8M2\",\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n \"legalPerson\": {\n \"activity\": \"Electronic devices development\",\n \"foundingDate\": \"2025-01-01\",\n \"representative\": {\n \"document\": \"91315026015\",\n \"email\": \"john.doe@example.com\",\n \"name\": \"John Doe\",\n \"role\": \"CFO\"\n },\n \"size\": \"Medium\",\n \"status\": \"Active\",\n \"tradeName\": \"Lerian Studio\",\n \"type\": \"Limited Liability\"\n },\n \"metadata\": {},\n \"name\": \"John Doe\",\n \"naturalPerson\": {\n \"birthDate\": \"1990-01-01\",\n \"civilStatus\": \"Single\",\n \"fatherName\": \"John Doe\",\n \"favoriteName\": \"John\",\n \"gender\": \"Male\",\n \"motherName\": \"Jane Doe\",\n \"nationality\": \"Brazilian\",\n \"socialName\": \"John Doe\",\n \"status\": \"Active\"\n },\n \"type\": \"NATURAL_PERSON\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2025-01-01T00:00:00Z",
"deletedAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z",
"addresses": {
"additional1": {
"city": "New York",
"country": "US",
"line1": "123 Financial Avenue",
"line2": "Suite 1500",
"state": "NY",
"zipCode": "10001",
"description": "Home"
},
"additional2": {
"city": "New York",
"country": "US",
"line1": "123 Financial Avenue",
"line2": "Suite 1500",
"state": "NY",
"zipCode": "10001",
"description": "Home"
},
"primary": {
"city": "New York",
"country": "US",
"line1": "123 Financial Avenue",
"line2": "Suite 1500",
"state": "NY",
"zipCode": "10001",
"description": "Home"
}
},
"contact": {
"mobilePhone": "+1555555555",
"otherPhone": "+1555555555",
"primaryEmail": "john.doe@example.com",
"secondaryEmail": "john.doe@example.com"
},
"document": "91315026015",
"externalId": "G4K7N8M2",
"id": "00000000-0000-0000-0000-000000000000",
"legalPerson": {
"activity": "Electronic devices development",
"foundingDate": "2025-01-01",
"representative": {
"document": "91315026015",
"email": "john.doe@example.com",
"name": "John Doe",
"role": "CFO"
},
"size": "Medium",
"status": "Active",
"tradeName": "Lerian Studio",
"type": "Limited Liability"
},
"metadata": {},
"name": "John Doe",
"naturalPerson": {
"birthDate": "1990-01-01",
"civilStatus": "Single",
"fatherName": "John Doe",
"favoriteName": "John",
"gender": "Male",
"motherName": "Jane Doe",
"nationality": "Brazilian",
"socialName": "John Doe",
"status": "Active"
},
"type": "NATURAL_PERSON"
}{
"code": "ERR-0001",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Create a Holder
curl --request POST \
--url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders \
--header 'Content-Type: application/json' \
--data '
{
"createdAt": "2025-01-01T00:00:00Z",
"deletedAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z",
"addresses": {},
"contact": {
"mobilePhone": "+1555555555",
"otherPhone": "+1555555555",
"primaryEmail": "john.doe@example.com",
"secondaryEmail": "john.doe@example.com"
},
"document": "91315026015",
"externalId": "G4K7N8M2",
"id": "00000000-0000-0000-0000-000000000000",
"legalPerson": {
"activity": "Electronic devices development",
"foundingDate": "2025-01-01",
"representative": {
"document": "91315026015",
"email": "john.doe@example.com",
"name": "John Doe",
"role": "CFO"
},
"size": "Medium",
"status": "Active",
"tradeName": "Lerian Studio",
"type": "Limited Liability"
},
"metadata": {},
"name": "John Doe",
"naturalPerson": {
"birthDate": "1990-01-01",
"civilStatus": "Single",
"fatherName": "John Doe",
"favoriteName": "John",
"gender": "Male",
"motherName": "Jane Doe",
"nationality": "Brazilian",
"socialName": "John Doe",
"status": "Active"
},
"type": "NATURAL_PERSON"
}
'import requests
url = "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders"
payload = {
"createdAt": "2025-01-01T00:00:00Z",
"deletedAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z",
"addresses": {},
"contact": {
"mobilePhone": "+1555555555",
"otherPhone": "+1555555555",
"primaryEmail": "john.doe@example.com",
"secondaryEmail": "john.doe@example.com"
},
"document": "91315026015",
"externalId": "G4K7N8M2",
"id": "00000000-0000-0000-0000-000000000000",
"legalPerson": {
"activity": "Electronic devices development",
"foundingDate": "2025-01-01",
"representative": {
"document": "91315026015",
"email": "john.doe@example.com",
"name": "John Doe",
"role": "CFO"
},
"size": "Medium",
"status": "Active",
"tradeName": "Lerian Studio",
"type": "Limited Liability"
},
"metadata": {},
"name": "John Doe",
"naturalPerson": {
"birthDate": "1990-01-01",
"civilStatus": "Single",
"fatherName": "John Doe",
"favoriteName": "John",
"gender": "Male",
"motherName": "Jane Doe",
"nationality": "Brazilian",
"socialName": "John Doe",
"status": "Active"
},
"type": "NATURAL_PERSON"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
createdAt: '2025-01-01T00:00:00Z',
deletedAt: '2025-01-01T00:00:00Z',
updatedAt: '2025-01-01T00:00:00Z',
addresses: {},
contact: {
mobilePhone: '+1555555555',
otherPhone: '+1555555555',
primaryEmail: 'john.doe@example.com',
secondaryEmail: 'john.doe@example.com'
},
document: '91315026015',
externalId: 'G4K7N8M2',
id: '00000000-0000-0000-0000-000000000000',
legalPerson: {
activity: 'Electronic devices development',
foundingDate: '2025-01-01',
representative: {
document: '91315026015',
email: 'john.doe@example.com',
name: 'John Doe',
role: 'CFO'
},
size: 'Medium',
status: 'Active',
tradeName: 'Lerian Studio',
type: 'Limited Liability'
},
metadata: {},
name: 'John Doe',
naturalPerson: {
birthDate: '1990-01-01',
civilStatus: 'Single',
fatherName: 'John Doe',
favoriteName: 'John',
gender: 'Male',
motherName: 'Jane Doe',
nationality: 'Brazilian',
socialName: 'John Doe',
status: 'Active'
},
type: 'NATURAL_PERSON'
})
};
fetch('https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders', 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://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders",
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([
'createdAt' => '2025-01-01T00:00:00Z',
'deletedAt' => '2025-01-01T00:00:00Z',
'updatedAt' => '2025-01-01T00:00:00Z',
'addresses' => [
],
'contact' => [
'mobilePhone' => '+1555555555',
'otherPhone' => '+1555555555',
'primaryEmail' => 'john.doe@example.com',
'secondaryEmail' => 'john.doe@example.com'
],
'document' => '91315026015',
'externalId' => 'G4K7N8M2',
'id' => '00000000-0000-0000-0000-000000000000',
'legalPerson' => [
'activity' => 'Electronic devices development',
'foundingDate' => '2025-01-01',
'representative' => [
'document' => '91315026015',
'email' => 'john.doe@example.com',
'name' => 'John Doe',
'role' => 'CFO'
],
'size' => 'Medium',
'status' => 'Active',
'tradeName' => 'Lerian Studio',
'type' => 'Limited Liability'
],
'metadata' => [
],
'name' => 'John Doe',
'naturalPerson' => [
'birthDate' => '1990-01-01',
'civilStatus' => 'Single',
'fatherName' => 'John Doe',
'favoriteName' => 'John',
'gender' => 'Male',
'motherName' => 'Jane Doe',
'nationality' => 'Brazilian',
'socialName' => 'John Doe',
'status' => 'Active'
],
'type' => 'NATURAL_PERSON'
]),
CURLOPT_HTTPHEADER => [
"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://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders"
payload := strings.NewReader("{\n \"createdAt\": \"2025-01-01T00:00:00Z\",\n \"deletedAt\": \"2025-01-01T00:00:00Z\",\n \"updatedAt\": \"2025-01-01T00:00:00Z\",\n \"addresses\": {},\n \"contact\": {\n \"mobilePhone\": \"+1555555555\",\n \"otherPhone\": \"+1555555555\",\n \"primaryEmail\": \"john.doe@example.com\",\n \"secondaryEmail\": \"john.doe@example.com\"\n },\n \"document\": \"91315026015\",\n \"externalId\": \"G4K7N8M2\",\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n \"legalPerson\": {\n \"activity\": \"Electronic devices development\",\n \"foundingDate\": \"2025-01-01\",\n \"representative\": {\n \"document\": \"91315026015\",\n \"email\": \"john.doe@example.com\",\n \"name\": \"John Doe\",\n \"role\": \"CFO\"\n },\n \"size\": \"Medium\",\n \"status\": \"Active\",\n \"tradeName\": \"Lerian Studio\",\n \"type\": \"Limited Liability\"\n },\n \"metadata\": {},\n \"name\": \"John Doe\",\n \"naturalPerson\": {\n \"birthDate\": \"1990-01-01\",\n \"civilStatus\": \"Single\",\n \"fatherName\": \"John Doe\",\n \"favoriteName\": \"John\",\n \"gender\": \"Male\",\n \"motherName\": \"Jane Doe\",\n \"nationality\": \"Brazilian\",\n \"socialName\": \"John Doe\",\n \"status\": \"Active\"\n },\n \"type\": \"NATURAL_PERSON\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders")
.header("Content-Type", "application/json")
.body("{\n \"createdAt\": \"2025-01-01T00:00:00Z\",\n \"deletedAt\": \"2025-01-01T00:00:00Z\",\n \"updatedAt\": \"2025-01-01T00:00:00Z\",\n \"addresses\": {},\n \"contact\": {\n \"mobilePhone\": \"+1555555555\",\n \"otherPhone\": \"+1555555555\",\n \"primaryEmail\": \"john.doe@example.com\",\n \"secondaryEmail\": \"john.doe@example.com\"\n },\n \"document\": \"91315026015\",\n \"externalId\": \"G4K7N8M2\",\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n \"legalPerson\": {\n \"activity\": \"Electronic devices development\",\n \"foundingDate\": \"2025-01-01\",\n \"representative\": {\n \"document\": \"91315026015\",\n \"email\": \"john.doe@example.com\",\n \"name\": \"John Doe\",\n \"role\": \"CFO\"\n },\n \"size\": \"Medium\",\n \"status\": \"Active\",\n \"tradeName\": \"Lerian Studio\",\n \"type\": \"Limited Liability\"\n },\n \"metadata\": {},\n \"name\": \"John Doe\",\n \"naturalPerson\": {\n \"birthDate\": \"1990-01-01\",\n \"civilStatus\": \"Single\",\n \"fatherName\": \"John Doe\",\n \"favoriteName\": \"John\",\n \"gender\": \"Male\",\n \"motherName\": \"Jane Doe\",\n \"nationality\": \"Brazilian\",\n \"socialName\": \"John Doe\",\n \"status\": \"Active\"\n },\n \"type\": \"NATURAL_PERSON\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"createdAt\": \"2025-01-01T00:00:00Z\",\n \"deletedAt\": \"2025-01-01T00:00:00Z\",\n \"updatedAt\": \"2025-01-01T00:00:00Z\",\n \"addresses\": {},\n \"contact\": {\n \"mobilePhone\": \"+1555555555\",\n \"otherPhone\": \"+1555555555\",\n \"primaryEmail\": \"john.doe@example.com\",\n \"secondaryEmail\": \"john.doe@example.com\"\n },\n \"document\": \"91315026015\",\n \"externalId\": \"G4K7N8M2\",\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n \"legalPerson\": {\n \"activity\": \"Electronic devices development\",\n \"foundingDate\": \"2025-01-01\",\n \"representative\": {\n \"document\": \"91315026015\",\n \"email\": \"john.doe@example.com\",\n \"name\": \"John Doe\",\n \"role\": \"CFO\"\n },\n \"size\": \"Medium\",\n \"status\": \"Active\",\n \"tradeName\": \"Lerian Studio\",\n \"type\": \"Limited Liability\"\n },\n \"metadata\": {},\n \"name\": \"John Doe\",\n \"naturalPerson\": {\n \"birthDate\": \"1990-01-01\",\n \"civilStatus\": \"Single\",\n \"fatherName\": \"John Doe\",\n \"favoriteName\": \"John\",\n \"gender\": \"Male\",\n \"motherName\": \"Jane Doe\",\n \"nationality\": \"Brazilian\",\n \"socialName\": \"John Doe\",\n \"status\": \"Active\"\n },\n \"type\": \"NATURAL_PERSON\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2025-01-01T00:00:00Z",
"deletedAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z",
"addresses": {
"additional1": {
"city": "New York",
"country": "US",
"line1": "123 Financial Avenue",
"line2": "Suite 1500",
"state": "NY",
"zipCode": "10001",
"description": "Home"
},
"additional2": {
"city": "New York",
"country": "US",
"line1": "123 Financial Avenue",
"line2": "Suite 1500",
"state": "NY",
"zipCode": "10001",
"description": "Home"
},
"primary": {
"city": "New York",
"country": "US",
"line1": "123 Financial Avenue",
"line2": "Suite 1500",
"state": "NY",
"zipCode": "10001",
"description": "Home"
}
},
"contact": {
"mobilePhone": "+1555555555",
"otherPhone": "+1555555555",
"primaryEmail": "john.doe@example.com",
"secondaryEmail": "john.doe@example.com"
},
"document": "91315026015",
"externalId": "G4K7N8M2",
"id": "00000000-0000-0000-0000-000000000000",
"legalPerson": {
"activity": "Electronic devices development",
"foundingDate": "2025-01-01",
"representative": {
"document": "91315026015",
"email": "john.doe@example.com",
"name": "John Doe",
"role": "CFO"
},
"size": "Medium",
"status": "Active",
"tradeName": "Lerian Studio",
"type": "Limited Liability"
},
"metadata": {},
"name": "John Doe",
"naturalPerson": {
"birthDate": "1990-01-01",
"civilStatus": "Single",
"fatherName": "John Doe",
"favoriteName": "John",
"gender": "Male",
"motherName": "Jane Doe",
"nationality": "Brazilian",
"socialName": "John Doe",
"status": "Active"
},
"type": "NATURAL_PERSON"
}{
"code": "ERR-0001",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Headers
The type of media of the resource. Recommended value is application/json.
A unique identifier used to trace and track each request.
Bearer JWT token for authentication.
Required when PLUGIN_AUTH_ENABLED=true (enforced in multi-tenant deployments).
Optional in default OSS single-tenant mode.
Format: Bearer <token>
A unique key that ensures transaction idempotency. If not provided, the system automatically generates a SHA-256 hash based on the request body. Keys are scoped per organization and ledger.
Always validate the X-Idempotency-Replayed response header to distinguish new transactions from cached replays.
See Retries and idempotency for best practices.
The time-to-live for the idempotency key, defined in seconds. Defaults to 300 seconds (5 minutes) if not provided. Only the TTL from the first request is used; changing it on retries has no effect.
See Retries and idempotency for details.
Path Parameters
The unique identifier of the Organization associated with the Ledger.
Body
"2025-01-01T00:00:00Z"
"2025-01-01T00:00:00Z"
"2025-01-01T00:00:00Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
100"91315026015"
256"G4K7N8M2"
"00000000-0000-0000-0000-000000000000"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
256"John Doe"
Show child attributes
Show child attributes
100"NATURAL_PERSON"
Response
OK
"2025-01-01T00:00:00Z"
"2025-01-01T00:00:00Z"
"2025-01-01T00:00:00Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
100"91315026015"
256"G4K7N8M2"
"00000000-0000-0000-0000-000000000000"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
256"John Doe"
Show child attributes
Show child attributes
100"NATURAL_PERSON"
Was this page helpful?

