API – Loan Portfolios

General

This article covers assigning a loan to a portfolio/subportfolio and removing a loan from a portfolio/subportfolio. This is done by sending a PUT request to the loan on which you wish to add or remove a portfolio/subportfolio.

Assign a Porfolio/SubPortfolio:

To assign a loan to a portfolio or a group of portfolios, send a PUT request to the loan you are assigning. Example: If you have a loan id 123 the endpoint would be https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(123). 

Below is a sample payload:

{
  "Portfolios": {
    "results": [
      {
        "__metadata": {
          "uri": "/api/1/odata.svc/Portfolios(id=7)",
          "type": "Entity.Portfolio"
        }
      }
    ]
  },
"SubPortfolios":{
"results":[
{
"__metadata":{
"uri": "\/api\/1\/odata.svc\/Portfolios(id=1)",
"type": "Entity.SubPortfolio"
}
}
]
}
}
  • __metadata – The metadata for the portfolio. (Change the "id" parameter in the "uri" string to the id of the portfolio in the tenant settings)
  • type – should be set to "Entity.Portfolio"

If you wish to assign multiple portfolios/subportfolios, simply add a new object to the "results" array for each portfolio/subportfolio to which you want to assign the loan. 

I.E. add the following to the "results" array for porfolios:

      {
        "__metadata": {
          "uri": "/api/1/odata.svc/Portfolios(id=7)",
          "type": "Entity.Portfolio"
        }
      }

To add multiple subportfolios, simply change the entity type to be  "type": "Entity.SubPortfolio".

Remove a Portfolio/Subportfolio:

Send a PUT request to loan you wish to remove a portfolio/subportfolio from. 

Sample payload:

{
  "Portfolios": {
    "results": [
      {
        "__metadata": {
          "uri": "/api/1/odata.svc/Portfolios(id=7)",
          "type": "Entity.Portfolio"
        },
"__destroy":true
      }
    ]
  },
"SubPortfolios":{
"results":[
{
"__metadata":{
"uri": "\/api\/1\/odata.svc\/Portfolios(id=1)",
"type": "Entity.SubPortfolio"
},
"__destroy":true
}
]
}
}
  • __metadata – The metadata for the portfolio. (Change the "id" parameter in the "uri" string to the id of the portfolio in the tenant settings)
  • type – should be set to "Entity.Portfolio"

If you wish to remove multiple portfolios/subportfolios from a loan, simply add a new object to the "results" array for each portfolio/subportfolio to which you want to remove from the loan. I.E. add the following to the "results" array


How did we do?


Powered by HelpDocs (opens in a new tab)