AltScore
Borrower Central (BC)

Addresses API

This API allows managing the addresses associated with borrowers in the system. It provides endpoints to create, read, update, and delete addresses, as well as to handle attachments related to them.

The Address Object

The Address object represents an address in the system.

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "borrowerId": "789e0123-f45b-67d8-a901-234567890123",
  "label": "Home",
  "street1": "Main Street 123",
  "street2": "Apartment 4B",
  "neighborhood": "Downtown",
  "city": "Example City",
  "state": "Example State",
  "zipCode": "12345",
  "reference": "In front of the park",
  "country": "MEX",
  "province": "Example Province",
  "lat": 19.4326,
  "lon": -99.1332,
  "priority": 1,
  "isHome": true,
  "isWork": false,
  "createdAt": "2023-04-01T12:00:00Z",
  "updatedAt": "2023-04-02T14:30:00Z",
  "hasAttachments": true
}

Attributes

AttributeDescriptionType
idUnique identifier of the addressString
borrowerIdAssociated borrower's IDString
labelDescriptive label of the addressString
street1Main line of the addressString
street2Secondary line of the address (optional)String
neighborhoodNeighborhood or district (optional)String
cityCity (optional)String
stateState or region (optional)String
zipCodePostal code (optional)String
referenceAdditional reference (optional)String
countryCountry code (ISO3)String
provinceProvince (optional)String
latLatitude (optional)Float
lonLongitude (optional)Float
priorityPriority of the address (optional)Integer
isHomeIndicates if it is the home addressBoolean
isWorkIndicates if it is the work addressBoolean
createdAtCreation date and timeString
updatedAtLast update date and timeString
hasAttachmentsIndicates if it has attachmentsBoolean

Endpoints

Create a New Address

Creates a new address in the system.

POST /v1/addresses

Input Parameters:

ParameterDescriptionTypeRequired
borrowerIdAssociated borrower's IDStringYes
labelDescriptive label of the addressStringNo
street1Main line of the addressStringYes
street2Secondary line of the addressStringNo
neighborhoodNeighborhood or districtStringNo
cityCityStringNo
stateState or regionStringNo
zipCodePostal codeStringNo
referenceAdditional referenceStringNo
countryCountry code (ISO3)StringYes
provinceProvinceStringNo
latLatitudeFloatNo
lonLongitudeFloatNo
priorityPriority of the addressIntegerNo
isHomeIndicates if it is the home addressBooleanNo
isWorkIndicates if it is the work addressBooleanNo

Request Example:

{
  "borrowerId": "789e0123-f45b-67d8-a901-234567890123",
  "label": "Office",
  "street1": "Commercial Avenue 456",
  "city": "Example City",
  "state": "Example State",
  "zipCode": "54321",
  "country": "MEX",
  "isWork": true
}

Successful Response:

{
  "id": "123e4567-e89b-12d3-a456-426614174000"
}

Update an Address

Updates an existing address.

PATCH /v1/addresses/:address_id

Path Parameters:

ParameterDescription
address_idID of the address to update

Input Parameters:

The same as in creation, but all are optional.

Request Example:

{
  "label": "New Office",
  "street1": "Business Avenue 789",
  "zipCode": "67890"
}

Successful Response:

Returns the updated Address object.

Get an Address

Retrieves the information of a specific address.

GET /v1/addresses/:address_id

Path Parameters:

ParameterDescription
address_idID of the address to retrieve

Successful Response:

Returns the complete Address object.

Delete an Address

Deletes an address from the system.

DELETE /v1/addresses/:address_id

Path Parameters:

ParameterDescription
address_idID of the address to delete

Successful Response:

Status code 204 (No Content) if the deletion was successful.

List Addresses

Retrieves a paginated list of addresses with filtering options.

GET /v1/addresses

Query Parameters:

ParameterDescriptionType
borrower-idFilter by borrower's IDString
form-idFilter by form IDString
searchText to search in addressesString
pagePage number (default: 1)Integer
per-pageItems per page (default: 10)Integer
sort-byField to sort byString
sort-directionSorting direction (asc or desc)String

Successful Response:

Paginated list of Address objects.

Add an Attachment to an Address

Adds an attachment to a specific address.

POST /v1/addresses/:address_id/attachments

Path Parameters:

ParameterDescription
address_idID of the address to attach the file to

Input Parameters:

ParameterDescriptionType
urlURL of the attachmentString
fileExtensionFile extensionString
labelDescriptive label of the file (optional)String
metadataAdditional metadata (optional)Object

Get Attachments of an Address

Retrieves the list of attachments of a specific address.

GET /v1/addresses/:address_id/attachments

Path Parameters:

ParameterDescription
address_idID of the address to get attachments from

Successful Response:

List of Attachment objects associated with the address.

Upload an Attachment to an Address

Uploads an attachment directly to a specific address.

POST /v1/addresses/:address_id/attachments/upload

Path Parameters:

ParameterDescription
address_idID of the address to upload the file to

Form Parameters:

ParameterDescriptionType
fileFile to uploadFile
labelDescriptive label of the file (optional)String
metadataAdditional metadata in JSON format (optional)String

Delete an Attachment from an Address

Deletes a specific attachment from an address.

DELETE /v1/addresses/:address_id/attachments/:attachment_id

Path Parameters:

ParameterDescription
address_idID of the address
attachment_idID of the attachment to delete

Successful Response:

Status code 204 (No Content) if the deletion was successful.

Error Handling

The API may return the following error codes:

CodeDescription
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error

Errors will include a descriptive message in the response body.

On this page