Run fees for a period and produce draft invoices
/lokta-lms/api/v1/fee-runsComputes partner fees for a period and produces a draft invoice for each partner and currency.
Walks every attributed loan, finds the agreement in force for that loan's product, and accrues each fee line for the uncovered day-ranges of the period (a live accrual for the same loan+line covers its days). Then produces one draft invoice per partner+currency with a non-zero amount, each carrying a tracking number, the per-line basis with the terms version, and an identity snapshot. A rerun tops up late attributions; nothing is superseded or refused for overlap. A zero amount produces no draft.
Requires an Idempotency-Key; a replayed compute would double a partner's earnings for a period.
When to use it
Run this at the end of a period to compute partner fees from attributed loans and produce a draft invoice for each partner and currency.
Worth knowing
- Send an Idempotency-Key header. A replayed compute would double a partner's earnings for the period.
- A rerun tops up late attributions. It does not fail on overlap.
Header parameters
Idempotency-Keyheader · string · optionalPer-intent key
Request body application/json
period_startstring · optionalPlaceholder name, to be confirmed. The first day of the period to compute.
period_endstring · optionalPlaceholder name, to be confirmed. The last day of the period to compute.
Responses
defaultdefault responseEvery request authenticates with HTTP Basic and carries a Tenant-Identifier header. See the conventions for dates, commands, pagination and errors.
Open this operation in the interactive explorer, or read it as Markdown.
This is the API reference for Lokta, the agentic loan servicing platform. Go to lokta.ai