The Pre-Approval API is designed to revolutionize the vehicle financing process by enabling quick, efficient, and customer-friendly pre-approval for auto loans.

This API provides a seamless way to perform soft pulls on credit scores, offering customers and businesses a fast path to understanding financing options with no Social Securtity Number (SSN) requirements and no impact to credit scores.


Benefits of Using the Pre-Approval API

Before diving into the technical details of how to use Pre-Approval, let’s explore the key benefits and reasons why integrating this API can be a game-changer for your business and customers.

Enhance Customer Experience

  • Speed and Convenience: Enables instant pre-approval decisions, improving the customer journey.
  • Transparency: Builds trust with upfront financing information.

Increase Sales Efficiency

  • Qualified Leads: Focuses efforts on financially eligible customers.
  • Customized Offers: Tailors offers to fit customer budgets, improving conversion rates.

Minimize Risk

  • Soft Credit Pulls: Protects customer credit scores during the inquiry process.
  • Accurate Financial Assessment: Ensures appropriate loan terms to minimize defaults.

Streamline Operations

  • Automated Processing: Reduces manual workloads and operational costs.
  • Integration with Sales Processes: Enhances data flow across business operations.

Competitive Advantage

  • Innovative Service: Differentiates your business with a digital-first approach.
  • Data-Driven Decisions: Improves product and offer alignment with customer needs.

Authentication

To securely use this endpoint:

  1. Sign up for a Drivly account
  2. Create a DRIVLY_API_KEY.
The key should be included in the header of each request.
headers: {
  'Authorization': '<api-key>',
  'Content-Type': 'application/json'
}

API Best Practices

Learn how to keep your API key secure and prevent unauthorized access.


Making a Pre-Approval Request

Submit a pre-approval to 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.

Required Fields

  • firstName: Customer’s first name (String)
  • middleInitial: Customer’s middle initial (String)
  • lastName: Customer’s last name (String)
  • address: Customer’s physical address (String)
  • city: City of the address (String)
  • state: State of the address (AA format) (String)
  • zip: Zip code of the address (String)
  • phone: Customer’s phone number (String)
  • email: Customer’s email address (String)

Optional Fields

  • income: Customer’s income (String)
  • ipAddress: IP address of the customer making the request (String)
  • userAgent: User agent of the customer’s browser (String)
  • isp: Internet Service Provider of the customer (String)

Fetch API Example

export async function createPreApproval() {
  try {
    const response = await fetch('https://commerce.driv.ly/api/preApprovals', {
      method: 'POST',
      headers: {
        Authorization: '<api-key>',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        firstName: 'Danny',
        middleInitial: '',
        lastName: 'Turner',
        suffix: null,
        address: '241 Main St',
        city: 'Juno Beach',
        state: 'FL',
        zip: '33408',
        phone: '(561) 555-1234',
        email: '[email protected]',
        income: '$15,000',
      }),
    })

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`)
    }

    const responseData = await response.json()
    console.log('Pre-Approval Response:', responseData)
  } catch (error) {
    console.error('Error during the API request:', error)
  }
}

This function 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.

To execute the function, simply call createPreApproval() from your JavaScript code.

This example is meant to be a basic demonstration. In production, you might want to handle errors more gracefully and provide user feedback based on the result of the API call.


Successful Response

Upon successful submission, the API returns a response containing the following generated values:

  • id: Unique identifier for the pre-approval (String)
  • customer: Customer’s unique identifier (String)
  • segmentationBand: Credit score band, e.g., “Excellent (750-900)” (String)
  • lead: Unique identifier for the lead generated (String)
  • status: Current status of the pre-approval, e.g., “Processing” (Enum)
  • estimatedInterestRate: Estimated interest rate for the loan (String)
  • estimatedLoanTerm: Estimated term for the loan in months (String)
  • updatedAt: Timestamp of the last update (String)
  • createdAt: Timestamp when the pre-approval was created (String)

The response will contain the same values as the request, along with the generated values. The response will also include the status of the pre-approval, which can be used to track the progress of the request. The status will be one of the following values: Processing, Error, Processed, Needs Info.

Example Response

{
  id: '12034631b86bb45g202071a1',
  title: 'Danny Turner ([email protected])',
  firstName: 'Danny',
  middleInitial: '',
  lastName: 'Turner',
  suffix: null,
  address: '241 Main St',
  city: 'Juno Beach',
  state: 'FL',
  zip: '33408',
  phone: '+15615551234',
  email: '[email protected]',
  sessionId: '',
  createdAt: '2024-03-26T22:03:29.685Z',
  updatedAt: '2024-03-26T22:04:01.175Z',
  status: 'Processed',
  income: '$15,000',
  AppId: 154422063,
  customer: '12ab3d1241567b12d2ga12c1',
  segmentationBand: 'Good (700-749)'
}

Properties Reference

preApproval
Pre-Approval Object