API – Addresses
This article explains how to add, update, and delete addresses via the API.
Many entities will require address information, and this information can be added or updated either within the UI or through the API. Often, to set the address for an entity in LoanPro, you will send the address information in the address field of the entity.
Adding New Addresses
Since addresses are tied to customers, they are created when customers are created. To add a new customer address, you will need to send a POST request to the Customer endpoint. You can add an address to the following URL.
Here is the body of the request.
"address1": "100 10th Street",
"city": "San Francisco",
Now that you know how to add new addresses, let's update an existing one.
To update an existing address, you will need to send a PUT request to the URL of the desired customer. For example, to update a customer's address with the customer ID of 1137, the URL would be as follows.
Below is a sample payload for setting the primary address of a customer:
"address1": "201 E Randolph St",
The street address
Any additional street address information (e.g. suite number, apartment number)
The city. In the case of overseas military addresses, this will be a three-letter designation for the branch of the armed forces. APO stands for Army Post Office, and is used for service members in the Army and Air Force. Addresses for Navy ships and installations will use FPO, short for Fleet Post Office. DPO stands for Diplomatic Post Office, the address code for U.S. embassies.
The state, province, or military address designation. States are formatted “geo.state.<STATE CODE>” where <STATE CODE> is the two character abbreviation of the state. See API – Geo Collections.
The ZIP code where the address is located
The country where the address is located
For Canada, it is formatted "company.country.can"
The United States is formatted as "company.country.usa"
The latitude of the address (optional)
The longitude of the address (optional)
Set to "1" to be able to use the address
Determines whether the address will be verified (usually through USPS)
Determines whether the address will be standardized through USPS
Since this is an update, you will need to include "__update" and "__id" fields within the PrimaryAddress object and outside of it. These tell the system to update the address and update the customer to reflect those changes.
You can update a linked address via the exact same process listed above.
To update an address that has not been linked to a customer, you will need know how to find the ID of the individual address. These ID's cannot be found within the UI, but they can be found by using an API request. There are two ways that you can find the address ID's:
- If you know the customer's ID, you can find the address ID by sending a GET request to the following URL.
- Alternatively, if you don't have a customer ID, you can pull all address ID's by using the following request.
Once you know the address ID, you can update the unlinked address by sending a PUT request to the URL of the specific address like shown below. In this example, our address ID is 3.
Deleting an Address
To delete an address, send a DELETE request to the URL of an address like shown below.