Location Service
The Location Service is responsible for the management of locations and addresses. This service provides storage of locations and country/city-specific data (such as country name, city name, zip code, etc.) which can be used to validate whether info provided in location is valid or not. Note that, location or static data is tenant-specific.
A location is a particular place or position. To represent it as an address is not enough. It can be represented by a geopoint or a combination of address and geopoint.
Thus, a location could be an address and/or a geocode.
To add a location, call the Create Location endpoint. To update a location, call the Update Location endpoint.
The following table shows the parameters that are passed to the Create location endpoint. The Update Location endpoint takes a subset of these parameters as necessary for the update:
Member | Description | Data type |
buildingNumber | House number of the address. It must be 1 to 16 characters in length. | string |
addressLine1 | The street information of the address. It must be 1 to 128 characters in length. | string |
addressLine2 | An optional additional field for the street address. It must be 1 to 128 characters in length. | string |
addressLine3 | An optional additional field for the street address. It must be 1 to 128 characters in length. | string |
city | The city, town, or village of the address. The value must match 'a-z' or 'A-Z', inclusive (range). | string |
state | State of the address. The value must match 'a-z' or 'A-Z', inclusive (range). It must be 2 to 64 characters long. | string |
code | The two-letter code for the country. The value must match 'A-Z', inclusive (range). It must be 2 or 3 characters long. | string |
name | The name of the country of the address. The value must match 'a-z' or 'A-Z', inclusive (range). It must be 2 to 64 characters long. | string |
lat | The range of latitude is -90 to 90 and can be up to 6 decimal places. Example: 30.3752° N | string |
long | The range of longitude is -180 to 180 and can be up to 6 decimal places. Example: 76.7821° E | string |
Request bodies are specified in JSON format. The following examples show a request body for creating a Location and a request body for updating a Location:
The location is considered as an aggregation of address and geocode. With that, an apartment in a building has an address and geocode. The apartment number is identified by the buildingNumber in the address. Thus two apartments in a building will be distinguished by different addresses.
Location, GeoCode, and Address is defined in Location Service as:
Location:
- address: Address
- geocode: Geocode
- locationInfo: Object
GeoCode:
- Longitude (double)- The range of longitude is -180 to 180 and can be up to 6 decimal places.
- Latitude (double)- The range of latitude is -90 to 90 and can be up to 6 decimal places.
Address:
- buildingNumber (string)- Building number of the address.
- addressLine1 (string)- The street information of the address.
- addressLine2 (string)- An optional additional field for the street address.
- addressLine3 (string)- Another optional additional field for the street address of the billing address.
- county (string): County of the address.
- city (string)- The city, town, or village of the address.
- state (string)- State of the address.
- zipCode (string)- Postal code of the address.
- country (Country)- Country consists of code and name.