HomeGuidesAPI ReferenceChangelogDiscussions
GuidesAPI ReferenceDiscussions

Export a Home Loan

Overview

The following sections will show you how to export loan data and borrower information out of Blend using the Blend public API. This will also include knowing when to export a loan, how to export the loan, and how to update the Blend loan status during/after the export has taken place.

For instructions on Document retrieval from Blend, please refer to the Export Documents reference.

Endpoints

There will be two primary endpoints and methods used during the export process. The exact information and how it will be retrieved will be specified in the endpoint.

  • GET /loans - Loan endpoint
  • POST /export-status - Loan export status

1. Know when to Export a loan

Blend will update the status of a loan whenever it's exportable. We recommend you use the GET /loans endpoint to see which loans meet your export criteria.

What does Blend consider an 'exportable' loan in this case?

  1. The borrower(s) submits their application in Blend
  2. A user in Blend clicks 'Export' in the loan's Overview page
  3. TRID triggered (if applicable)

Examples:

  • /loans?exportable=true&losId-exists=false
    • Provides a list of loans that are exportable from Blend and do not have a returned LOS key/id
  • /loans?exportable=true&losId=false&cursor=biwxNTIzMDI3NzIxNzY2LDBiZTg3ZWU0LTZkODAtNDViNi04YjNhLWVkMTg0NmNlZjYzZA
    • Allows you to paginate to next list of loans. There is a limit of 50 results per page.

2. Export Loan Data From Blend

Blend facilitates getting a borrower's application in two formats. Primarily, the loan information will be contained in the Fannie Mae v3.2 but we also have additional fields populated in Blend's interpretation of the MISMO v3.3.1 in XML.

The endpoints for these files are as follows:

Fannie Mae 3.2 endpoint

MISMO 3.3.1

Send your request to Blend's API for your desired file type (Fannie Mae or MISMO)

Retrieve loan data from Blend:

Example:

curl -X GET \
'https://api.beta.blendlabs.com/loans/8b290fb0-2ce9-4fda-bb81-4c2ae5099980?format=fannie&version=3.2' \
-H 'authorization: {{YOUR AUTH TOKEN}}' \
-H 'blend-api-version: 1.3.0' \
-H 'cache-control: no-cache' \
-H 'x-blend-deployment: {{YOUR BLEND DEPLOYMENT}}' \
-H 'x-blend-special-instance-id: {{SPECIAL DEPLOYMENT ID IF NEEDED}}'

The file sent to you will be encoded in raw Base64:

1311

Decode the response

Sample in JavaScript:

var fannieMae = {{insert encoded Base64 Fannie Mae response from Blend}};
var decoded = window.atob(fannieMae);

console.log('decoded');

Parse the file into your LOS

For Fannie Mae 3.2

Blend recommends that you use any parsing utility that may come with your LOS since most of them will accommodate the Fannie Mae 3.2 file. We also recommend that you rely on the Fannie Mae 3.2 spec for full guidance.

For Mismo 3.3.1

We follow the standard MISMO 3.3.1 version

You will need to convert the XML file into a format that you can use to access Blend-specific fields
Blend uses an amalgamation of the original 3.3.1 spec & Blend's own interpretation & custom fields - so refer to Blend's description as the final source of truth for MISMO 3.3.1
In the future, Blend will be producing documentation specifically for the MISMO.

Specific Blend/MISMO questions should be directed to [email protected]

3. Update a loan's export status in Blend

The Blend API allows updating a loan's export status in Blend via the /loans/id/export-status endpoint.

Supported Export Statuses

  • FAILED
  • IN_PROGRESS
  • SUCCESS

Why is this important?

Updating an application's export status aids in managing business process and workflow.

  • FAILED - informs the user the application didn't export as expected and to try again
  • IN_PROGRESS - halts any changes made to the loan in Blend until the export attempted as finished
  • SUCCESS - informs the user the loan exported to the LOS

Request Example:

curl -X POST \
https://api.beta.blendlabs.com/loans/8b290fb0-2ce9-4fda-bb81-4c2ae5099980/export-status \
-H 'authorization: {{YOUR AUTH TOKEN}}' \
-H 'blend-api-version: 2.0.0' \
-H 'cache-control: no-cache' \
-H 'Content-Type: application/json' \
-H 'blend-target-instance: {{YOUR BLEND DEPLOYMENT}}~{{YOUR SPECIAL ID}}' \
-d '{
"status":"FAILED",
"reason":"I wanted it to fail!"
}'

Response example:

{
     "status": "FAILED",
     "reason": "I wanted it to fail!"
}

Upon response, the status in Blend will update in the loan's Overview page.

853

Should any export 'reason' be provided, it will appear in the UI when hovering over the '?' icon.

821

What should you do when a loan export succeeds?

We recommend that you return a LOS primary key to Blend after a successful loan export. Return an LOS Primary Key to Blend by PATCHing the /loan/id endpoint.

Example request:

curl -X PATCH \
https://api.beta.blendlabs.com/loans/8b290fb0-2ce9-4fda-bb81-4c2ae5099980 \
-H 'Authorization: Basic {{AUTH TOKEN}}' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'X-Blend-Deployment: {{DEPLOYMENT}}' \
-H 'X-blend-special-instance-id: {{SPECIAL INSTANCE ID}}' \
-H 'blend-api-version: 1.3.0' \
-d '{
"losId": "test"
}'

The successful response will return a 200, and update the losId in Blend. This is visible in the loan's Overview page along with the Activity page.

Overview:

1189

Activity:

1373