Developer Center

Repayments API

Last Updated: Oct 03, 2018 02:51PM CEST

URL

/api/loans/{ID}/repayments

Description

Allows you to retrieve repayment schedules for loan accounts. The full repayment schedule is returned including details about the state of the repayments as well as amounts that have been paid (based on transactions logged)

Methods

GET Repayments

Allows retrieving repayment schedules for a loan account.

Parameters

dueFrom Starting due date to filter repayments on (YYYY-MM-DD)
dueTo End due date to filter repayment on (YYYY-MM-DD)

Usage examples

//get the repayment schedule for loan JHBF869
GET /api/loans/JHBF869/repayments

//get all repayments due between 2011-01-05 and 2011-06-07
GET /api/repayments?dueFrom=2011-01-05&dueTo=2011-06-07

Samples responses

//sample response of a repayment schedule
[
   {
      "encodedKey":"402832b438384dcf0138384ec2a90002",
      "parentAccountKey":"402832b438384dcf0138384ec0880001",
      "dueDate":"2012-07-29T00:00:00+0000",
      "repaidDate":"2012-06-29T00:00:00+0000",
      "lastPaidDate":"2012-06-29T00:00:00+0000",
      "principalDue":"190",
      "principalPaid":"190",
      "interestDue":"25.45",
      "interestPaid":"25.45",
      "state":"PAID"
   },
   {
      "encodedKey":"402832b438384dcf0138384ec2ba0003",
      "parentAccountKey":"402832b438384dcf0138384ec0880001",
      "dueDate":"2012-08-29T00:00:00+0000",
      "lastPaidDate":"2012-06-29T00:00:00+0000",
      "principalDue":"190",
      "principalPaid":"28.71",
      "interestDue":"26.29",
      "interestPaid":"26.29",
      "state":"PARTIALLY_PAID"
   },
   {
      "encodedKey":"402832b438384dcf0138384ec2bb0004",
      "parentAccountKey":"402832b438384dcf0138384ec0880001",
      "dueDate":"2012-09-29T00:00:00+0000",
      "principalDue":"190",
      "principalPaid":"0",
      "interestDue":"26.29",
      "interestPaid":"0",
      "state":"PENDING"
   },
   {
      "encodedKey":"402832b438384dcf0138384ec2bb0005",
      "parentAccountKey":"402832b438384dcf0138384ec0880001",
      "dueDate":"2012-10-29T00:00:00+0000",
      "principalDue":"190",
      "principalPaid":"0",
      "interestDue":"25.45",
      "interestPaid":"0",
      "state":"PENDING"
   },
   {
      "encodedKey":"402832b438384dcf0138384ec2c30006",
      "parentAccountKey":"402832b438384dcf0138384ec0880001",
      "dueDate":"2012-11-29T00:00:00+0000",
      "principalDue":"190",
      "principalPaid":"0",
      "interestDue":"26.29",
      "interestPaid":"0",
      "state":"PENDING"
   }
]

Installment states.
PAID The installment has been paid
PARTIALLY_PAID The installment was only paid partially
PENDING The installment has not been paid yet (future installments)
LATE The installment has not been paid and its due date already passed

Allows to edit a repayment schedule for fixed or dynamic accounts. This can be a single instalment or the whole schedule. Dates needs to be specified in the ISO 8601 short format date (YYYY-MM-DD)

Usage examples

//update two instalments for the account KHGJ593
PATCH '{
    "repayments": [
        {
            "encodedKey": "ff80808148ac95ce0148acc5f4bd0022",
            "principalDue": "189",
            "dueDate": "2014-10-02",
            "interestDue": "25.4500000000",
            "parentAccountKey": "ff80808148ac95ce0148aca9853c0001"
        },
        {
            "encodedKey": "ff80808148ac95ce0148acc5f4d40023",
            "principalDue": "224",
            "interestDue": "20.3600000000",
            "dueDate": "2014-11-27",
            "parentAccountKey": "ff80808148ac95ce0148aca9853c0001"
        }
    ]
}' /api/loans/KHGJ593/repayments

Parameters for the JSON call

encodedKey The ID of the instalment. Required.
principalDue The updated principal amount due.
interestDue The updated interest due.
dueDate The new due date for this instalment (YYYY-MM-DD).
parentAccountKey The ID of the parent account for this instalment.
For dynamic account only due dates and principal due can be updated.

Samples responses

A 200 response code with the new schedule is returned on a successful update. See the previous GET section for a sample schedule response. Otherwise an error code will be received (see API Response & Error Codes for more information).

Notes

  • Only unpaid instalments can be effectively modified. Updates to paid instalments can still be sent but no changes will apply.
  • For fixed accounts only principal, interest, fees and/or penalties due amounts and due dates are taken into account.
  • For dynamic accounts only principal due and due dates are taken into account.
  • Partially paid instalments can be edited.

Delete Repayments

Allows deleting a zero principal due loan repayment for dynamic accounts. If you need to delete a repayment with principal due, first do a patch and set the repayment principal due on zero then issue delete request.

Usage examples

//delete the repayment "myRepaymentKey" for loan JHBF869
DELETE /api/loans/JHBF869/repayments/myRepaymentKey

Samples responses

//sample response for delete repayment
{
  "returnCode": 0,
  "returnStatus": "SUCCESS"
}
support@mambu.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete