> ## Documentation Index
> Fetch the complete documentation index at: https://docs.driv.ly/llms.txt
> Use this file to discover all available pages before exploring further.

# Reconditioning

> Learn how to use Reconditioning workflows.

## Overview

Our API empowers businesses to quickly obtain accurate quotes for reconditioning services,
facilitating swift decision-making and operational efficiency. From detailing to mechanical
repairs, our Reconditioning API ensures you can easily access and order the services needed to
bring vehicles up to your standards. By integrating this API, businesses can optimize their
workflow, reduce manual errors, and improve turnaround times, ensuring vehicles are ready for sale
or use faster than ever before.

<Accordion title="Common Reconditioning Services" defaultOpen="true">
  1. **Body condition:** Address dings, paint chips, dents, and scratches.
  2. **Engine:** Service belts, fans, spark plugs, and cylinders.
  3. **Maintenance:** Conduct oil and filter changes.
  4. **Suspension:** Check and replace ball joints, tie rods, and struts.
  5. **Brakes:** Inspect and replace pads and rotors, if necessary.
  6. **Interior:** Overhaul electrical systems, heating, and air conditioning.
  7. **Exterior:** Maintain lights and exhaust systems.
</Accordion>

***

## Workflows

The Reconditioning API facilitates two primary functions, `Quote Reconditioning` and `Order Reconditioning` for all recon service types.

### Quote Reconditioning

Obtain accurate quotes for reconditioning services, including detailing, mechanical repairs, and more.

