Saltar al contenido principal
GET
/
v1
/
organizations
/
{organization_id}
/
ledgers
/
{ledger_id}
/
asset-rates
/
from
/
{asset_code}
Obtener una tasa de activo por el código de activo
curl --request GET \
  --url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/asset-rates/from/{asset_code}
import requests

url = "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/asset-rates/from/{asset_code}"

response = requests.get(url)

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

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

$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}/asset-rates/from/{asset_code}"

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

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/asset-rates/from/{asset_code}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/asset-rates/from/{asset_code}")

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

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

response = http.request(request)
puts response.read_body
{
  "items": "<unknown>",
  "limit": 123,
  "next_cursor": "<string>",
  "page": 123,
  "prev_cursor": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Encabezados

X-Request-Id
string<uuid>

Un identificador único utilizado para rastrear y seguir cada solicitud.

Authorization
string

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>

Parámetros de ruta

organization_id
string<uuid>
requerido

El identificador único de la Organización asociada al Ledger.

ledger_id
string<uuid>
requerido

El identificador único del Ledger asociado.

asset_code
string
requerido

Código de activo (por ejemplo, USD o BRL)

Parámetros de consulta

to
string[] | null

Filter by destination asset codes Filtra por códigos de activo de destino

limit
string

Max items per page (1-100, default 10) Máximo de elementos por página (1-100, predeterminado 10)

start_date
string

Filter asset rates created on/after this date (YYYY-MM-DD) Filtra las tasas de activo creadas en/después de esta fecha (YYYY-MM-DD)

end_date
string

Filter asset rates created on/before this date (YYYY-MM-DD) Filtra las tasas de activo creadas en/antes de esta fecha (YYYY-MM-DD)

sort_order
string

Sort direction (asc, desc) Dirección de ordenamiento (asc, desc)

cursor
string

Opaque cursor token for pagination Token de cursor opaco para la paginación

Respuesta

OK

items
any
requerido
limit
integer<int64>
requerido
Ejemplo:

10

next_cursor
string
Ejemplo:

"eyJpZCI6IjAxOTI..."

page
integer<int64>
Ejemplo:

1

prev_cursor
string
Ejemplo:

"eyJpZCI6IjAxOTE..."