API – Payment Report
Introduction
LoanPro’s payment report offers detailed information about payments made and which loans the payments were applied towards. Each time a payment report is pulled a query is used to specify what gets pulled based off of either the payment information and/or the loan information. This gives great power and flexibility to pull detailed reports about specific or generalized payment histories.
There are many aspects to a payload, and this article will cover the basics and provide links to resources so you can learn more about how each element works.
Request URL
You'll send the request to this endpoint:
POST https://loanpro.simnang.com/api/public/api/1/Autopal.PaymentReport
All requests sent to this endpoint will be a POST request. Please note that this is different than many other requests to get data where GET requests are used. This is due to the payload sizes becoming potentially large and to keep the URLs readable.
Payload Sections
There are two main sections to the payload:
- query
- reportOptions
Each section contains an integral part to the query of the data, and each has its own parameters and format.
Query
The query section is formatted as follows:
{
"query": {
"bool": {
"must": [
{
"match": {
"active": "1"
}
},
{
"match": {
"loanStatusId": "2"
}
}
]
}
}
These queries are modeled after the queries used by Elasticsearch and are discussed more in depth in the article API Query Objects. The payload above is telling the system to look for payments made on loans that are active and have the loan status ID of 2. The must
parameter is also telling the system that both of the parameters below must be met—not one or the other.
Report Options
The report options section is where fields specific to the Payments Report are placed. Here's a sample of that half of the payload:
"reportOptions": {
"method": "all",
"type": "all",
"status": "all",
"reversereason": "all",
"chargeOff": "all",
"period": "other",
"dateFrom": "2000-01-01T00:00:01",
"dateTo": "2030-01-01T23:59:59",
"changedPeriod": "other",
"changedDateFrom": "2000-01-01T00:00:01",
"changedDateTo": "2030-01-01T23:59:59",
"portfoliosCriteria": "all",
"splitPayments": "all",
"batchId": "",
"processorStatus": "",
"dateEnteredPeriod": "other",
"dateEnteredTo": "",
"dateEnteredFrom": "",
"chargeOffRecovery": "all"
}
These fields are outlined below:
Variable | Description | Possible Values |
method | Restrict by payment method. |
|
type | Restrict by payment type. |
|
status | Restrict by payment status. |
|
period | The application date period. Defaults to “today”. |
|
dateFrom | The starting date for the application range | Formatted with the ISO 8601 Format |
dateTo | The ending date for the application date range. | Formatted with the ISO 8601 Format |
changedPeriod | The date period for when the payment was last changed. | Same values as the "period" field. |
changedDateFrom | The starting date for the payment changed date range. Defaults to “today”. | Formatted with the ISO 8601 Format |
changedDateTo | The starting date for the payment changed date range. | Formatted with the ISO 8601 Format |
sourceCompanies | An array of JSON objects, each containing an integer "id" of a source company. | |
splitPayments | Whether to restrict to only split payments. |
|
processorStatus | This will be aligned with the Secure Payments status of the payment. |
|
dateEnteredPeriod | The period for when the payment was entered into the system. | Same values as the period field. |
dateEnteredTo | The starting date for the payment entered date range. | Defaults to “today”. Formatted with the ISO 8601 Format |
dateEnteredFrom | The ending date for the payment entered date range. | Defaults to “today”. Formatted with the ISO 8601 Format |
chargeOff | Whether to restrict by charge off. |
|
postedBy | Text to match in the description of who posted the payment | |
customFields | An array variable. This only supports payment custom fields of “select” type. |
Putting it all Together
Below is a sample request that pulls all active loans with a loan status of Open - Repaying (which has the ID of 2). The payments were applied between the year 2000 and 2030 and last edited in the same time frame. There are no other restrictions.
{
"query": {
"bool": {
"must": [
{
"match": {
"active": "1"
}
},
{
"match": {
"loanStatusId": "2"
}
}
]
}
},
"reportOptions": {
"method": "all",
"type": "all",
"status": "all",
"reversereason": "all",
"chargeOff": "all",
"period": "other",
"dateFrom": "2000-01-01T00:00:01",
"dateTo": "2030-01-01T23:59:59",
"changedPeriod": "other",
"changedDateFrom": "2000-01-01T00:00:01",
"changedDateTo": "2030-01-01T23:59:59",
"portfoliosCriteria": "all",
"splitPayments": "all",
"batchId": "",
"processorStatus": "",
"dateEnteredPeriod": "other",
"dateEnteredTo": "",
"dateEnteredFrom": "",
"chargeOffRecovery": "all"
}
}