Create a fee estimate calculation
curl --request POST \
--url https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/ledgers/{ledger_id}/estimates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"packageId": "00000000-0000-0000-0000-000000000000",
"transaction": {
"send": {
"asset": "BRL",
"distribute": {
"remaining": "<string>",
"to": [
{
"chartOfAccounts": "1000",
"metadata": {},
"accountAlias": "@person1",
"amount": {
"asset": "BRL",
"value": "1000"
},
"balanceKey": "asset-freeze",
"description": "description",
"isFrom": true,
"remaining": "remaining",
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"share": {
"percentage": 123,
"percentageOfPercentage": 123
}
}
]
},
"source": {
"from": [
{
"chartOfAccounts": "1000",
"metadata": {},
"accountAlias": "@person1",
"amount": {
"asset": "BRL",
"value": "1000"
},
"balanceKey": "asset-freeze",
"description": "description",
"isFrom": true,
"remaining": "remaining",
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"share": {
"percentage": 123,
"percentageOfPercentage": 123
}
}
],
"remaining": "remaining"
},
"value": "1000"
},
"chartOfAccountsGroupName": "FUNDING",
"code": "00000000-0000-0000-0000-000000000000",
"description": "Description",
"metadata": {},
"pending": false,
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"transactionDate": "2021-01-01T00:00:00Z"
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/ledgers/{ledger_id}/estimates"
payload := strings.NewReader("{\n \"packageId\": \"00000000-0000-0000-0000-000000000000\",\n \"transaction\": {\n \"send\": {\n \"asset\": \"BRL\",\n \"distribute\": {\n \"remaining\": \"<string>\",\n \"to\": [\n {\n \"chartOfAccounts\": \"1000\",\n \"metadata\": {},\n \"accountAlias\": \"@person1\",\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"1000\"\n },\n \"balanceKey\": \"asset-freeze\",\n \"description\": \"description\",\n \"isFrom\": true,\n \"remaining\": \"remaining\",\n \"route\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"share\": {\n \"percentage\": 123,\n \"percentageOfPercentage\": 123\n }\n }\n ]\n },\n \"source\": {\n \"from\": [\n {\n \"chartOfAccounts\": \"1000\",\n \"metadata\": {},\n \"accountAlias\": \"@person1\",\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"1000\"\n },\n \"balanceKey\": \"asset-freeze\",\n \"description\": \"description\",\n \"isFrom\": true,\n \"remaining\": \"remaining\",\n \"route\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"share\": {\n \"percentage\": 123,\n \"percentageOfPercentage\": 123\n }\n }\n ],\n \"remaining\": \"remaining\"\n },\n \"value\": \"1000\"\n },\n \"chartOfAccountsGroupName\": \"FUNDING\",\n \"code\": \"00000000-0000-0000-0000-000000000000\",\n \"description\": \"Description\",\n \"metadata\": {},\n \"pending\": false,\n \"route\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"transactionDate\": \"2021-01-01T00:00:00Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
packageId: '00000000-0000-0000-0000-000000000000',
transaction: {
send: {
asset: 'BRL',
distribute: {
remaining: '<string>',
to: [
{
chartOfAccounts: '1000',
metadata: {},
accountAlias: '@person1',
amount: {asset: 'BRL', value: '1000'},
balanceKey: 'asset-freeze',
description: 'description',
isFrom: true,
remaining: 'remaining',
route: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
share: {percentage: 123, percentageOfPercentage: 123}
}
]
},
source: {
from: [
{
chartOfAccounts: '1000',
metadata: {},
accountAlias: '@person1',
amount: {asset: 'BRL', value: '1000'},
balanceKey: 'asset-freeze',
description: 'description',
isFrom: true,
remaining: 'remaining',
route: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
share: {percentage: 123, percentageOfPercentage: 123}
}
],
remaining: 'remaining'
},
value: '1000'
},
chartOfAccountsGroupName: 'FUNDING',
code: '00000000-0000-0000-0000-000000000000',
description: 'Description',
metadata: {},
pending: false,
route: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
transactionDate: '2021-01-01T00:00:00Z'
}
})
};
fetch('https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/ledgers/{ledger_id}/estimates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/ledgers/{ledger_id}/estimates"
payload = {
"packageId": "00000000-0000-0000-0000-000000000000",
"transaction": {
"send": {
"asset": "BRL",
"distribute": {
"remaining": "<string>",
"to": [
{
"chartOfAccounts": "1000",
"metadata": {},
"accountAlias": "@person1",
"amount": {
"asset": "BRL",
"value": "1000"
},
"balanceKey": "asset-freeze",
"description": "description",
"isFrom": True,
"remaining": "remaining",
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"share": {
"percentage": 123,
"percentageOfPercentage": 123
}
}
]
},
"source": {
"from": [
{
"chartOfAccounts": "1000",
"metadata": {},
"accountAlias": "@person1",
"amount": {
"asset": "BRL",
"value": "1000"
},
"balanceKey": "asset-freeze",
"description": "description",
"isFrom": True,
"remaining": "remaining",
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"share": {
"percentage": 123,
"percentageOfPercentage": 123
}
}
],
"remaining": "remaining"
},
"value": "1000"
},
"chartOfAccountsGroupName": "FUNDING",
"code": "00000000-0000-0000-0000-000000000000",
"description": "Description",
"metadata": {},
"pending": False,
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"transactionDate": "2021-01-01T00:00:00Z"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)"<string>"{
"code": "<string>",
"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",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"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",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"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",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Create a fee estimate calculation
POST
/
v2
/
organizations
/
{organization_id}
/
ledgers
/
{ledger_id}
/
estimates
Create a fee estimate calculation
curl --request POST \
--url https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/ledgers/{ledger_id}/estimates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"packageId": "00000000-0000-0000-0000-000000000000",
"transaction": {
"send": {
"asset": "BRL",
"distribute": {
"remaining": "<string>",
"to": [
{
"chartOfAccounts": "1000",
"metadata": {},
"accountAlias": "@person1",
"amount": {
"asset": "BRL",
"value": "1000"
},
"balanceKey": "asset-freeze",
"description": "description",
"isFrom": true,
"remaining": "remaining",
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"share": {
"percentage": 123,
"percentageOfPercentage": 123
}
}
]
},
"source": {
"from": [
{
"chartOfAccounts": "1000",
"metadata": {},
"accountAlias": "@person1",
"amount": {
"asset": "BRL",
"value": "1000"
},
"balanceKey": "asset-freeze",
"description": "description",
"isFrom": true,
"remaining": "remaining",
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"share": {
"percentage": 123,
"percentageOfPercentage": 123
}
}
],
"remaining": "remaining"
},
"value": "1000"
},
"chartOfAccountsGroupName": "FUNDING",
"code": "00000000-0000-0000-0000-000000000000",
"description": "Description",
"metadata": {},
"pending": false,
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"transactionDate": "2021-01-01T00:00:00Z"
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/ledgers/{ledger_id}/estimates"
payload := strings.NewReader("{\n \"packageId\": \"00000000-0000-0000-0000-000000000000\",\n \"transaction\": {\n \"send\": {\n \"asset\": \"BRL\",\n \"distribute\": {\n \"remaining\": \"<string>\",\n \"to\": [\n {\n \"chartOfAccounts\": \"1000\",\n \"metadata\": {},\n \"accountAlias\": \"@person1\",\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"1000\"\n },\n \"balanceKey\": \"asset-freeze\",\n \"description\": \"description\",\n \"isFrom\": true,\n \"remaining\": \"remaining\",\n \"route\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"share\": {\n \"percentage\": 123,\n \"percentageOfPercentage\": 123\n }\n }\n ]\n },\n \"source\": {\n \"from\": [\n {\n \"chartOfAccounts\": \"1000\",\n \"metadata\": {},\n \"accountAlias\": \"@person1\",\n \"amount\": {\n \"asset\": \"BRL\",\n \"value\": \"1000\"\n },\n \"balanceKey\": \"asset-freeze\",\n \"description\": \"description\",\n \"isFrom\": true,\n \"remaining\": \"remaining\",\n \"route\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"share\": {\n \"percentage\": 123,\n \"percentageOfPercentage\": 123\n }\n }\n ],\n \"remaining\": \"remaining\"\n },\n \"value\": \"1000\"\n },\n \"chartOfAccountsGroupName\": \"FUNDING\",\n \"code\": \"00000000-0000-0000-0000-000000000000\",\n \"description\": \"Description\",\n \"metadata\": {},\n \"pending\": false,\n \"route\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"transactionDate\": \"2021-01-01T00:00:00Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
packageId: '00000000-0000-0000-0000-000000000000',
transaction: {
send: {
asset: 'BRL',
distribute: {
remaining: '<string>',
to: [
{
chartOfAccounts: '1000',
metadata: {},
accountAlias: '@person1',
amount: {asset: 'BRL', value: '1000'},
balanceKey: 'asset-freeze',
description: 'description',
isFrom: true,
remaining: 'remaining',
route: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
share: {percentage: 123, percentageOfPercentage: 123}
}
]
},
source: {
from: [
{
chartOfAccounts: '1000',
metadata: {},
accountAlias: '@person1',
amount: {asset: 'BRL', value: '1000'},
balanceKey: 'asset-freeze',
description: 'description',
isFrom: true,
remaining: 'remaining',
route: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
share: {percentage: 123, percentageOfPercentage: 123}
}
],
remaining: 'remaining'
},
value: '1000'
},
chartOfAccountsGroupName: 'FUNDING',
code: '00000000-0000-0000-0000-000000000000',
description: 'Description',
metadata: {},
pending: false,
route: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
transactionDate: '2021-01-01T00:00:00Z'
}
})
};
fetch('https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/ledgers/{ledger_id}/estimates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/ledgers/{ledger_id}/estimates"
payload = {
"packageId": "00000000-0000-0000-0000-000000000000",
"transaction": {
"send": {
"asset": "BRL",
"distribute": {
"remaining": "<string>",
"to": [
{
"chartOfAccounts": "1000",
"metadata": {},
"accountAlias": "@person1",
"amount": {
"asset": "BRL",
"value": "1000"
},
"balanceKey": "asset-freeze",
"description": "description",
"isFrom": True,
"remaining": "remaining",
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"share": {
"percentage": 123,
"percentageOfPercentage": 123
}
}
]
},
"source": {
"from": [
{
"chartOfAccounts": "1000",
"metadata": {},
"accountAlias": "@person1",
"amount": {
"asset": "BRL",
"value": "1000"
},
"balanceKey": "asset-freeze",
"description": "description",
"isFrom": True,
"remaining": "remaining",
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"share": {
"percentage": 123,
"percentageOfPercentage": 123
}
}
],
"remaining": "remaining"
},
"value": "1000"
},
"chartOfAccountsGroupName": "FUNDING",
"code": "00000000-0000-0000-0000-000000000000",
"description": "Description",
"metadata": {},
"pending": False,
"route": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"transactionDate": "2021-01-01T00:00:00Z"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)"<string>"{
"code": "<string>",
"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",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"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",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"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",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Authorizations
JWT bearer token issued by the identity provider.
Path Parameters
Organization ID (UUID)
Ledger ID (UUID)
Body
application/json
Response
OK
The response is of type string.
Was this page helpful?