<Accordion title="Create Quote">
  To obtain a quote for reconditioning services, you will need to provide the following information:

  ```json Create Quote theme={null}
  {
    "type": "reconditioning",
    "vin": "WP0AF2A99KS165242",
    "items": [
      // An Array of fault items, you can find
      // these in the vehicle's inspection report
      "fault_EbaCojKxsJL"
    ]
  }
  ```

  ```json Example Response theme={null}
  {
    "id": "quote_p7Y7cE",
    "status": "awaiting-payment",
    "estimatedTime": "2024-01-01T12:00:00Z",
    "checkoutLink": "https://checkout.driv.ly/quote_p7Y7cE",
    "paid": false,
    "total": 350,
    "items": [
      {
        "service": "reconditioning",
        "price": 350,
        "name": "Reconditioning",
        "description": "fault_EbaCojKxsJL",
        "quantity": 1
      }
    ]
  }
  ```

  Upon payment, a service order will be generated with all pertinent details and an estimated completion time. Progress of the service order can be monitored using [webhooks](#webhooks), ensuring timely updates throughout the reconditioning process.
</Accordion>

### Order Reconditioning

Place orders for reconditioning services, ensuring vehicles are quickly brought up to your standards.

<Accordion title="Place Order">
  Creating a service order for body and paint services allows you to schedule, and pay for the service directly. This will create a service order which can be used to track progress and monitor costs.

  <Info>
    For service orders, attaching a deal is highly recommended as this will allow you to keep all
    pending invoices in one place. The final invoice for the deal will include this order, but is
    rolled up into the total cost of the deal.
  </Info>

  ```json Create Order theme={null}
  {
    "type": "reconditioning",
    "vin": "WP0AF2A99KS165242",
    "items": [
      // An Array of fault items, you can find
      // these in the vehicle's inspection report
      "fault_EbaCojKxsJL"
    ]
  }
  ```

  ```json Example Response theme={null}
  {
    "id": "order_luE7cYfmcgAchV",
    "status": "pending",
    "estimatedTime": "2024-01-01T12:00:00Z",
    "receiptLink": "https://checkout.driv.ly/order_luE7cYfmcgAchV",
    "paid": true,
    "total": 350,
    "items": [
      {
        "service": "reconditioning",
        "price": 350,
        "name": "Reconditioning",
        "description": "fault_EbaCojKxsJL",
        "quantity": 1
      }
    ]
  }
  ```

  You'll be notified of the service order's status via [webhooks](#webhooks), ensuring you're always up-to-date on the progress of your vehicle's reconditioning.
</Accordion>

***

## Typical Progression

Lets go over the typical progression of a reconditioning service order. While these steps are
typical, there may be issues, delays, or other factors that can affect the progression of your service order.

If any problems arise, the service order's status will be updated to either `delayed` or `canceled`, and you
will be notified of the issue via email and webhook.

<Steps>
  <Step title="After payment is successful">
    A service order is created with the details of your quote, including the estimated time and cost.

    The service order will start in the `pending` status, this means that its just waiting for the team to pick up the vehicle, and start work.
  </Step>

  <Step title="After some time has passed">
    The service provider will begin working on your vehicle, ensuring it receives the care it needs.

    The service order will be updated to include the status of the service, moving from `pending` to `in-progress`.
  </Step>

  <Step title="Work is completed">
    Once the service is completed, the service order will be updated to reflect the status of the service.

    After work is completed, the service order will be updated to include the status of the service, moving from `in-progress` to `completed`.
  </Step>
</Steps>

***

## Webhooks

`service.created` - This event is triggered when a service order is created, providing you with the details of the order:

```json theme={null}
{
  "event": "service.created",
  "type": "reconditioning",
  "data": {
    "id": "order_luE7cYfmcgAchV",
    "status": "pending", // pending, in-progress, completed, delayed, canceled
    "estimatedTime": "2024-01-01T12:00:00Z",
    "receiptLink": "https://checkout.driv.ly/order_luE7cYfmcgAchV",
    "paid": true,
    "total": 350,
    "items": [
      {
        "service": "reconditioning",
        "price": 350,
        "name": "Reconditioning",
        "description": "fault_EbaCojKxsJL",
        "quantity": 1
      }
    ],
    "history": [
      // An Array to show the keys changed and when
      {
        "status": "pending",
        "paid": true,
        "time": "2024-01-01T12:00:00Z"
      }
    ]
  }
}
```

`service.updated` - This event is triggered when a service order is updated, providing you with the updated details of the order:

```json theme={null}
{
  "event": "service.updated",
  "type": "reconditioning",
  "data": {
    "id": "order_luE7cYfmcgAchV",
    "status": "in-progress",
    "estimatedTime": "2024-01-01T12:00:00Z",
    "receiptLink": "https://checkout.driv.ly/order_luE7cYfmcgAchV",
    "paid": true,
    "total": 350,
    "items": [
      {
        "service": "reconditioning",
        "price": 350,
        "name": "Reconditioning",
        "description": "fault_EbaCojKxsJL",
        "quantity": 1
      }
    ],
    "history": [
      {
        "status": "pending",
        "paid": true,
        "time": "2024-01-01T12:00:00Z"
      },
      {
        "status": "in-progress",
        "time": "2024-01-02T12:00:00Z"
      }
    ]
  }
}
```

`service.completed` - This event is triggered when a service order is completed, providing you with the final details of the order:

```json theme={null}
{
  "event": "service.completed",
  "type": "reconditioning",
  "data": {
    "id": "order_luE7cYfmcgAchV",
    "status": "completed",
    "estimatedTime": "2024-01-01T12:00:00Z",
    "receiptLink": "https://checkout.driv.ly/order_luE7cYfmcgAchV",
    "paid": true,
    "total": 350,
    "items": [
      {
        "service": "reconditioning",
        "price": 350,
        "name": "Reconditioning",
        "description": "fault_EbaCojKxsJL",
        "quantity": 1
      }
    ],
    "history": [
      {
        "status": "pending",
        "paid": true,
        "time": "2024-01-01T12:00:00Z"
      },
      {
        "status": "in-progress",
        "time": "2024-01-02T12:00:00Z"
      },
      {
        "status": "completed",
        "time": "2024-01-03T12:00:00Z"
      }
    ]
  }
}
```

## Next Steps

Ready to get started with Reconditioning API?

<CardGroup cols={2}>
  <Card title="Quote – Reconditioning" icon="square-quote" href="/services/reference/service-quote">
    Quote reconditioning services
  </Card>

  <Card title="Order – Reconditioning" icon="money-bill-wave" href="/services/reference/service-order/create-a-new-service-order">
    Order reconditioning services
  </Card>
</CardGroup>
