API – Creating AutoPays for Parent-Child Loans

General

This article goes over how to create an AutoPay for a parent loan through the API. Creating an AutoPay on a parent loan requires additions to the typical AutoPay Payload.

When creating the AutoPay, use this request:

PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(id)

Make sure to change id to the ID of the parent loan you are using. The payload should look something like this:

{
   "Autopays":{
      "results":[
         {
            "name":"Single AutoPay",
            "type":"autopay.type.single",
            "paymentExtraTowards":"payment.extra.tx.classic",
            "amountType":"autopay.amountType.static",
            "amount":"100.00",
            "paymentType":1,
            "chargeServiceFee":"0",
            "processCurrent":1,
            "retryDays":0,
            "processTime":0,
            "postPaymentUpdate":0,
            "applyDate":"2021-12-20",
            "processDate":"12/20/2021",
            "methodType":"autopay.methodType.debit",
            "recurringFrequency":"autopay.recurringFrequency.monthly",
            "recurringDateOption":"autopay.recurringDate.processDate",
            "schedulingType":"autopay.schedulingType.calendarDay",
            "processDateCondition":"calendarDays",
            "payoffAdjustment":1,
            "chargeOffRecovery":0,
            "processZeroOrNegativeBalance":0,
            "recurringPeriods":12,
            "lastDayOfMonthEnabled":0,
            "PrimaryPaymentMethod":{
               "__metadata":{
                  "uri":"http://loanpro.simnang.com/api/public/api/1/odata.svc/PaymentAccounts(id=362)",
                  "type":"Entity.PaymentAccount"
               },
               "id":362,
               "type":"paymentAccount.type.checking"
            },
            "mcProcessor":"{\"creditCard\":{\"id\":\"10\",\"key\":\"anet\",\"name\":\"Test Default Processor\",\"default\":\"1\"}, \"bankAccount\":{\"id\":\"11\",\"key\":\"speedchex\",\"name\":\"Test Bank Account Processor\",\"default\":\"1\"}}",
            "ccProcessor":"10",
            "baProcessor":"11",
            "processDateTime":"2019-12-20 07:00:00",
            "PaymentType":{
               "__metadata":{
                  "type":"Entity.CustomPaymentType",
                  "uri":"/api/1/odata.svc/CustomPaymentTypes(id=1)"
               }
            }
         }
      ]
   }
}

In the "PrimaryPaymentMethod" of the payload, you should make sure you're using the payment profile ID's for the customer (found by going to Customer > Payment Profiles within the loan) in the uri and id parameters (in short, anywhere it says '362' here). The "paymentAccount.type.checking" is a collection that may also need to be changed depending on what type of payment profile is being used.

Variable

Description

paymentAccount.type.credit

Used for credit card payment profiles

paymentAccount.type.checking

Used for checking account payment profile

If you get an error, make sure the "date" is updated.

The difference between a standard AutoPay and an AutoPay on a parent loan is that the payload contains the TransactionChilds object. This allows you to allocate each portion of the AutoPay amount correctly to each child loan. The amounts should add up to the total amount of the AutoPay.

Variable

Description

loanChildId

This is the ID of the child loan.

entityType

This should equal Entity.Autopay.

amount

This is the amount of the AutoPay that will be applied to the child loan.


How did we do?


Powered by HelpDocs (opens in a new tab)