curl --request POST \
--url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/outflow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"pending": true,
"send": {
"asset": "BRL",
"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": "WITHDRAWAL",
"code": "TR12345",
"description": "New Outflow Transaction",
"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/v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/outflow"
payload := strings.NewReader("{\n \"metadata\": {},\n \"pending\": true,\n \"send\": {\n \"asset\": \"BRL\",\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\": \"WITHDRAWAL\",\n \"code\": \"TR12345\",\n \"description\": \"New Outflow Transaction\",\n \"route\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"transactionDate\": \"2021-01-01T00:00:00Z\"\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({
metadata: {},
pending: true,
send: {
asset: 'BRL',
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: 'WITHDRAWAL',
code: 'TR12345',
description: 'New Outflow Transaction',
route: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
transactionDate: '2021-01-01T00:00:00Z'
})
};
fetch('https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/outflow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/outflow"
payload = {
"metadata": {},
"pending": True,
"send": {
"asset": "BRL",
"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": "WITHDRAWAL",
"code": "TR12345",
"description": "New Outflow Transaction",
"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){
"amount": "1500",
"assetCode": "BRL",
"chartOfAccountsGroupName": "Chart of accounts group name",
"createdAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"description": "Transaction description",
"destination": [
"@person2"
],
"id": "00000000-0000-0000-0000-000000000000",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"operations": [
{
"accountAlias": "@person1",
"accountId": "00000000-0000-0000-0000-000000000000",
"amount": {
"value": "1500"
},
"assetCode": "BRL",
"balance": {
"available": "1500",
"onHold": "500",
"overdraftUsed": "130",
"version": 2
},
"balanceAffected": true,
"balanceAfter": {
"available": "1500",
"onHold": "500",
"overdraftUsed": "130",
"version": 2
},
"balanceId": "00000000-0000-0000-0000-000000000000",
"balanceKey": "asset-freeze",
"chartOfAccounts": "1000",
"createdAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"description": "Credit card operation",
"id": "00000000-0000-0000-0000-000000000000",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"metadata": {},
"organizationId": "00000000-0000-0000-0000-000000000000",
"route": "00000000-0000-0000-0000-000000000000",
"status": {
"code": "ACTIVE",
"description": "Active status"
},
"transactionId": "00000000-0000-0000-0000-000000000000",
"type": "DEBIT",
"updatedAt": "2021-01-01T00:00:00Z",
"direction": "debit",
"routeCode": "ROUTE-001",
"routeDescription": "Settlement route for service charges",
"routeId": "00000000-0000-0000-0000-000000000000"
}
],
"organizationId": "00000000-0000-0000-0000-000000000000",
"route": "00000000-0000-0000-0000-000000000000",
"source": [
"@person1"
],
"status": {
"code": "ACTIVE",
"description": "Active status"
},
"updatedAt": "2021-01-01T00:00:00Z",
"groupId": "00000000-0000-0000-0000-000000000000",
"metadata": {},
"parentTransactionId": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000"
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}Create a Transaction without passing to distribution
curl --request POST \
--url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/outflow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"pending": true,
"send": {
"asset": "BRL",
"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": "WITHDRAWAL",
"code": "TR12345",
"description": "New Outflow Transaction",
"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/v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/outflow"
payload := strings.NewReader("{\n \"metadata\": {},\n \"pending\": true,\n \"send\": {\n \"asset\": \"BRL\",\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\": \"WITHDRAWAL\",\n \"code\": \"TR12345\",\n \"description\": \"New Outflow Transaction\",\n \"route\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"transactionDate\": \"2021-01-01T00:00:00Z\"\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({
metadata: {},
pending: true,
send: {
asset: 'BRL',
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: 'WITHDRAWAL',
code: 'TR12345',
description: 'New Outflow Transaction',
route: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
transactionDate: '2021-01-01T00:00:00Z'
})
};
fetch('https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/outflow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/transactions/outflow"
payload = {
"metadata": {},
"pending": True,
"send": {
"asset": "BRL",
"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": "WITHDRAWAL",
"code": "TR12345",
"description": "New Outflow Transaction",
"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){
"amount": "1500",
"assetCode": "BRL",
"chartOfAccountsGroupName": "Chart of accounts group name",
"createdAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"description": "Transaction description",
"destination": [
"@person2"
],
"id": "00000000-0000-0000-0000-000000000000",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"operations": [
{
"accountAlias": "@person1",
"accountId": "00000000-0000-0000-0000-000000000000",
"amount": {
"value": "1500"
},
"assetCode": "BRL",
"balance": {
"available": "1500",
"onHold": "500",
"overdraftUsed": "130",
"version": 2
},
"balanceAffected": true,
"balanceAfter": {
"available": "1500",
"onHold": "500",
"overdraftUsed": "130",
"version": 2
},
"balanceId": "00000000-0000-0000-0000-000000000000",
"balanceKey": "asset-freeze",
"chartOfAccounts": "1000",
"createdAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"description": "Credit card operation",
"id": "00000000-0000-0000-0000-000000000000",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"metadata": {},
"organizationId": "00000000-0000-0000-0000-000000000000",
"route": "00000000-0000-0000-0000-000000000000",
"status": {
"code": "ACTIVE",
"description": "Active status"
},
"transactionId": "00000000-0000-0000-0000-000000000000",
"type": "DEBIT",
"updatedAt": "2021-01-01T00:00:00Z",
"direction": "debit",
"routeCode": "ROUTE-001",
"routeDescription": "Settlement route for service charges",
"routeId": "00000000-0000-0000-0000-000000000000"
}
],
"organizationId": "00000000-0000-0000-0000-000000000000",
"route": "00000000-0000-0000-0000-000000000000",
"source": [
"@person1"
],
"status": {
"code": "ACTIVE",
"description": "Active status"
},
"updatedAt": "2021-01-01T00:00:00Z",
"groupId": "00000000-0000-0000-0000-000000000000",
"metadata": {},
"parentTransactionId": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000"
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}Autorizações
JWT bearer token issued by the identity provider.
Cabeçalhos
Idempotency key to safely retry the create; an identical retry returns the original transaction, a different request under the same key answers 409 (0084)
Idempotency slot TTL in seconds (default 300)
Parâmetros de caminho
Organization ID (UUID)
Ledger ID (UUID)
Corpo
Show child attributes
Show child attributes
true
Show child attributes
Show child attributes
256"WITHDRAWAL"
100"TR12345"
256"New Outflow Transaction"
"00000000-0000-0000-0000-000000000000"
"00000000-0000-0000-0000-000000000000"
"2021-01-01T00:00:00Z"
Resposta
Created
"1500"
2 - 10"BRL"
256"Chart of accounts group name"
"2021-01-01T00:00:00Z"
"2021-01-01T00:00:00Z"
256"Transaction description"
["@person2"]
"00000000-0000-0000-0000-000000000000"
"00000000-0000-0000-0000-000000000000"
Show child attributes
Show child attributes
"00000000-0000-0000-0000-000000000000"
250"00000000-0000-0000-0000-000000000000"
["@person1"]
Show child attributes
Show child attributes
"2021-01-01T00:00:00Z"
"00000000-0000-0000-0000-000000000000"
Show child attributes
Show child attributes
"00000000-0000-0000-0000-000000000000"
"00000000-0000-0000-0000-000000000000"
Esta página foi útil?

