Record a repayment
UpdatedPosts a repayment and allocates it to penalties, fees, interest and principal per the product's rules.
POST
https://app.zung.ai/connector/api/banking/loans/{id}/repayment
Banking API — authenticate with a staff bearer token. Results respect that user's permissions and branch access.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | required | Loan id |
amount | number | required | Amount in the institution's base currency |
date | date | required | Value date of the transaction (YYYY-MM-DD) |
payment_type_id | integer | required | Payment channel, from GET /payment-types (cash, M-Pesa, bank...) |
receipt | string | optional | Receipt or M-Pesa confirmation code |
description | string | optional | Narration shown on the member's statement |
client_ref | string | optional | Your unique reference (max 64). Retrying with the same value never posts twice |
Request
curl -X POST "https://app.zung.ai/connector/api/banking/loans/8821/repayment" \
-H "Authorization: Bearer $ZUNG_TOKEN" \
-H "Accept: application/json" \
-d amount=1500 \
-d date=2026-11-01 \
-d payment_type_id=3 \
-d receipt=QHX7821KE \
-d client_ref=7f9c2e1a-5b8d-4c3e-9a71-2d6f0b8e4c15Response
{
"success": true,
"message": "Repayment saved"
}
// Same client_ref sent again:
{
"success": true,
"duplicate": true,
"message": "Already recorded."
}Something unclear or out of date? Tell us and we'll fix it.