curl --request POST \
--url https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountingMode": "accrual",
"loanProductVersionId": "550e8400-e29b-41d4-a716-446655440001",
"postingRules": [
{
"eventType": "disbursement",
"legs": [
{
"account": "1100.10.001",
"side": "debit",
"component": "iof",
"optional": true,
"role": "principal"
}
],
"metadata": {}
}
],
"midazLedgerId": "ledger-def",
"midazOrganizationId": "org-abc"
}
'import requests
url = "https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles"
payload = {
"accountingMode": "accrual",
"loanProductVersionId": "550e8400-e29b-41d4-a716-446655440001",
"postingRules": [
{
"eventType": "disbursement",
"legs": [
{
"account": "1100.10.001",
"side": "debit",
"component": "iof",
"optional": True,
"role": "principal"
}
],
"metadata": {}
}
],
"midazLedgerId": "ledger-def",
"midazOrganizationId": "org-abc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountingMode: 'accrual',
loanProductVersionId: '550e8400-e29b-41d4-a716-446655440001',
postingRules: [
{
eventType: 'disbursement',
legs: [
{
account: '1100.10.001',
side: 'debit',
component: 'iof',
optional: true,
role: 'principal'
}
],
metadata: {}
}
],
midazLedgerId: 'ledger-def',
midazOrganizationId: 'org-abc'
})
};
fetch('https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles', 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://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountingMode' => 'accrual',
'loanProductVersionId' => '550e8400-e29b-41d4-a716-446655440001',
'postingRules' => [
[
'eventType' => 'disbursement',
'legs' => [
[
'account' => '1100.10.001',
'side' => 'debit',
'component' => 'iof',
'optional' => true,
'role' => 'principal'
]
],
'metadata' => [
]
]
],
'midazLedgerId' => 'ledger-def',
'midazOrganizationId' => 'org-abc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles"
payload := strings.NewReader("{\n \"accountingMode\": \"accrual\",\n \"loanProductVersionId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"postingRules\": [\n {\n \"eventType\": \"disbursement\",\n \"legs\": [\n {\n \"account\": \"1100.10.001\",\n \"side\": \"debit\",\n \"component\": \"iof\",\n \"optional\": true,\n \"role\": \"principal\"\n }\n ],\n \"metadata\": {}\n }\n ],\n \"midazLedgerId\": \"ledger-def\",\n \"midazOrganizationId\": \"org-abc\"\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))
}HttpResponse<String> response = Unirest.post("https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountingMode\": \"accrual\",\n \"loanProductVersionId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"postingRules\": [\n {\n \"eventType\": \"disbursement\",\n \"legs\": [\n {\n \"account\": \"1100.10.001\",\n \"side\": \"debit\",\n \"component\": \"iof\",\n \"optional\": true,\n \"role\": \"principal\"\n }\n ],\n \"metadata\": {}\n }\n ],\n \"midazLedgerId\": \"ledger-def\",\n \"midazOrganizationId\": \"org-abc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountingMode\": \"accrual\",\n \"loanProductVersionId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"postingRules\": [\n {\n \"eventType\": \"disbursement\",\n \"legs\": [\n {\n \"account\": \"1100.10.001\",\n \"side\": \"debit\",\n \"component\": \"iof\",\n \"optional\": true,\n \"role\": \"principal\"\n }\n ],\n \"metadata\": {}\n }\n ],\n \"midazLedgerId\": \"ledger-def\",\n \"midazOrganizationId\": \"org-abc\"\n}"
response = http.request(request)
puts response.read_body{
"accountingMode": "accrual",
"createdAt": "2026-06-14T12:00:00Z",
"id": "550e8400-e29b-41d4-a716-446655440003",
"loanProductVersionId": "550e8400-e29b-41d4-a716-446655440001",
"postingRules": [
{
"eventType": "disbursement",
"legs": [
{
"account": "1100.10.001",
"optional": true,
"side": "debit",
"component": "iof",
"role": "principal"
}
],
"metadata": {}
}
]
}{
"code": "ERR-0001",
"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"
}
}Criar perfil contábil do produto de empréstimo
Configura o perfil contábil de uma versão de produto de empréstimo que pertence ao produto de empréstimo do caminho.
curl --request POST \
--url https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountingMode": "accrual",
"loanProductVersionId": "550e8400-e29b-41d4-a716-446655440001",
"postingRules": [
{
"eventType": "disbursement",
"legs": [
{
"account": "1100.10.001",
"side": "debit",
"component": "iof",
"optional": true,
"role": "principal"
}
],
"metadata": {}
}
],
"midazLedgerId": "ledger-def",
"midazOrganizationId": "org-abc"
}
'import requests
url = "https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles"
payload = {
"accountingMode": "accrual",
"loanProductVersionId": "550e8400-e29b-41d4-a716-446655440001",
"postingRules": [
{
"eventType": "disbursement",
"legs": [
{
"account": "1100.10.001",
"side": "debit",
"component": "iof",
"optional": True,
"role": "principal"
}
],
"metadata": {}
}
],
"midazLedgerId": "ledger-def",
"midazOrganizationId": "org-abc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountingMode: 'accrual',
loanProductVersionId: '550e8400-e29b-41d4-a716-446655440001',
postingRules: [
{
eventType: 'disbursement',
legs: [
{
account: '1100.10.001',
side: 'debit',
component: 'iof',
optional: true,
role: 'principal'
}
],
metadata: {}
}
],
midazLedgerId: 'ledger-def',
midazOrganizationId: 'org-abc'
})
};
fetch('https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles', 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://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountingMode' => 'accrual',
'loanProductVersionId' => '550e8400-e29b-41d4-a716-446655440001',
'postingRules' => [
[
'eventType' => 'disbursement',
'legs' => [
[
'account' => '1100.10.001',
'side' => 'debit',
'component' => 'iof',
'optional' => true,
'role' => 'principal'
]
],
'metadata' => [
]
]
],
'midazLedgerId' => 'ledger-def',
'midazOrganizationId' => 'org-abc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles"
payload := strings.NewReader("{\n \"accountingMode\": \"accrual\",\n \"loanProductVersionId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"postingRules\": [\n {\n \"eventType\": \"disbursement\",\n \"legs\": [\n {\n \"account\": \"1100.10.001\",\n \"side\": \"debit\",\n \"component\": \"iof\",\n \"optional\": true,\n \"role\": \"principal\"\n }\n ],\n \"metadata\": {}\n }\n ],\n \"midazLedgerId\": \"ledger-def\",\n \"midazOrganizationId\": \"org-abc\"\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))
}HttpResponse<String> response = Unirest.post("https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountingMode\": \"accrual\",\n \"loanProductVersionId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"postingRules\": [\n {\n \"eventType\": \"disbursement\",\n \"legs\": [\n {\n \"account\": \"1100.10.001\",\n \"side\": \"debit\",\n \"component\": \"iof\",\n \"optional\": true,\n \"role\": \"principal\"\n }\n ],\n \"metadata\": {}\n }\n ],\n \"midazLedgerId\": \"ledger-def\",\n \"midazOrganizationId\": \"org-abc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/accounting-profiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountingMode\": \"accrual\",\n \"loanProductVersionId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"postingRules\": [\n {\n \"eventType\": \"disbursement\",\n \"legs\": [\n {\n \"account\": \"1100.10.001\",\n \"side\": \"debit\",\n \"component\": \"iof\",\n \"optional\": true,\n \"role\": \"principal\"\n }\n ],\n \"metadata\": {}\n }\n ],\n \"midazLedgerId\": \"ledger-def\",\n \"midazOrganizationId\": \"org-abc\"\n}"
response = http.request(request)
puts response.read_body{
"accountingMode": "accrual",
"createdAt": "2026-06-14T12:00:00Z",
"id": "550e8400-e29b-41d4-a716-446655440003",
"loanProductVersionId": "550e8400-e29b-41d4-a716-446655440001",
"postingRules": [
{
"eventType": "disbursement",
"legs": [
{
"account": "1100.10.001",
"optional": true,
"side": "debit",
"component": "iof",
"role": "principal"
}
],
"metadata": {}
}
]
}{
"code": "ERR-0001",
"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
Loan product identifier.
"550e8400-e29b-41d4-a716-446655440000"
Corpo
Accounting recognition mode.
accrual, cash "accrual"
Loan product version identifier.
"550e8400-e29b-41d4-a716-446655440001"
Non-null GL account mappings per accounting event. New profiles require disbursement, repayment, prepayment, accrual, collection_unapplied, collection_reapply, and collection_refund; accrual_tax is optional.
7 - 8 elementsShow child attributes
Show child attributes
Optional per-product Midaz ledger the profile's postings route into; both-or-neither with midazOrganizationId. Required under multi-tenant mode; empty single-tenant profiles fall back to the env default.
128"ledger-def"
Optional per-product Midaz organization the profile's postings route into; both-or-neither with midazLedgerId. Required under multi-tenant mode; empty single-tenant profiles fall back to the env default.
128"org-abc"
Resposta
Created
Accounting recognition mode (accrual|cash).
"accrual"
Creation timestamp (RFC3339, UTC).
"2026-06-14T12:00:00Z"
Server-assigned accounting profile identifier (uuid).
"550e8400-e29b-41d4-a716-446655440003"
Loan product version this profile is configured for (uuid).
"550e8400-e29b-41d4-a716-446655440001"
Persisted GL account mappings, one per accounting event.
Show child attributes
Show child attributes
Esta página foi útil?

