Pular para o conteúdo principal
POST
/
v1
/
organizations
/
{organization_id}
/
holders
Criar um Titular
curl --request POST \
  --url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders \
  --header 'Content-Type: application/json' \
  --data '
{
  "createdAt": "2023-11-07T05:31:56Z",
  "deletedAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "addresses": {},
  "contact": {
    "mobilePhone": "<string>",
    "otherPhone": "<string>",
    "primaryEmail": "<string>",
    "secondaryEmail": "<string>"
  },
  "document": "<string>",
  "externalId": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "legalPerson": {
    "activity": "<string>",
    "foundingDate": "2023-12-25",
    "representative": {
      "document": "<string>",
      "email": "<string>",
      "name": "<string>",
      "role": "<string>"
    },
    "size": "<string>",
    "status": "<string>",
    "tradeName": "<string>",
    "type": "<string>"
  },
  "metadata": {},
  "name": "<string>",
  "naturalPerson": {
    "birthDate": "2023-12-25",
    "civilStatus": "<string>",
    "fatherName": "<string>",
    "favoriteName": "<string>",
    "gender": "<string>",
    "motherName": "<string>",
    "nationality": "<string>",
    "socialName": "<string>",
    "status": "<string>"
  },
  "type": "<string>"
}
'
import requests

url = "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders"

