Learn about how Pre-Approvals work with Drivly APIs.
https://commerce.driv.ly/api/preApprovals
with a POST
request.
Below is a breakdown of the required and optional data fields, supplemented with example requests for your applications.
Field | Type | Description | Format Example |
---|---|---|---|
firstName | String | Customer’s first name | John |
middleInitial | String | Customer’s middle initial | A |
lastName | String | Customer’s last name | Doe |
address | String | Customer’s physical address | 123 Elm St |
city | String | City of the address | Springfield |
state | String | State of the address | IL |
zip | String | Zip code of the address | 62704 |
phone | String | Customer’s phone number | 555-1234 |
email | String | Customer’s email address | john.doe@example.com |
Field | Type | Description | Format Example |
---|---|---|---|
income | String | Customer’s income monthly income | $15,000 |
ipAddress | String | IP address of the customer making the request | 192.168.1.1 |
userAgent | String | User agent of the customer’s browser | Mozilla/5.0 |
isp | String | Internet Service Provider of the customer | Comcast |
createPreApproval
sends the pre-approval data to the API endpoint using fetch with a
POST method.
It waits for the response asynchronously, converts the response to JSON, and logs it
to the console. If an error occurs during the request or while handling the response, it catches
the error and logs it, which is crucial for debugging and user feedback in real applications.
createPreApproval()
from your JavaScript code.Field | Type | Description | Example |
---|---|---|---|
id | String | Unique identifier for the pre-approval | 12345 |
customer | String | Customer’s unique identifier | 67890 |
segmentationBand | String | Credit score band | Excellent (750-900) |
lead | String | Unique identifier for the lead generated | abc123 |
status | Enum | Current status of the pre-approval | Processing |
estimatedInterestRate | String | Estimated interest rate for the loan (percentage) | 3.5% |
estimatedLoanTerm | String | Estimated term for the loan (months) | 60 mo |
updatedAt | String | Timestamp of the last update (ISO 8601 format) | 2022-01-01T12:00:00Z |
createdAt | String | Timestamp when the pre-approval was created (ISO 8601 format) | 2022-01-01T00:00:00Z |
Processing
, Error
, Processed
, Needs Info
.