Prerequisites

Before diving into the integration process, ensure you have the following:

  1. Sign up for a Drivly account
  2. Create a DRIVLY_API_KEY
  3. Have a basic understanding of REST APIs
  4. A secure environment for handling sensitive data
Always perform F&I Prodcut operations server-side to secure API keys.

Overview

The F&I API offers endpoints to retrieve vehicle-specific service contract details and update or customize packages according to customer needs. By integrating this API into your platform, you can provide customers with a seamless experience to purchase F&I products directly.

Let’s follow the exmaple scenario below:

Alex works for a large automotive sales platform, AutoHub. AutoHub wants to integrate the Vehicle Service Contract (VSC) API into their online services, allowing customers purchase various F&I products without the need for an F&I manager.

To complete this scenario, you will need to:

  1. Verify the API endpoint
  2. Implement the feature
  3. Allow customers to place an order
  4. Handle errors gracefully
  5. Add additional features

Walkthrough

1

Verify API endpoint

Verify the API’s ability to retrieve all VSC options for a specific VIN.

{
  "endpoint": "/packages/1C4HJXEN5MW592818",
  "method": "GET",
  "headers": {
    "Authorization": "Bearer {DRIVLY_API_KEY}"
  }
}

Alex uses this endpoint to fetch all package options for the VIN 1C4HJXEN5MW592818 and successfully retrieves the data.

2

Implementation

With the data structure understood, Alex begins implementing the feature on AutoHub’s website. The example response from the API provides a comprehensive view of the VSC options:

{
  "status": 200,
  "data": {
    "vin": "1C4HJXEN5MW592818",
    "make": "Jeep",
    "model": "Wrangler Unlimited",
    "year": 2021,
    "packages": {
      "Good": {
        "price": 350,
        "coverageDetails": ["Engine", "Transmission", "Drive Axle"],
        "termMonths": 36,
        "deductible": 100
      },
      "Better": {
        "price": 550,
        "coverageDetails": ["Engine", "Transmission", "Drive Axle", "Electrical", "Air Conditioning"],
        "termMonths": 48,
        "deductible": 50
      },
      "Best": {
        "price": 750,
        "coverageDetails": ["Engine", "Transmission", "Drive Axle", "Electrical", "Air Conditioning", "Suspension", "Brakes", "High-Tech Components"],
        "termMonths": 60,
        "deductible": 0
      }
    }
  }
}
3

Placing an Order

After customers choose their desired VSC package, Alex needs to allow them to complete their purchase through the API. This process involves sending the selected package details along with customer and payment information to the VSC provider’s system.

Order Request
{
  "endpoint": "/order",
  "method": "POST",
  "headers": {
    "Authorization": "Bearer {API_KEY}",
    "Content-Type": "application/json"
  },
  "body": {
    "vin": "1C4HJXEN5MW592818",
    "customerDetails": {
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane.doe@email.com",
      "phone": "555-1234"
    },
    "packageType": "Best",
    "packageCost": 750,
    "paymentInfo": {
      "creditCardNumber": "1234567890123456",
      "expirationDate": "12/24",
      "cvv": "123"
    }
  }
}
4

Error Handling

Alex implements error handling to manage situations where the VIN might not be found or the API key is missing. They simulate an error response:

{
  "status": 404,
  "error": {
    "message": "The requested VIN '1C4HJXEN5MW592818' was not found in our database.",
    "code": "VIN_NOT_FOUND",
    "suggestion": "Please verify the VIN and try again."
  }
}
5

Adding Additional Features

Alex wants to ensure that customers can update their VSC packages if they want additional coverage after initial viewing. They add functionality for updating package details:

{
  "endpoint": "/packages/1C4HJXEN5MW592818/Best",
  "method": "PUT",
  "headers": {
    "Authorization": "Bearer {API_KEY}",
    "Content-Type": "application/json"
  },
  "body": {
    "newPrice": 800,
    "newTerms": {
      "termMonths": 72,
      "coverageDetails": ["Extended Engine Coverage", "Full Electrical", "GPS Navigation"]
    }
  }
}

FAQs

FieldsOptionsRequired
VIN1C4HJXEN5MW592818True
MakeJeepTrue
ModelWrangler UnlimitedTrue
Year2021True
Term (Months)12, 24, 36, 48, 60, 72, 84True
Deductible (USD)$0, $50, $100True
Planned length of ownership (Years)2, 3, 4, 5, 6, +7True
Estimated miles driven per year (Miles)5,000, 10,000, 15,000, 20,000, +25,000True