Create an atomic batch of Transactions (v2)
curl --request POST \
--url https://ledger.sandbox.lerian.net/v2/transactions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"amount": "<string>",
"asset": "<string>",
"credits": [
{
"alias": "@person1",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"organizationId": "00000000-0000-0000-0000-000000000000",
"amount": "<string>",
"balanceKey": "food",
"description": "<string>",
"operationRouteId": "00000000-0000-0000-0000-000000000000"
}
],
"debits": [
{
"alias": "@person1",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"organizationId": "00000000-0000-0000-0000-000000000000",
"amount": "<string>",
"balanceKey": "food",
"description": "<string>",
"operationRouteId": "00000000-0000-0000-0000-000000000000"
}
],
"order": 2,
"accountBlockExceptionId": "00000000-0000-0000-0000-000000000000",
"code": "<string>",
"description": "<string>",
"metadata": {},
"operationRouteId": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"scheme": "PIX",
"skip": {
"fees": false,
"tracer": false
}
}
]
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v2/transactions/batch"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"amount\": \"<string>\",\n \"asset\": \"<string>\",\n \"credits\": [\n {\n \"alias\": \"@person1\",\n \"ledgerId\": \"00000000-0000-0000-0000-000000000000\",\n \"organizationId\": \"00000000-0000-0000-0000-000000000000\",\n \"amount\": \"<string>\",\n \"balanceKey\": \"food\",\n \"description\": \"<string>\",\n \"operationRouteId\": \"00000000-0000-0000-0000-000000000000\"\n }\n ],\n \"debits\": [\n {\n \"alias\": \"@person1\",\n \"ledgerId\": \"00000000-0000-0000-0000-000000000000\",\n \"organizationId\": \"00000000-0000-0000-0000-000000000000\",\n \"amount\": \"<string>\",\n \"balanceKey\": \"food\",\n \"description\": \"<string>\",\n \"operationRouteId\": \"00000000-0000-0000-0000-000000000000\"\n }\n ],\n \"order\": 2,\n \"accountBlockExceptionId\": \"00000000-0000-0000-0000-000000000000\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": {},\n \"operationRouteId\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"scheme\": \"PIX\",\n \"skip\": {\n \"fees\": false,\n \"tracer\": false\n }\n }\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({
transactions: [
{
amount: '<string>',
asset: '<string>',
credits: [
{
alias: '@person1',
ledgerId: '00000000-0000-0000-0000-000000000000',
organizationId: '00000000-0000-0000-0000-000000000000',
amount: '<string>',
balanceKey: 'food',
description: '<string>',
operationRouteId: '00000000-0000-0000-0000-000000000000'
}
],
debits: [
{
alias: '@person1',
ledgerId: '00000000-0000-0000-0000-000000000000',
organizationId: '00000000-0000-0000-0000-000000000000',
amount: '<string>',
balanceKey: 'food',
description: '<string>',
operationRouteId: '00000000-0000-0000-0000-000000000000'
}
],
order: 2,
accountBlockExceptionId: '00000000-0000-0000-0000-000000000000',
code: '<string>',
description: '<string>',
metadata: {},
operationRouteId: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
scheme: 'PIX',
skip: {fees: false, tracer: false}
}
]
})
};
fetch('https://ledger.sandbox.lerian.net/v2/transactions/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v2/transactions/batch"
payload = { "transactions": [
{
"amount": "<string>",
"asset": "<string>",
"credits": [
{
"alias": "@person1",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"organizationId": "00000000-0000-0000-0000-000000000000",
"amount": "<string>",
"balanceKey": "food",
"description": "<string>",
"operationRouteId": "00000000-0000-0000-0000-000000000000"
}
],
"debits": [
{
"alias": "@person1",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"organizationId": "00000000-0000-0000-0000-000000000000",
"amount": "<string>",
"balanceKey": "food",
"description": "<string>",
"operationRouteId": "00000000-0000-0000-0000-000000000000"
}
],
"order": 2,
"accountBlockExceptionId": "00000000-0000-0000-0000-000000000000",
"code": "<string>",
"description": "<string>",
"metadata": {},
"operationRouteId": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"scheme": "PIX",
"skip": {
"fees": False,
"tracer": False
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"transactions": [
{
"amount": "1500",
"assetCode": "BRL",
"createdAt": "2021-01-01T00:00:00Z",
"credit": [
"@person2"
],
"debit": [
"@person1"
],
"deletedAt": "2021-01-01T00:00:00Z",
"description": "Transaction description",
"feesSkipped": false,
"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",
"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",
"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"
}
],
"order": 2,
"organizationId": "00000000-0000-0000-0000-000000000000",
"status": {
"code": "ACTIVE",
"description": "Active status"
},
"tracerSkipped": false,
"updatedAt": "2021-01-01T00:00:00Z",
"accountPlanFees": [
{
"accountAlias": "@cliente_x",
"accountId": "00000000-0000-0000-0000-000000000000",
"accountPlanId": "00000000-0000-0000-0000-000000000000",
"accountPlanVersion": 1,
"amount": "7.9",
"feeKey": "tedEnviada",
"freeQuota": 10,
"outcome": "charged",
"unit": 11
}
],
"groupId": "00000000-0000-0000-0000-000000000000",
"metadata": {},
"parentTransactionId": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"scheme": "PIX"
}
]
}{
"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 an atomic batch of Transactions (v2)
Executes direct and hold transactions once, in explicit increasing order, as one all-or-none accounting decision. The response preserves that order. The decoded body must be smaller than 1 MiB; the configured cardinality is 1-50, aggregate input legs are limited to 1,000, and post-fee work is limited to 100 postings and 150 balance snapshots. The internal idempotency/recovery batch identifier is not exposed; there is no batch query endpoint.
POST
/
v2
/
transactions
/
batch
Create an atomic batch of Transactions (v2)
curl --request POST \
--url https://ledger.sandbox.lerian.net/v2/transactions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"amount": "<string>",
"asset": "<string>",
"credits": [
{
"alias": "@person1",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"organizationId": "00000000-0000-0000-0000-000000000000",
"amount": "<string>",
"balanceKey": "food",
"description": "<string>",
"operationRouteId": "00000000-0000-0000-0000-000000000000"
}
],
"debits": [
{
"alias": "@person1",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"organizationId": "00000000-0000-0000-0000-000000000000",
"amount": "<string>",
"balanceKey": "food",
"description": "<string>",
"operationRouteId": "00000000-0000-0000-0000-000000000000"
}
],
"order": 2,
"accountBlockExceptionId": "00000000-0000-0000-0000-000000000000",
"code": "<string>",
"description": "<string>",
"metadata": {},
"operationRouteId": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"scheme": "PIX",
"skip": {
"fees": false,
"tracer": false
}
}
]
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v2/transactions/batch"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"amount\": \"<string>\",\n \"asset\": \"<string>\",\n \"credits\": [\n {\n \"alias\": \"@person1\",\n \"ledgerId\": \"00000000-0000-0000-0000-000000000000\",\n \"organizationId\": \"00000000-0000-0000-0000-000000000000\",\n \"amount\": \"<string>\",\n \"balanceKey\": \"food\",\n \"description\": \"<string>\",\n \"operationRouteId\": \"00000000-0000-0000-0000-000000000000\"\n }\n ],\n \"debits\": [\n {\n \"alias\": \"@person1\",\n \"ledgerId\": \"00000000-0000-0000-0000-000000000000\",\n \"organizationId\": \"00000000-0000-0000-0000-000000000000\",\n \"amount\": \"<string>\",\n \"balanceKey\": \"food\",\n \"description\": \"<string>\",\n \"operationRouteId\": \"00000000-0000-0000-0000-000000000000\"\n }\n ],\n \"order\": 2,\n \"accountBlockExceptionId\": \"00000000-0000-0000-0000-000000000000\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": {},\n \"operationRouteId\": \"00000000-0000-0000-0000-000000000000\",\n \"routeId\": \"00000000-0000-0000-0000-000000000000\",\n \"scheme\": \"PIX\",\n \"skip\": {\n \"fees\": false,\n \"tracer\": false\n }\n }\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({
transactions: [
{
amount: '<string>',
asset: '<string>',
credits: [
{
alias: '@person1',
ledgerId: '00000000-0000-0000-0000-000000000000',
organizationId: '00000000-0000-0000-0000-000000000000',
amount: '<string>',
balanceKey: 'food',
description: '<string>',
operationRouteId: '00000000-0000-0000-0000-000000000000'
}
],
debits: [
{
alias: '@person1',
ledgerId: '00000000-0000-0000-0000-000000000000',
organizationId: '00000000-0000-0000-0000-000000000000',
amount: '<string>',
balanceKey: 'food',
description: '<string>',
operationRouteId: '00000000-0000-0000-0000-000000000000'
}
],
order: 2,
accountBlockExceptionId: '00000000-0000-0000-0000-000000000000',
code: '<string>',
description: '<string>',
metadata: {},
operationRouteId: '00000000-0000-0000-0000-000000000000',
routeId: '00000000-0000-0000-0000-000000000000',
scheme: 'PIX',
skip: {fees: false, tracer: false}
}
]
})
};
fetch('https://ledger.sandbox.lerian.net/v2/transactions/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v2/transactions/batch"
payload = { "transactions": [
{
"amount": "<string>",
"asset": "<string>",
"credits": [
{
"alias": "@person1",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"organizationId": "00000000-0000-0000-0000-000000000000",
"amount": "<string>",
"balanceKey": "food",
"description": "<string>",
"operationRouteId": "00000000-0000-0000-0000-000000000000"
}
],
"debits": [
{
"alias": "@person1",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"organizationId": "00000000-0000-0000-0000-000000000000",
"amount": "<string>",
"balanceKey": "food",
"description": "<string>",
"operationRouteId": "00000000-0000-0000-0000-000000000000"
}
],
"order": 2,
"accountBlockExceptionId": "00000000-0000-0000-0000-000000000000",
"code": "<string>",
"description": "<string>",
"metadata": {},
"operationRouteId": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"scheme": "PIX",
"skip": {
"fees": False,
"tracer": False
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"transactions": [
{
"amount": "1500",
"assetCode": "BRL",
"createdAt": "2021-01-01T00:00:00Z",
"credit": [
"@person2"
],
"debit": [
"@person1"
],
"deletedAt": "2021-01-01T00:00:00Z",
"description": "Transaction description",
"feesSkipped": false,
"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",
"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",
"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"
}
],
"order": 2,
"organizationId": "00000000-0000-0000-0000-000000000000",
"status": {
"code": "ACTIVE",
"description": "Active status"
},
"tracerSkipped": false,
"updatedAt": "2021-01-01T00:00:00Z",
"accountPlanFees": [
{
"accountAlias": "@cliente_x",
"accountId": "00000000-0000-0000-0000-000000000000",
"accountPlanId": "00000000-0000-0000-0000-000000000000",
"accountPlanVersion": 1,
"amount": "7.9",
"feeKey": "tedEnviada",
"freeQuota": 10,
"outcome": "charged",
"unit": 11
}
],
"groupId": "00000000-0000-0000-0000-000000000000",
"metadata": {},
"parentTransactionId": "00000000-0000-0000-0000-000000000000",
"routeId": "00000000-0000-0000-0000-000000000000",
"scheme": "PIX"
}
]
}{
"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"
}
}Cabeçalhos
Corpo
application/json
Esta página foi útil?

