API – Logging a Payment
Logging payments can be done in the UI or through the API, which this article explains. To use the API, send a PUT request to the loan on which you wish to log the payment. This article will cover Log Only (payments that will only be logged in LoanPro, but no funds will be transferred from the borrower). This article also won’t cover payments that are split or duplicated across linked loans. It also assumes you already have an existing loan. If not, see Creating a Loan with the API.
To log a payment on a loan, you will need to send a PUT request to the URL of the desired loan. For example, to log a payment on the loan with the id 515, the URL would be https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(515)
Below is an example of a payment request
"info": "05/26/2017 Credit/Debit Card",
- selectedProcessor – Id of selected processor (should be set to zero when logging a payment because no funds are being transferred)
- paymentMethodId – The ID of the payment method to use for the payment
- Determined by tenant settings (Settings > Loan > Payments > Methods) Find the ID on the left hand side of the payment method being used.
- early – Early payment setting
- amount – The amount of the payment
- date – The date the payment will be applied on (format YYYY-MM-DD)
- info – Human readable information describing the payment
- paymentTypeId – The ID of the Payment Type (waterfall application of the payment)
- Determined by tenant settings (Settings > Loan > Payment > Types) Find the ID on the left hand side of the payment type being used.
- active – Should be a 1
- resetPastDue – Whether or not the payment should reset the amount past due (0 = no, 1 = yes)
- payoffPayment – Whether or not it is a payoff payment (True or False)
- _saveProfile - Set this to “1” if specifying a new payment process you want to save. Zero is do not save.
- extra – How extra is applied. (Must match the Loan Setup Between Periods/Transactions value). See Payment Collections for detailed information and available options
- cardFeeType – The type of the card fee to apply. See Payment Collections for detailed information
- cardFeeAmount – The flat amount of the card fee
- cardFeePercent – The percentage of the card fee
- __logOnly – Set to true to only log the payment
- payoffFlag – Flag for payoff payments. (0 = no, 1 = yes)
Other Fields that are Available:
There are many other fields available, most of which are automatically set by the system. This section will cover them. Fields that are automatically set do not need to be sent by an application using the API, rather, they are evaluated on the server and sent back to give more information about a payment.
- id – The ID of the payment (automatically set)
- displayId – The display ID of the payment (how it will be identified in the system; automatically set)
- priorcutoff – Whether or not it is prior to the tenant cutoff date (automatically set)
- beforeAmountPastDue – The amount past due before the payment (automatically set)
- beforeDaysPastDue – The days past due before the payment (automatically set)
- beforePayoff – The payoff before the payment (automatically set)
- beforePrincipal – The principal balance before the payment (automatically set)
- comments – To be set for any changes to payments; describes the changes made to the payment
- echeckAuthType – The echeck authorization type for echeck payments. See Payment Collections
- status – The status of the payment (default: “None”)
- sortDate – The date (as an int) to sort it by (automatically set)
- chargeOffRecovery – Whether or not this is a charge-off recovery payment (0 or 1); set to 1 to make a charge-off recovery payment
- CustomFieldValues – Any custom field values for the payment. See API – Custom Fields
- order – A tie breaker for the ordering (automatically set)
- _notEditable – Whether or not it shouldn’t be editable (default is “false”)
Many of our articles use StackBlitz examples like this. These examples are like a window into a REST client right here in your browser. The window is divided into two sides. Developers can use info in the editor on the left side when configuring your API integration, and the right side shows a preview of a REST client. Click 'Preview' on the bottom, and you'll only see the REST client.
The entire request is set up and connected to a demo API tenant in LMS. Just scroll down and click 'send' and you should get a 200 response. If you want to get some practice with error codes, try editing the endpoint, headers, method and payload to see what responses you get.