payload = {
    "createdAt": "2023-11-07T05:31:56Z",
    "deletedAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "addresses": {},
    "contact": {
        "mobilePhone": "<string>",
        "otherPhone": "<string>",
        "primaryEmail": "<string>",
        "secondaryEmail": "<string>"
    },
    "document": "<string>",
    "externalId": "<string>",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "legalPerson": {
        "activity": "<string>",
        "foundingDate": "2023-12-25",
        "representative": {
            "document": "<string>",
            "email": "<string>",
            "name": "<string>",
            "role": "<string>"
        },
        "size": "<string>",
        "status": "<string>",
        "tradeName": "<string>",
        "type": "<string>"
    },
    "metadata": {},
    "name": "<string>",
    "naturalPerson": {
        "birthDate": "2023-12-25",
        "civilStatus": "<string>",
        "fatherName": "<string>",
        "favoriteName": "<string>",
        "gender": "<string>",
        "motherName": "<string>",
        "nationality": "<string>",
        "socialName": "<string>",
        "status": "<string>"
    },
    "type": "<string>"
}
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: '2023-11-07T05:31:56Z',
    deletedAt: '2023-11-07T05:31:56Z',
    updatedAt: '2023-11-07T05:31:56Z',
    addresses: {},
    contact: {
      mobilePhone: '<string>',
      otherPhone: '<string>',
      primaryEmail: '<string>',
      secondaryEmail: '<string>'
    },
    document: '<string>',
    externalId: '<string>',
    id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    legalPerson: {
      activity: '<string>',
      foundingDate: '2023-12-25',
      representative: {document: '<string>', email: '<string>', name: '<string>', role: '<string>'},
      size: '<string>',
      status: '<string>',
      tradeName: '<string>',
      type: '<string>'
    },
    metadata: {},
    name: '<string>',
    naturalPerson: {
      birthDate: '2023-12-25',
      civilStatus: '<string>',
      fatherName: '<string>',
      favoriteName: '<string>',
      gender: '<string>',
      motherName: '<string>',
      nationality: '<string>',
      socialName: '<string>',
      status: '<string>'
    },
    type: '<string>'
  })
};

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' => '2023-11-07T05:31:56Z',
    'deletedAt' => '2023-11-07T05:31:56Z',
    'updatedAt' => '2023-11-07T05:31:56Z',
    'addresses' => [
        
    ],
    'contact' => [
        'mobilePhone' => '<string>',
        'otherPhone' => '<string>',
        'primaryEmail' => '<string>',
        'secondaryEmail' => '<string>'
    ],
    'document' => '<string>',
    'externalId' => '<string>',
    'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'legalPerson' => [
        'activity' => '<string>',
        'foundingDate' => '2023-12-25',
        'representative' => [
                'document' => '<string>',
                'email' => '<string>',
                'name' => '<string>',
                'role' => '<string>'
        ],
        'size' => '<string>',
        'status' => '<string>',
        'tradeName' => '<string>',
        'type' => '<string>'
    ],
    'metadata' => [
        
    ],
    'name' => '<string>',
    'naturalPerson' => [
        'birthDate' => '2023-12-25',
        'civilStatus' => '<string>',
        'fatherName' => '<string>',
        'favoriteName' => '<string>',
        'gender' => '<string>',
        'motherName' => '<string>',
        'nationality' => '<string>',
        'socialName' => '<string>',
        'status' => '<string>'
    ],
    'type' => '<string>'
  ]),
  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\": \"2023-11-07T05:31:56Z\",\n  \"deletedAt\": \"2023-11-07T05:31:56Z\",\n  \"updatedAt\": \"2023-11-07T05:31:56Z\",\n  \"addresses\": {},\n  \"contact\": {\n    \"mobilePhone\": \"<string>\",\n    \"otherPhone\": \"<string>\",\n    \"primaryEmail\": \"<string>\",\n    \"secondaryEmail\": \"<string>\"\n  },\n  \"document\": \"<string>\",\n  \"externalId\": \"<string>\",\n  \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"legalPerson\": {\n    \"activity\": \"<string>\",\n    \"foundingDate\": \"2023-12-25\",\n    \"representative\": {\n      \"document\": \"<string>\",\n      \"email\": \"<string>\",\n      \"name\": \"<string>\",\n      \"role\": \"<string>\"\n    },\n    \"size\": \"<string>\",\n    \"status\": \"<string>\",\n    \"tradeName\": \"<string>\",\n    \"type\": \"<string>\"\n  },\n  \"metadata\": {},\n  \"name\": \"<string>\",\n  \"naturalPerson\": {\n    \"birthDate\": \"2023-12-25\",\n    \"civilStatus\": \"<string>\",\n    \"fatherName\": \"<string>\",\n    \"favoriteName\": \"<string>\",\n    \"gender\": \"<string>\",\n    \"motherName\": \"<string>\",\n    \"nationality\": \"<string>\",\n    \"socialName\": \"<string>\",\n    \"status\": \"<string>\"\n  },\n  \"type\": \"<string>\"\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\": \"2023-11-07T05:31:56Z\",\n  \"deletedAt\": \"2023-11-07T05:31:56Z\",\n  \"updatedAt\": \"2023-11-07T05:31:56Z\",\n  \"addresses\": {},\n  \"contact\": {\n    \"mobilePhone\": \"<string>\",\n    \"otherPhone\": \"<string>\",\n    \"primaryEmail\": \"<string>\",\n    \"secondaryEmail\": \"<string>\"\n  },\n  \"document\": \"<string>\",\n  \"externalId\": \"<string>\",\n  \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"legalPerson\": {\n    \"activity\": \"<string>\",\n    \"foundingDate\": \"2023-12-25\",\n    \"representative\": {\n      \"document\": \"<string>\",\n      \"email\": \"<string>\",\n      \"name\": \"<string>\",\n      \"role\": \"<string>\"\n    },\n    \"size\": \"<string>\",\n    \"status\": \"<string>\",\n    \"tradeName\": \"<string>\",\n    \"type\": \"<string>\"\n  },\n  \"metadata\": {},\n  \"name\": \"<string>\",\n  \"naturalPerson\": {\n    \"birthDate\": \"2023-12-25\",\n    \"civilStatus\": \"<string>\",\n    \"fatherName\": \"<string>\",\n    \"favoriteName\": \"<string>\",\n    \"gender\": \"<string>\",\n    \"motherName\": \"<string>\",\n    \"nationality\": \"<string>\",\n    \"socialName\": \"<string>\",\n    \"status\": \"<string>\"\n  },\n  \"type\": \"<string>\"\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\": \"2023-11-07T05:31:56Z\",\n  \"deletedAt\": \"2023-11-07T05:31:56Z\",\n  \"updatedAt\": \"2023-11-07T05:31:56Z\",\n  \"addresses\": {},\n  \"contact\": {\n    \"mobilePhone\": \"<string>\",\n    \"otherPhone\": \"<string>\",\n    \"primaryEmail\": \"<string>\",\n    \"secondaryEmail\": \"<string>\"\n  },\n  \"document\": \"<string>\",\n  \"externalId\": \"<string>\",\n  \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"legalPerson\": {\n    \"activity\": \"<string>\",\n    \"foundingDate\": \"2023-12-25\",\n    \"representative\": {\n      \"document\": \"<string>\",\n      \"email\": \"<string>\",\n      \"name\": \"<string>\",\n      \"role\": \"<string>\"\n    },\n    \"size\": \"<string>\",\n    \"status\": \"<string>\",\n    \"tradeName\": \"<string>\",\n    \"type\": \"<string>\"\n  },\n  \"metadata\": {},\n  \"name\": \"<string>\",\n  \"naturalPerson\": {\n    \"birthDate\": \"2023-12-25\",\n    \"civilStatus\": \"<string>\",\n    \"fatherName\": \"<string>\",\n    \"favoriteName\": \"<string>\",\n    \"gender\": \"<string>\",\n    \"motherName\": \"<string>\",\n    \"nationality\": \"<string>\",\n    \"socialName\": \"<string>\",\n    \"status\": \"<string>\"\n  },\n  \"type\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "createdAt": "2023-11-07T05:31:56Z",
  "deletedAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "addresses": {
    "additional1": {
      "city": "<string>",
      "country": "<string>",
      "line1": "<string>",
      "line2": "<string>",
      "state": "<string>",
      "zipCode": "<string>",
      "description": "<string>"
    },
    "additional2": {
      "city": "<string>",
      "country": "<string>",
      "line1": "<string>",
      "line2": "<string>",
      "state": "<string>",
      "zipCode": "<string>",
      "description": "<string>"
    },
    "primary": {
      "city": "<string>",
      "country": "<string>",
      "line1": "<string>",
      "line2": "<string>",
      "state": "<string>",
      "zipCode": "<string>",
      "description": "<string>"
    }
  },
  "contact": {
    "mobilePhone": "<string>",
    "otherPhone": "<string>",
    "primaryEmail": "<string>",
    "secondaryEmail": "<string>"
  },
  "document": "<string>",
  "externalId": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "legalPerson": {
    "activity": "<string>",
    "foundingDate": "2023-12-25",
    "representative": {
      "document": "<string>",
      "email": "<string>",
      "name": "<string>",
      "role": "<string>"
    },
    "size": "<string>",
    "status": "<string>",
    "tradeName": "<string>",
    "type": "<string>"
  },
  "metadata": {},
  "name": "<string>",
  "naturalPerson": {
    "birthDate": "2023-12-25",
    "civilStatus": "<string>",
    "fatherName": "<string>",
    "favoriteName": "<string>",
    "gender": "<string>",
    "motherName": "<string>",
    "nationality": "<string>",
    "socialName": "<string>",
    "status": "<string>"
  },
  "type": "<string>"
}
{
  "code": "<string>",
  "detail": "<string>",
  "errors": [
    {
      "location": "<string>",
      "message": "<string>",
      "value": "<unknown>"
    }
  ],
  "instance": "<string>",
  "status": 123,
  "title": "<string>",
  "type": "about:blank"
}

