API – Escrow Transaction
Introduction
This article explains how to create a new Escrow transaction for a loan with the API. For more information on creating Escrow transactions with the LMS UI, read our Create a New Escrow Transaction article.
Adding a New Escrow Transaction
To add a new escrow transaction for a loan, send a PUT request to the URL for the loan. For example, to add an escrow transaction to a loan with an ID of 55, send a request to the following endpoint.
PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(55)
The body of the request should look like the example here:
{
"EscrowTransactions": {
"results": [
{
"date": "2015-11-24",
"amount": "950.00",
"type": "transaction.type.withdrawal",
"category": 7,
"description": "Testing",
"subset": 2
}
]
}
}
- date – The date for the transaction will apply, formatted YYYY-MM-DD
- amount – The amount of the transaction
- type – The transaction type (See API Transactions Collection)
- category – The ID of the transaction category (set in loan settings for the tenant)
- description – The description of the escrow transaction
- subset – The ID of the escrow bucket (set in loan settings for the tenant)
Updating an Escrow Transaction
To update an existing escrow transaction for a loan, send a PUT request to the URL for the loan. For example, to update an escrow transaction for a loan with an ID of 55, send a request to the following endpoint.
PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(55)
The body of the PUT request should look like this:
{
"EscrowTransactions": {
"results": [
{
"loanId": 346,
"subset": 2,
"category": 7,
"description": "Testing",
"date": "2015-11-24",
"type": "transaction.type.withdrawal",
"amount": "250.00",
"_timestamp": 0,
"__id": 31,
"__update": true
}
]
}
}
- __id – The id of the escrow transaction
- __update – Set to “true” to update the escrow transaction
Deleting an Escrow Transaction
To delete an existing escrow transaction for a loan, send a PUT request to the URL for the loan. For example, to delete an escrow transaction for a loan with an ID of 55, send a request to this endpoint:
PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(55)
The body of the PUT request should be like the following.
{
"EscrowTransactions": {
"results": [
{
"__id": 32,
"__destroy": true
}
]
}
}
- __destroy – Set to “true” to delete the escrow transaction