curl --request POST \
--url https://lender.sandbox.lerian.net/api/v1/loan-accounts/{id}/prepayments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency: <x-idempotency>' \
--data '
{
"businessDate": "2026-06-14",
"effectiveDate": "2026-06-14T17:30:00Z",
"transactionId": "<string>",
"amount": "100.00",
"quoteId": "550e8400-e29b-41d4-a716-446655440020"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lender.sandbox.lerian.net/api/v1/loan-accounts/{id}/prepayments"
payload := strings.NewReader("{\n \"businessDate\": \"2026-06-14\",\n \"effectiveDate\": \"2026-06-14T17:30:00Z\",\n \"transactionId\": \"<string>\",\n \"amount\": \"100.00\",\n \"quoteId\": \"550e8400-e29b-41d4-a716-446655440020\"\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))
}const options = {
method: 'POST',
headers: {
'X-Idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
businessDate: '2026-06-14',
effectiveDate: '2026-06-14T17:30:00Z',
transactionId: '<string>',
amount: '100.00',
quoteId: '550e8400-e29b-41d4-a716-446655440020'
})
};
fetch('https://lender.sandbox.lerian.net/api/v1/loan-accounts/{id}/prepayments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://lender.sandbox.lerian.net/api/v1/loan-accounts/{id}/prepayments"
payload = {
"businessDate": "2026-06-14",
"effectiveDate": "2026-06-14T17:30:00Z",
"transactionId": "<string>",
"amount": "100.00",
"quoteId": "550e8400-e29b-41d4-a716-446655440020"
}
headers = {
"X-Idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"previousScheduleVersionId": "550e8400-e29b-41d4-a716-446655440031",
"scheduleVersion": {
"createdAt": "2026-06-14T12:00:00Z",
"id": "550e8400-e29b-41d4-a716-446655440030",
"installments": [
{
"dueDate": "2026-06-14T12:00:00Z",
"feesAmount": "3.50",
"interestAmount": "20.00",
"number": 3,
"penaltiesAmount": "1.50",
"principalAmount": "100.00",
"principalRemaining": "100.00",
"totalAmount": "125.00"
}
],
"loanAccountId": "550e8400-e29b-41d4-a716-446655440000",
"reason": "<string>",
"triggerTransactionId": "<string>",
"versionNumber": 2,
"predecessorVersionId": "550e8400-e29b-41d4-a716-446655440031",
"pricedAtMonthlyRate": "0.025"
}
}{
"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"
}
}{
"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"
}
}{
"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"
}
}Prepay loan account
Appends an immutable prepayment schedule version and recalculation trigger. BR accounts require quoteId; amount-only prepayment is available only for non-BR accounts. When both are provided, amount must equal the quote’s net settlement amount. Idempotency is enforced by the lib-commons idempotency middleware via the X-Idempotency header; a reused key with different facts yields 409. A missing required BR quote, malformed UUID, or invalid amount yields 422. Deduplication is by key ALONE: an amount-only settlement resent under a NEW key books a SECOND settlement, so retry under the ORIGINAL key. A BR quote is one-shot and bounds this by itself — a new key carrying an already-accepted quoteId is refused and writes nothing, while a new key carrying a new quote is a newly priced settlement and is meant to book.
curl --request POST \
--url https://lender.sandbox.lerian.net/api/v1/loan-accounts/{id}/prepayments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency: <x-idempotency>' \
--data '
{
"businessDate": "2026-06-14",
"effectiveDate": "2026-06-14T17:30:00Z",
"transactionId": "<string>",
"amount": "100.00",
"quoteId": "550e8400-e29b-41d4-a716-446655440020"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lender.sandbox.lerian.net/api/v1/loan-accounts/{id}/prepayments"
payload := strings.NewReader("{\n \"businessDate\": \"2026-06-14\",\n \"effectiveDate\": \"2026-06-14T17:30:00Z\",\n \"transactionId\": \"<string>\",\n \"amount\": \"100.00\",\n \"quoteId\": \"550e8400-e29b-41d4-a716-446655440020\"\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))
}const options = {
method: 'POST',
headers: {
'X-Idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
businessDate: '2026-06-14',
effectiveDate: '2026-06-14T17:30:00Z',
transactionId: '<string>',
amount: '100.00',
quoteId: '550e8400-e29b-41d4-a716-446655440020'
})
};
fetch('https://lender.sandbox.lerian.net/api/v1/loan-accounts/{id}/prepayments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://lender.sandbox.lerian.net/api/v1/loan-accounts/{id}/prepayments"
payload = {
"businessDate": "2026-06-14",
"effectiveDate": "2026-06-14T17:30:00Z",
"transactionId": "<string>",
"amount": "100.00",
"quoteId": "550e8400-e29b-41d4-a716-446655440020"
}
headers = {
"X-Idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"previousScheduleVersionId": "550e8400-e29b-41d4-a716-446655440031",
"scheduleVersion": {
"createdAt": "2026-06-14T12:00:00Z",
"id": "550e8400-e29b-41d4-a716-446655440030",
"installments": [
{
"dueDate": "2026-06-14T12:00:00Z",
"feesAmount": "3.50",
"interestAmount": "20.00",
"number": 3,
"penaltiesAmount": "1.50",
"principalAmount": "100.00",
"principalRemaining": "100.00",
"totalAmount": "125.00"
}
],
"loanAccountId": "550e8400-e29b-41d4-a716-446655440000",
"reason": "<string>",
"triggerTransactionId": "<string>",
"versionNumber": 2,
"predecessorVersionId": "550e8400-e29b-41d4-a716-446655440031",
"pricedAtMonthlyRate": "0.025"
}
}{
"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"
}
}{
"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"
}
}{
"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"
}
}Authorizations
JWT bearer token issued by the identity provider.
Headers
Canonical idempotency request ID. Enforced by the lib-commons idempotency middleware.
"550e8400-e29b-41d4-a716-446655440011"
Path Parameters
Loan account identifier (UUID).
"550e8400-e29b-41d4-a716-446655440000"
Body
YYYY-MM-DD business date applied to the prepayment.
"2026-06-14"
The moment the settlement money moved, as a full RFC 3339 instant with a time and an offset. A bare YYYY-MM-DD calendar date is refused with LENDER-0348.
"2026-06-14T17:30:00Z"
Operator-supplied prepayment transaction identifier.
128Prepayment amount (2 d.p. string). Amount-only prepayment is available only for non-BR accounts; BR accounts require quoteId.
"100.00"
Settlement quote identifier. Required when amount is empty.
"550e8400-e29b-41d4-a716-446655440020"
Was this page helpful?

