Saltar al contenido principal
POST
/
api
/
v1
/
loan-products
/
{id}
/
charges
Aplicar el cargo heredado del producto de préstamo
curl --request POST \
  --url https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/charges \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Idempotency: <x-idempotency>' \
  --data '
{
  "chargeEffectiveAt": "<string>",
  "chargeTemplateId": "<string>",
  "loanAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "productVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "accountCreatedAt": "<string>"
}
'
import requests

url = "https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/charges"

payload = {
"chargeEffectiveAt": "<string>",
"chargeTemplateId": "<string>",
"loanAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountCreatedAt": "<string>"
}
headers = {
"X-Idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'X-Idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
chargeEffectiveAt: '<string>',
chargeTemplateId: '<string>',
loanAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
productVersionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
accountCreatedAt: '<string>'
})
};

fetch('https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/charges', 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}/charges",
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([
'chargeEffectiveAt' => '<string>',
'chargeTemplateId' => '<string>',
'loanAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'productVersionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'accountCreatedAt' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Idempotency: <x-idempotency>"
],
]);

$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}/charges"

payload := strings.NewReader("{\n \"chargeEffectiveAt\": \"<string>\",\n \"chargeTemplateId\": \"<string>\",\n \"loanAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"productVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accountCreatedAt\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Idempotency", "<x-idempotency>")
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}/charges")
.header("X-Idempotency", "<x-idempotency>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chargeEffectiveAt\": \"<string>\",\n \"chargeTemplateId\": \"<string>\",\n \"loanAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"productVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accountCreatedAt\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://lender.sandbox.lerian.net/api/v1/loan-products/{id}/charges")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Idempotency"] = '<x-idempotency>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chargeEffectiveAt\": \"<string>\",\n \"chargeTemplateId\": \"<string>\",\n \"loanAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"productVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accountCreatedAt\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "accountCreatedAt": "<string>",
  "amount": "<string>",
  "assessedAt": "<string>",
  "chargeCode": "<string>",
  "chargeTemplateId": "<string>",
  "chargeType": "<string>",
  "currency": "<string>",
  "loanAccountId": "<string>",
  "rate": "<string>",
  "sourceProductVersionId": "<string>",
  "regulatoryWarnings": [
    "<string>"
  ]
}
{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Autorizaciones

Authorization
string
header
requerido

JWT bearer token issued by the identity provider.

Encabezados

X-Idempotency
string
requerido

Canonical idempotency key for safe retries.

Ejemplo:

"550e8400-e29b-41d4-a716-446655440004"

Parámetros de ruta

id
string<uuid>
requerido

Loan product identifier.

Ejemplo:

"550e8400-e29b-41d4-a716-446655440000"

Cuerpo

application/json
chargeEffectiveAt
string
requerido

Charge effective timestamp (RFC3339 or YYYY-MM-DD).

Ejemplo:

"2026-06-14T12:00:00Z"

chargeTemplateId
string
requerido

Charge template identifier.

loanAccountId
string<uuid>
requerido

Loan account identifier.

Ejemplo:

"550e8400-e29b-41d4-a716-446655440005"

productVersionId
string<uuid>
requerido

Product version identifier.

Ejemplo:

"550e8400-e29b-41d4-a716-446655440001"

accountCreatedAt
string

Loan account creation timestamp (RFC3339 or YYYY-MM-DD).

Ejemplo:

"2026-06-14T12:00:00Z"

Respuesta

Created

accountCreatedAt
string
requerido

Loan account creation timestamp (RFC3339, UTC).

Ejemplo:

"2026-06-14T12:00:00Z"

amount
string
requerido

Charge amount as a decimal string in major currency units, fixed scale of 2 decimal places.

Ejemplo:

"1234.56"

assessedAt
string
requerido

Timestamp the charge was assessed (RFC3339, UTC).

Ejemplo:

"2026-06-14T12:00:00Z"

chargeCode
string
requerido

Charge code resolved from the template.

Ejemplo:

"LATE_FEE"

chargeTemplateId
string
requerido

Charge template the fact was derived from.

chargeType
string
requerido

Charge type resolved from the template.

currency
string
requerido

ISO 4217 currency code of the amount.

Ejemplo:

"BRL"

loanAccountId
string
requerido

Loan account the charge was applied to (uuid).

Ejemplo:

"550e8400-e29b-41d4-a716-446655440005"

rate
string
requerido

Charge rate as a decimal string (fractional, e.g. "0.015" for 1.5%).

Ejemplo:

"0.015"

sourceProductVersionId
string
requerido

Product version whose template produced this charge (uuid).

Ejemplo:

"550e8400-e29b-41d4-a716-446655440001"

regulatoryWarnings
string[] | null

Non-blocking regulatory warnings raised while assessing the charge.