Pular para o conteúdo principal
POST
/
v1
/
organizations
/
{organization_id}
/
ledgers
/
{ledger_id}
/
holders
/
{holder_id}
/
accounts
Abrir uma conta de titularidade do titular (com instrumento opcional)
curl --request POST \
  --url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/holders/{holder_id}/accounts
import requests

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

response = requests.post(url)

print(response.text)
const options = {method: 'POST'};

fetch('https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/holders/{holder_id}/accounts', 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}/ledgers/{ledger_id}/holders/{holder_id}/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

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

req, _ := http.NewRequest("POST", url, nil)

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}/ledgers/{ledger_id}/holders/{holder_id}/accounts")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
{
  "account": {
    "alias": "<string>",
    "assetCode": "<string>",
    "blocked": true,
    "createdAt": "2023-11-07T05:31:56Z",
    "deletedAt": "2023-11-07T05:31:56Z",
    "entityId": "<string>",
    "holderCheckSkipped": true,
    "holderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "ledgerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "parentAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "portfolioId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "segmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": {
      "description": "<string>"
    },
    "type": "<string>",
    "updatedAt": "2023-11-07T05:31:56Z",
    "metadata": {}
  },
  "instrument": {
    "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>"
  },
  "instrumentError": {
    "reason": "<string>",
    "status": "<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.

ledger_id
string<uuid>
obrigatório

O identificador único do Ledger associado.

holder_id
string
obrigatório

ID do titular (UUID)

Resposta

OK

account
object
obrigatório
instrument
object
obrigatório
instrumentError
object