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"
}Crear un titular
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"
}Encabezados
El tipo de medio del recurso. El valor recomendado es application/json.
Un identificador único utilizado para rastrear y seguir cada solicitud.
Token JWT bearer para autenticación.
Requerido cuando PLUGIN_AUTH_ENABLED=true (obligatorio en despliegues multiinquilino).
Opcional en el modo OSS de inquilino único predeterminado.
Formato: Bearer <token>
Una clave única que garantiza la idempotencia de la transacción. Si no se proporciona, el sistema genera automáticamente un hash SHA-256 basado en el cuerpo de la solicitud. Las claves están delimitadas por organización y ledger.
Siempre valide el header de respuesta X-Idempotency-Replayed para distinguir transacciones nuevas de reproducciones en caché.
Consulte Reintentos e idempotencia para mejores prácticas.
El tiempo de vida (TTL) de la clave de idempotencia, definido en segundos. Si no se proporciona, el valor predeterminado es 300 segundos (5 minutos). Solo se usa el TTL de la primera solicitud; cambiarlo en reintentos no tiene efecto.
Consulte Reintentos e idempotencia para más detalles.
Parámetros de ruta
El identificador único de la Organización asociada al Ledger.
Cuerpo
"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"
Respuesta
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"
¿Esta página le ayudó?