Cabeçalhos

Content-Type
string

O tipo de mídia do recurso. O valor recomendado é application/json.

X-Request-Id
string<uuid>

Um identificador único utilizado para rastrear e acompanhar cada requisição.

Authorization
string

Token JWT bearer para autenticação. Obrigatório quando PLUGIN_AUTH_ENABLED=true (exigido em implantações multi-tenant). Opcional no modo OSS single-tenant padrão. Formato: Bearer <token>

X-Idempotency
string

Uma chave única que garante a idempotência da transação. Se não fornecida, o sistema gera automaticamente um hash SHA-256 com base no corpo da requisição. As chaves são escopadas por organização e ledger.

Sempre valide o header de resposta X-Idempotency-Replayed para distinguir transações novas de replays em cache.

Consulte Retentativas e idempotência para boas práticas.

X-TTL
integer

O tempo de vida (TTL) da chave de idempotência, definido em segundos. Se não fornecido, o padrão é 300 segundos (5 minutos). Apenas o TTL da primeira requisição é utilizado; alterá-lo em retentativas não tem efeito.

Consulte Retentativas e idempotência para mais detalhes.

Parâmetros de caminho

organization_id
string<uuid>
obrigatório

O identificador único da Organização associada ao Ledger.

Corpo

application/json
createdAt
string<date-time>
obrigatório
Exemplo:

"2025-01-01T00:00:00Z"

deletedAt
string<date-time> | null
obrigatório
Exemplo:

"2025-01-01T00:00:00Z"

updatedAt
string<date-time>
obrigatório
Exemplo:

"2025-01-01T00:00:00Z"

addresses
object
contact
object
document
string
Maximum string length: 100
Exemplo:

"91315026015"

externalId
string
Maximum string length: 256
Exemplo:

"G4K7N8M2"

id
string<uuid>
Exemplo:

"00000000-0000-0000-0000-000000000000"

metadata
object
name
string
Maximum string length: 256
Exemplo:

"John Doe"

naturalPerson
object
type
string
Maximum string length: 100
Exemplo:

"NATURAL_PERSON"

Resposta

OK

createdAt
string<date-time>
obrigatório
Exemplo:

"2025-01-01T00:00:00Z"

deletedAt
string<date-time> | null
obrigatório
Exemplo:

"2025-01-01T00:00:00Z"

updatedAt
string<date-time>
obrigatório
Exemplo:

"2025-01-01T00:00:00Z"

addresses
object
contact
object
document
string
Maximum string length: 100
Exemplo:

"91315026015"

externalId
string
Maximum string length: 256
Exemplo:

"G4K7N8M2"

id
string<uuid>
Exemplo:

"00000000-0000-0000-0000-000000000000"

metadata
object
name
string
Maximum string length: 256
Exemplo:

"John Doe"

naturalPerson
object
type
string
Maximum string length: 100
Exemplo:

"NATURAL_PERSON"