Communicating with the API

Introduction

The LoanPro API is based on HTTP and uses TLS 1.1+ to encrypt its communication channel. As a result, any TCP library and TLS library can be used to communicate with the LoanPro API. Many languages, such as PHP and Javascript, come with these libraries built in, making it easy to communicate with the LoanPro API.

This article will cover the basic format for the HTTP request header used in communicating with the LoanPro API and the general format of the request body.

Authentication

The LoanPro API will look for three special headers to authenticate your request. They are the “Authorization”, “Autopal-Instance-ID”, and “Content-Type” headers.

The Authorization header has the following format:

Authorization: Bearer {your_api_token}
Remember to replace “{your_api_token}” with your actual token. The word “Bearer” is required before the API token; omitting it will lead to a 401 error.

The Autopal-Instance-ID header has the following format:

Autopal-Instance-ID: {your_tenant_id}
Remember to replace “{your_tenant_id}” with your actual tenant ID.

The specific API Token and Tenant ID for your company can be found inside of the UI under Settings > Company > API > Overview. Please remember to NEVER share your API Token via email or any unsecured method.

Finally, the Content-Type header has the following format:

Content-Type: application/json

Your completed headers will look something like this:

Authorization: Bearer 1111111111111318dc37271a2617625dd00137b4

Autopal-Instance-ID: 5200000

Content-Type: application/json

Your headers will need to be spelled and formatted exactly as they are shown here to work. 

Sending Data

Sending data is completed through the body of the request call. All data sent to LoanPro must be in a JSON format. Below is an example of a simplified version of the request used to create a customer:

{
"status": "Active",
"customerType": "customer.type.individual",
"customerIdType": "customer.idType.ssn",
"firstName": "John",
"lastName": "Doe",
"ssn": "111223333",
"birthDate": "1970-01-15",
"driverLicense": "196230586",
"gender": "customer.gender.male",
"generationCode": "customer.generationCode.none",
"PrimaryAddress": {
"address1": "201 E Randolph St",
"city": "Chicago",
"state": "geo.state.IL",
"zipcode": "60602",
"country": "company.country.usa",
"geoLat": "41.882648",
"geoLon": "-87.623102",
"verify": true
}
}

The example above will send information about the customer to the server. This is a simplified version of this request, however; much more information can be added for a customer such as their phone number(s), employer information, references, and more. You'll notice that there is an object called PrimaryAddress in this payload that holds more information. This is common for many LoanPro API requests.

API Documentation

We've documented all of the available endpoints and their JSON requests on our ReadMe site. ReadMe is an API documentation website, and we find their UI straightforward and easy-to-use. We've also put our documentation up on Swagger UI if you prefer their layout: LoanPro API Explorer on Swagger UI.


How did we do?


Powered by HelpDocs (opens in a new tab)