New New: idempotent repayments with client_ref — safe retries for branches on patchy connections Read →
74 Sign in Start free trial

Recording M-Pesa repayments

Map M-Pesa confirmations to repayments using payment types and receipt codes.

6 min read · Updated 1 Nov 2026

Call GET /payment-types once and cache the id of your M-Pesa channel. For each confirmed M-Pesa payment, post a repayment with that payment_type_id, the M-Pesa confirmation code as receipt, and the same code as client_ref — M-Pesa codes are unique, so callbacks that arrive twice are absorbed automatically.

Repayments are allocated by the loan product's repayment order (typically penalties → fees → interest → principal).

Something unclear or out of date? Tell us and we'll fix it.