Developer Center

Loan Fractionalisation - P2P Lending

Last Updated: Oct 24, 2017 05:21PM CEST

URL

/api/loans
/api/loans/{ID}

Description

Starting with Mambu 3.13 a P2P lending functionality was added to allow loan accounts to be funded by investor deposit accounts.

Get accounts

The funders information for a loan account can be found in the loan account JSON. Using GET API for Loan Accounts the funders for a loan account can be seen.

    // Sample response isolated with funds from loan account
    // GET: ~api/loans/ZNTS744
    ...
   "funds":[
      {
         "encodedKey":"8a818779565191ba015654a723aa5843",
         "guarantorKey":"8a818779565191ba0156548ce7b15811",
         "guarantorType":"GROUP",
         "savingsAccountKey":"8a818779565191ba0156548d6aaf581e",
         "amount":"4000",
         "type":"INVESTOR"
      },
      {
         "encodedKey":"8a8186f4564c7aa2015654beb82813b4",
         "guarantorKey":"8a8187ce5525555f0155256c9ab40081",
         "guarantorType":"CLIENT",
         "savingsAccountKey":"8a81872a555e47e8015572bf0a5573a0",
         "amount":"1000",
         "type":"INVESTOR"
      }
   ]
...

Creating accounts

New accounts could be created using the Loan Accounts API.
POST {
   "loanAccount":{
      "id":"11255",
      "accountHolderType":"CLIENT",
      "accountHolderKey":"40288a7d4f45f0fd014f45f18b8400ec",
      ...//Other account info
      "funds":[
         {
            "guarantorKey":"GUARANTOR_KEY",
            "savingsAccountKey":"SAVINGS_ACC_KEY",
            "amount":"500"
         }
      ]
   }
} /api/loans
Parameter Value
guarantorKey The encoded key of the client that will invest in the loan
savingsAccountKey The client savings account encoded key. It needs to be an active loan of type Funding Account
amount The amount to be funded by the savings account. The account should have enough balance to cover this amount

 

Updating loan funds

Funding loans can be done through a POST to /api/loans/{loan_id}/funds API. Any existing investment funds that are not specified in this update call will be deleted and activities will be logged for this change.
POST {
   "funds":[
      {// edit an existing investment fund
         "encodedKey":"40288a5d4f3fbac9014f3fd02745001d",
         "guarantorKey":"40288a5d4f273153014f2731afe40102",
         "savingsAccountKey":"40288a5d4f3fbac9014f3fcf822c0014",
         "amount":"50"
      },
      {// add a new investment fund
         "guarantorKey":"40288a5d4f273153014f2731afe40103",
         "savingsAccountKey":"40288a5d4f3fbac9014f3fcf822c0015",
         "amount":"100"
      }
   ]
}/api/loans/11255/funds
Permissions required:

* Create funds. Adding new funding source.
* Edit funds. Editing an existing funding source.
* Delete funds. Deleting funding source.

Retrieving the schedule

Get the list of repayments or the list of loans which are founded by a particular account.
//retrieve  a list of repayments with the principal due/paid, state, last payment, and other details
GET /api/savings/{SAVINGS_ACCOUNT_ID}/funding/{LOAN_ACCOUNT_ID}/repayments

//get the list of loans which are funded by a particular account
GET /api/savings/{SAVINGS_ACCOUNT_ID}/funding
Permissions required:
 * View Fund Details.
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