API – Edit Charge
General
This article assumes you have read the following articles:
When updating a charge, there is one extra field that needs to be set. This field is the editComment field. The editComment field is required, and allows you to keep track of why a charge was changed.
To change a charge, send a PUT request with the appropriate fields for updating an entity and the fields needed for the charge, as well as the editComment field. Below is a sample request for updating a charge with the id 232. The editComment field is in bold
{
"Charges": {
"results": [
{
"id": 232,
"displayId": 6439,
"info": "Hallway Toll 12/07/2015",
"date": "2015-12-07",
"priorcutoff": false,
"amount": "12.00",
"chargeTypeId": 13,
"paidAmount": "0.00",
"paidPercent": "0.00",
"chargeApplicationType": "loan.latefeeapp.standard",
"interestBearing": 1,
"active": 1,
"_notEditable": false,
"ParentCharge": {},
"ChildCharge": {},
"order": 0,
"__update": true,
"__id": 232,
"editComment": "Clerical Error"
}
]
}
}
- displayId – The displayed id of the charge inside of LoanPro
Charge Reversal
To reverse a charge, you will perform a charge edit (see above section), but will add the field isReversal and set that to be 1, and set the active field to be 0; the editComment, __update, and __id fields are the only other required fields.
Below is an example for reversing a charge with the ID 211 on loan 213:
POST https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(213)
{
"Charges": {
"results": [
{
"editComment": "test",
"active": 0,
"isReversal": 1,
"__update": true,
"__id": 211
}
]
}
}