Skip to main content
POST
Refund a paid penalty
An overdue penalty is charged at the loan’s due instant and, because the LMS settles penalties before interest and principal, the next repayment pays it first. Sometimes that penalty should never have applied: the customer paid on the wallet before the due instant, but the repayment reached us after it and without a transactionAt, so it settled the penalty instead of removing it. This endpoint corrects that. It does not move money. It returns what was paid on the penalty to the loan as a credit balance, and the loan moves to Overpaid. You then return that credit to the customer with Refund an overpayment, exactly as for any other overpayment. Two equivalent forms, /v1/loans/{loan_id}/penalties/refund and the externalId form above. Prefer the externalId form for partner integrations.
This is a two-step correction. After this call the customer is owed money and the loan shows it as totalOverpaid. The correction is complete only when you have credited the wallet and recorded it with POST .../refunds. Read totalOverpaid from this response and pass it as that call’s amount.

Path parameters

string
required
The loan’s externalId. On the /v1/loans/{loan_id}/penalties/refund form, this is the numeric LMS id instead.

Request body

string
required
Your own reference for this correction, for example the support ticket or the wallet transaction id that proved the payment was on time (max 100 characters). If a penalty refund carrying this key has already been recorded on the loan, the original is returned unchanged instead of a second refund being made. This is what makes a retry safe.
string
Optional free text recorded on the LMS transaction, such as why the penalty was not owed (max 500 characters).
There is no amount: the whole paid penalty is returned, and the amount you state is on the follow-up refund call. There is no transactionDate either: the LMS books a charge refund on the day it is recorded and accepts no other.

Examples

Response

200 OK returns the refund transaction(s) and the loan’s position afterwards.
number
The total returned to the loan by this call.
array
One Charge Refund transaction per penalty charge refunded. A loan normally carries one penalty, so this is normally one entry.
string
Overpaid after a successful refund on a settled loan.
number
The credit now owed to the customer. Pass this as amount to POST .../refunds.

Errors

Retrying a refund that already succeeded is not an error: with the same idempotencyKey you get the original transaction back with 200.

Avoiding the need for this

This endpoint exists for a penalty that was paid because timing evidence arrived late. Send transactionAt, the exact wallet time, on every repayment including the first call. A payment made before the due instant then removes its penalty as the repayment posts, and there is nothing to refund. See Record a repayment.