Skip to main content
POST
Roll back a loan
Removes a loan that should never have existed — the exception flow for a failed wallet disbursement. One call performs the full teardown internally (undo-disbursalundo-approvaldelete) and returns a single response, so your exception handler doesn’t need to chain three synchronous requests. The three individual endpoints remain available; rollback is the consolidated form built on top of them.

Resumable by design

Each teardown step is durable in the LMS the moment it succeeds. If a step fails (or your call times out mid-sequence), the loan is left at a well-defined interim state — and calling rollback again resumes from that state instead of failing on steps that already ran: So the partner-side recovery logic collapses to: call rollback until you get 200. There is no partial-failure state you need to disambiguate yourself — but if you want to inspect anyway, GET /v1/loans/external/{loan_external_id} reports the interim status dynamically after every step (ActiveApprovedSubmitted and pending approval404 once deleted).
A loan with recorded repayments is rejected with 409 aborted. Rollback assumes the loan should never have existed; once a customer has paid against it, that premise no longer holds and erasing the payment must be an explicit decision. Reverse the repayment(s) first, then roll back.

Path parameters

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

Request body

string
Optional. Reason for the rollback — recorded against both undo steps in the LMS audit log.
The body is optional; POST with no body is valid.

Examples

Response

200 OK with the steps that ran on this call. A rollback resumed from an interim state reports only the remaining steps it executed.
After a successful rollback the loan no longer appears in queries — GET /v1/loans/external/{loan_external_id} returns 404. The LMS retains the full activity history (creation, approval, disbursal, every reversal, deletion) in its audit log.

Errors