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 to the loan's endpoint.

This endpoint is unique to each loan because it contains that loan's ID. If you don't know the ID for the loan you're working with, see our article on Finding Loan and Customer IDs.

The request body needs the appropriate fields for updating an entity and the fields 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

PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(232)
 {
  "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": "Fee Forgiveness Program",
"active": 0,
"isReversal": 1,
"__update": true,
"__id": 211
  }
]
}
}
  • editComment – Like in the first example, this field lets you add a comment explaining why you are reversing the charge.
  • isReversal – This field just says that this is a charge reversal. 1 indicates yes; 0 would indicate no.
  • active – Should be set to 0 for reversals, showing that the charge will no longer be active.
  • __update – This must be set to “true”. (See API – Updating Entities.)
  • __id – This must be the ID for the charge you want to update (do a GET request if needed to get the ID)


How did we do?


Powered by HelpDocs (opens in a new tab)