curl --request POST \
--url https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/operation-routes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"account": {
"ruleType": "alias",
"validIf": "<unknown>"
},
"accountingEntries": {},
"code": "EXT-001",
"description": "This operation route handles cash-in transactions from service charge collections",
"operationType": "source",
"title": "Cashin from service charge"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/operation-routes"
payload := strings.NewReader("{\n \"metadata\": {},\n \"account\": {\n \"ruleType\": \"alias\",\n \"validIf\": \"<unknown>\"\n },\n \"accountingEntries\": {},\n \"code\": \"EXT-001\",\n \"description\": \"This operation route handles cash-in transactions from service charge collections\",\n \"operationType\": \"source\",\n \"title\": \"Cashin from service charge\"\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: {},
account: {ruleType: 'alias', validIf: '<unknown>'},
accountingEntries: {},
code: 'EXT-001',
description: 'This operation route handles cash-in transactions from service charge collections',
operationType: 'source',
title: 'Cashin from service charge'
})
};
fetch('https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/operation-routes', 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}/operation-routes"
payload = {
"metadata": {},
"account": {
"ruleType": "alias",
"validIf": "<unknown>"
},
"accountingEntries": {},
"code": "EXT-001",
"description": "This operation route handles cash-in transactions from service charge collections",
"operationType": "source",
"title": "Cashin from service charge"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"createdAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"updatedAt": "2021-01-01T00:00:00Z",
"account": {
"ruleType": "alias",
"validIf": "<unknown>"
},
"accountingEntries": {
"block": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"cancel": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"commit": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"crossLedger": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"direct": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"hold": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"overdraft": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"revert": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"unblock": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
}
},
"code": "EXT-001",
"description": "This operation route handles cash-in transactions from service charge collections",
"id": "01965ed9-7fa4-75b2-8872-fc9e8509ab0a",
"ledgerId": "01965ed9-7fa4-75b2-8872-fc9e8509ab0a",
"metadata": {},
"operationType": "source",
"organizationId": "01965ed9-7fa4-75b2-8872-fc9e8509ab0a",
"title": "Cashin from service charge"
}{
"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 organization Operation Route
Creates an operation route that belongs to the organization and validates in every ledger of it. The route has no ledgerId.
curl --request POST \
--url https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/operation-routes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"account": {
"ruleType": "alias",
"validIf": "<unknown>"
},
"accountingEntries": {},
"code": "EXT-001",
"description": "This operation route handles cash-in transactions from service charge collections",
"operationType": "source",
"title": "Cashin from service charge"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/operation-routes"
payload := strings.NewReader("{\n \"metadata\": {},\n \"account\": {\n \"ruleType\": \"alias\",\n \"validIf\": \"<unknown>\"\n },\n \"accountingEntries\": {},\n \"code\": \"EXT-001\",\n \"description\": \"This operation route handles cash-in transactions from service charge collections\",\n \"operationType\": \"source\",\n \"title\": \"Cashin from service charge\"\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: {},
account: {ruleType: 'alias', validIf: '<unknown>'},
accountingEntries: {},
code: 'EXT-001',
description: 'This operation route handles cash-in transactions from service charge collections',
operationType: 'source',
title: 'Cashin from service charge'
})
};
fetch('https://ledger.sandbox.lerian.net/v2/organizations/{organization_id}/operation-routes', 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}/operation-routes"
payload = {
"metadata": {},
"account": {
"ruleType": "alias",
"validIf": "<unknown>"
},
"accountingEntries": {},
"code": "EXT-001",
"description": "This operation route handles cash-in transactions from service charge collections",
"operationType": "source",
"title": "Cashin from service charge"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"createdAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"updatedAt": "2021-01-01T00:00:00Z",
"account": {
"ruleType": "alias",
"validIf": "<unknown>"
},
"accountingEntries": {
"block": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"cancel": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"commit": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"crossLedger": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"direct": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"hold": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"overdraft": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"revert": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
},
"unblock": {
"credit": {
"code": "1001",
"description": "Cash"
},
"debit": {
"code": "1001",
"description": "Cash"
}
}
},
"code": "EXT-001",
"description": "This operation route handles cash-in transactions from service charge collections",
"id": "01965ed9-7fa4-75b2-8872-fc9e8509ab0a",
"ledgerId": "01965ed9-7fa4-75b2-8872-fc9e8509ab0a",
"metadata": {},
"operationType": "source",
"organizationId": "01965ed9-7fa4-75b2-8872-fc9e8509ab0a",
"title": "Cashin from service charge"
}{
"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"
}
}Autorizações
JWT bearer token issued by the identity provider.
Parâmetros de caminho
Organization ID (UUID)
Corpo
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"EXT-001"
"This operation route handles cash-in transactions from service charge collections"
source, destination, bidirectional "source"
"Cashin from service charge"
Resposta
Created
"2021-01-01T00:00:00Z"
"2021-01-01T00:00:00Z"
"2021-01-01T00:00:00Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"EXT-001"
"This operation route handles cash-in transactions from service charge collections"
"01965ed9-7fa4-75b2-8872-fc9e8509ab0a"
"01965ed9-7fa4-75b2-8872-fc9e8509ab0a"
Show child attributes
Show child attributes
"source"
"01965ed9-7fa4-75b2-8872-fc9e8509ab0a"
"Cashin from service charge"
Esta página foi útil?

