API - Linking and Unlinking Customers and Loans

Linking a Customer

To link customers to a loan, send a PUT request to the loan you want to link to. For example, to link to loan 35 send the request to https://loanpro.simnang.com/api/1/odata.svc/Loans(35).

Request body to link customer with id 36:

{
  "Customers": {
    "results": [
      {
        "__metadata": {
          "uri": "/api/1/odata.svc/Customers(id=36)",
          "type": "Entity.Customer"
        },
        "__setLoanRole": "loan.customerRole.secondary"
      }
    ]
  }
}
  • __metadata – the __metadata for the customer (pull a GET request on the customer to get the metadata)
  • __setLoanRole – the role of the customer on the loan (See API Customer Loan Collections)

Unlinking a Customer

To unlink a customer, send a PUT request to the loan.

Request body to unlink customer with id 36:

{
  "Customers": {
    "results": [
      {
        "__destroy": true,
        "__metadata": {
          "uri": "/api/1/odata.svc/Customers(id=36)",
          "type": "Entity.Customer"
        }
      }
    ]
  }
}
  • __destroy – set to try to destroy the link relation
  • __metadata – the __metadata for the customer (pull a GET request on the customer to get the metadata)


How did we do?


Powered by HelpDocs (opens in a new tab)