API – Update a Customer

General

This article covers the basics for updating a customer using the LoanPro API.

Update a Customer

To update a customer, send a PUT request to the following URL.

 PUT  https://loanpro.simnang.com/api/public/api/1/odata.svc/Customers({customerId})

The data must be sent over the request with a Content-Type of “application/json”. Below is an example of a request header.

Authorization: Bearer API_TOKEN
Autopal-Instance-ID: INSTANCE_ID
Content-Type: application/json

The request body can contain the following fields that are specific to the customer:

  • customId –  A custom id to identify the customer
  • customerType – The type of customer (see API Customer Collections for more details)
  • status – The status of the customer (options determined by tenant settings)
  • firstName – The first name of the customer
  • lastName – The last name of the customer
  • middleName – The middle name of the customer
  • birthDate – The birthday of the customer
  • gender – The gender of the customer (see API Customer Collections)
  • generation code – The Generation Code of the customer (see API Customer Collections)
  • email – The customer’s email address
  • ssn – The Social Security Number of the customer (take care to not reveal this number to unauthorized parties)
  • driverLicense – The driver license number of the customer
  • companyName – Company name of the customer (if customer is a company)
  • contactName – The name of the contact at the company (if customer is a company)
  • customerIdType – The type of government ID number for a customer (see API Customer Collections)
  • customerId – The government ID number for a customer
  • creditLimit – The credit limit of a customer (if customer type is flooring)
  • accessUserName – The username for the customer to use to access the customer website
  • accessPassword – The password for the customer to use to access the customer website
  • ofacMatch – Whether or not the customer matches any individual from the OFAC specially designated nationals list
  • ofacTested – Whether or not the customer has been tested for OFAC compliance

You can also update information in nested entities with a PUT request sent to the odata.svc/Customers() endpoint. Listed below is a sample body for an individual.

{
"id": 555,
"status": "Active",
"customerType": "customer.type.individual",
"customerIdType": "customer.idType.ssn",
"gender": "customer.gender.male",
"generationCode": "customer.generationCode.none",
"CustomFieldValues": {},
"birthDate": "1990-01-01",
"firstName": "John",
"middleName": "",
"lastName": "Dow",
"ssn": "855616513",
"driverLicense": "",
"accessUserName": "none@simnang.com",
"email": "none@simnang.com",
"__id": 555,
"__update": true
}

For any entities that you want to update that are nested inside of Customer, make sure you include the ID of the entity and the update property. For example, "__id": 123, "__update": true .

The StackBlitz example below demonstrates how to update a customer using the API.

StackBlitz Example

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.


How did we do?


Powered by HelpDocs (opens in a new tab)