Pular para o conteúdo principal
PATCH
/
v1
/
organizations
/
{organization_id}
/
holders
/
{holder_id}
/
instruments
/
{instrument_id}
Atualizar um Instrumento
curl --request PATCH \
  --url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders/{holder_id}/instruments/{instrument_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "deletedAt": "2023-11-07T05:31:56Z",
  "holderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "ledgerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updatedAt": "2023-11-07T05:31:56Z",
  "bankingDetails": {
    "account": "<string>",
    "bankId": "<string>",
    "branch": "<string>",
    "closingDate": "2023-12-25",
    "countryCode": "<string>",
    "iban": "<string>",
    "openingDate": "2023-12-25",
    "type": "<string>"
  },
  "document": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": {},
  "regulatoryFields": {
    "participantDocument": "<string>"
  },
  "relatedParties": [
    {
      "document": "<string>",
      "name": "<string>",
      "role": "<string>",
      "startDate": "2023-12-25",
      "endDate": "2023-12-25",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ],
  "type": "<string>"
}
'
import requests

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

payload = {
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"holderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z",
"bankingDetails": {
"account": "<string>",
"bankId": "<string>",
"branch": "<string>",
"closingDate": "2023-12-25",
"countryCode": "<string>",
"iban": "<string>",
"openingDate": "2023-12-25",
"type": "<string>"
},
"document": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"regulatoryFields": { "participantDocument": "<string>" },
"relatedParties": [
{
"document": "<string>",
"name": "<string>",
"role": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"type": "<string>"
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
createdAt: '2023-11-07T05:31:56Z',
deletedAt: '2023-11-07T05:31:56Z',
holderId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ledgerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
updatedAt: '2023-11-07T05:31:56Z',
bankingDetails: {
account: '<string>',
bankId: '<string>',
branch: '<string>',
closingDate: '2023-12-25',
countryCode: '<string>',
iban: '<string>',
openingDate: '2023-12-25',
type: '<string>'
},
document: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {},
regulatoryFields: {participantDocument: '<string>'},
relatedParties: [
{
document: '<string>',
name: '<string>',
role: '<string>',
startDate: '2023-12-25',
endDate: '2023-12-25',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
type: '<string>'
})
};

fetch('https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders/{holder_id}/instruments/{instrument_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://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders/{holder_id}/instruments/{instrument_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'createdAt' => '2023-11-07T05:31:56Z',
'deletedAt' => '2023-11-07T05:31:56Z',
'holderId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ledgerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'updatedAt' => '2023-11-07T05:31:56Z',
'bankingDetails' => [
'account' => '<string>',
'bankId' => '<string>',
'branch' => '<string>',
'closingDate' => '2023-12-25',
'countryCode' => '<string>',
'iban' => '<string>',
'openingDate' => '2023-12-25',
'type' => '<string>'
],
'document' => '<string>',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [

],
'regulatoryFields' => [
'participantDocument' => '<string>'
],
'relatedParties' => [
[
'document' => '<string>',
'name' => '<string>',
'role' => '<string>',
'startDate' => '2023-12-25',
'endDate' => '2023-12-25',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'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/{holder_id}/instruments/{instrument_id}"

payload := strings.NewReader("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\",\n \"holderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"bankingDetails\": {\n \"account\": \"<string>\",\n \"bankId\": \"<string>\",\n \"branch\": \"<string>\",\n \"closingDate\": \"2023-12-25\",\n \"countryCode\": \"<string>\",\n \"iban\": \"<string>\",\n \"openingDate\": \"2023-12-25\",\n \"type\": \"<string>\"\n },\n \"document\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"regulatoryFields\": {\n \"participantDocument\": \"<string>\"\n },\n \"relatedParties\": [\n {\n \"document\": \"<string>\",\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"type\": \"<string>\"\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders/{holder_id}/instruments/{instrument_id}")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\",\n \"holderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"bankingDetails\": {\n \"account\": \"<string>\",\n \"bankId\": \"<string>\",\n \"branch\": \"<string>\",\n \"closingDate\": \"2023-12-25\",\n \"countryCode\": \"<string>\",\n \"iban\": \"<string>\",\n \"openingDate\": \"2023-12-25\",\n \"type\": \"<string>\"\n },\n \"document\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"regulatoryFields\": {\n \"participantDocument\": \"<string>\"\n },\n \"relatedParties\": [\n {\n \"document\": \"<string>\",\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"type\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/holders/{holder_id}/instruments/{instrument_id}")

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

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\",\n \"holderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"bankingDetails\": {\n \"account\": \"<string>\",\n \"bankId\": \"<string>\",\n \"branch\": \"<string>\",\n \"closingDate\": \"2023-12-25\",\n \"countryCode\": \"<string>\",\n \"iban\": \"<string>\",\n \"openingDate\": \"2023-12-25\",\n \"type\": \"<string>\"\n },\n \"document\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"regulatoryFields\": {\n \"participantDocument\": \"<string>\"\n },\n \"relatedParties\": [\n {\n \"document\": \"<string>\",\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"type\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "deletedAt": "2023-11-07T05:31:56Z",
  "holderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "ledgerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updatedAt": "2023-11-07T05:31:56Z",
  "bankingDetails": {
    "account": "<string>",
    "bankId": "<string>",
    "branch": "<string>",
    "closingDate": "2023-12-25",
    "countryCode": "<string>",
    "iban": "<string>",
    "openingDate": "2023-12-25",
    "type": "<string>"
  },
  "document": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": {},
  "regulatoryFields": {
    "participantDocument": "<string>"
  },
  "relatedParties": [
    {
      "document": "<string>",
      "name": "<string>",
      "role": "<string>",
      "startDate": "2023-12-25",
      "endDate": "2023-12-25",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ],
  "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>

Parâmetros de caminho

organization_id
string<uuid>
obrigatório

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

holder_id
string
obrigatório

ID do titular (UUID)

instrument_id
string
obrigatório

ID do instrumento (UUID)

Corpo

application/json
accountId
string<uuid> | null
obrigatório
Exemplo:

"00000000-0000-0000-0000-000000000000"

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"

holderId
string<uuid>
obrigatório
Exemplo:

"00000000-0000-0000-0000-000000000000"

ledgerId
string<uuid> | null
obrigatório
Exemplo:

"00000000-0000-0000-0000-000000000000"

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

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

bankingDetails
object
document
string
Maximum string length: 100
Exemplo:

"91315026015"

id
string<uuid>
Exemplo:

"00000000-0000-0000-0000-000000000000"

metadata
object
regulatoryFields
object
type
string
Maximum string length: 100
Exemplo:

"NATURAL_PERSON"

Resposta

OK

accountId
string<uuid> | null
obrigatório
Exemplo:

"00000000-0000-0000-0000-000000000000"

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"

holderId
string<uuid>
obrigatório
Exemplo:

"00000000-0000-0000-0000-000000000000"

ledgerId
string<uuid> | null
obrigatório
Exemplo:

"00000000-0000-0000-0000-000000000000"

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

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

bankingDetails
object
document
string
Maximum string length: 100
Exemplo:

"91315026015"

id
string<uuid>
Exemplo:

"00000000-0000-0000-0000-000000000000"

metadata
object
regulatoryFields
object
type
string
Maximum string length: 100
Exemplo:

"NATURAL_PERSON"