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.

  • Found in Settings > Loan > Payments > Methods. Values are the titles of payment methods, not the IDs.
  • Use “all” to search for payments using any payment method.

type

Restrict by payment type.

  • Found in Settings > Loan > Payments > types. Values are the titles of payment types, not the IDs.
  • Use “all” to search for payments of any type.

status

Restrict by payment status.

  • “all” for any status
  • “new” for newly created payments
  • “edited” for edited payments

period

The application date period. Defaults to “today”.

  • "today" for payments applying today
  • "tw" for payments applying this week
  • "td" for the past 30 days
  • "mtd" for Month to Date
  • "ytd" for Year to Date
  • "yesterday" for payments applied yesterday
  • "lw" for last week
  • "lm" for last month
  • "ly" for last year
  • "custom" for a custom date range (specified by dateFrom and dateTo)
  • "other" for a different date range (specified by dateFrom and dateTo)

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.

  • “all” – don’t restrict to split payments
  • “yes” – restrict to only split payments
  • “no” – exclude all split payments

processorStatus

This will be aligned with the Secure Payments status of the payment.

  • "PENDING"
  • "PROCESSING"
  • "VOIDED"
  • "FAILED"
  • "SETTLED SUCCESSFULLY"

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.

  • “all” – don’t restrict to charge offs
  • “yes” – restrict to only charge offs
  • “no” – exclude all charge offs

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"
}
}


How did we do?


Powered by HelpDocs (opens in a new tab)