# Valuation Predict

## Overview

The Valuation API can be used to determine new vehicles' present retail and trade values and their residual values.

This API requires [authentication](https://devhub.autograb.com/authentication) and an appropriate license attached to it.

A Vehicle ID returned from the Vehicle Search API or Vehicle Facet API is required to use the API.

### How is a valuation provided?

AutoGrab’s Valuation captures the asking prices from the past week for a specific vehicle’s year, make, model, and variant at a given mileage, sourced from private sellers and dealers within a selected state. It excludes government charges but includes GST, assuming the vehicles are in good condition and fitted with standard OEM accessories.

\
Leveraging advanced machine learning and updated weekly, our pricing integrates active listings and recently delisted data from public marketplaces. AutoGrab emphasises the most recent data to deliver comprehensive valuations that reflect current market trends.

\
Each estimate includes a confidence score, which indicates AutoGrab’s certainty in the valuation. Two key factors determine this score:<br>

* The number of vehicles listed in the past 365 days for the specific vehicle type
* A detailed accuracy analysis of the pricing algorithm for that vehicle type

The confidence score ranges from 0 to 1, with 1 representing the highest confidence level

## Value a vehicle using an AutoGrab ID

> Value a vehicle using an AutoGrab ID

```json
{"openapi":"3.1.1","info":{"title":"AutoGrab API","version":"2.0.0"},"servers":[{"url":"https://api.autograb.com.au"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"ApiKey"}},"schemas":{"SinglePrediction":{"type":"object","properties":{"success":{"type":"boolean","default":true},"prediction":{"type":"object","properties":{"id":{"type":"string","description":"The unique pricing record ID"},"vehicle_id":{"type":"string","description":"The Vehicle ID of the vehicle that was priced"},"created_at":{"type":"string","description":"The date when the preidction was made"},"kms":{"type":"number","description":"The odometer reading that the valuation is based off. This is usually the same as the input provided, but if no odometer reading was specified, the average reading for the vehicle provided will be used instead."},"price":{"type":"number","description":"The predicted retail price"},"score":{"type":"number","description":"The pricing confidence score. This indicates the estimated degree of accuracy for the price prediction."},"retail_price":{"type":"number","description":"The predicted retail price"},"trade_price":{"type":"number","description":"The predicted trade price"},"adjustment":{"$ref":"#/components/schemas/AppliedPriceAdjustment"}}},"bounds":{"type":"object","properties":{"retail":{"type":"object","properties":{"lower":{"type":"number","description":"The predicted lower retail price bound"},"upper":{"type":"number","description":"The predicted upper retail price bound"}}},"trade":{"type":"object","properties":{"lower":{"type":"number","description":"The predicted lower trade price bound"},"upper":{"type":"number","description":"The predicted upper trade price bound"}}}}},"max_offer":{"type":"object","properties":{"reconditioning":{"type":"number"},"profit_margin":{"type":"number"},"lot":{"type":"number"},"transport":{"type":"number"},"admin":{"type":"number"},"price":{"type":"number"}}}}},"AppliedPriceAdjustment":{"allOf":[{"$ref":"#/components/schemas/PriceAdjustment"},{"type":"object","properties":{"type":{"description":"The granularity of the price adjustment. Vehicle price adjustments are applied to the whole vehicle and set using /valuations/adjustments, whereas pricing_record adjustments are set for a specific record using /valuations/history.","type":"string","enum":["account","vehicle","pricing_record"]}}}]},"PriceAdjustment":{"type":"object","properties":{"vehicle_id":{"type":"string"},"type":{"type":"string","enum":["account","vehicle","pricing_record"]},"enabled":{"description":"If the adjustment is enabled, it will be applied to new pricing requests for the vehicle id","type":"boolean"},"trade_adjustment":{"$ref":"#/components/schemas/PercentageOrFixedValue"},"retail_adjustment":{"$ref":"#/components/schemas/PercentageOrFixedValue"},"overrides":{"description":"If a price request falls within the kilometer ranges of any of your trade price overrides, your custom price will be returned instead of the adjusted AutoGrab trade price","type":"array","items":{"$ref":"#/components/schemas/PriceOverride"}}}},"PercentageOrFixedValue":{"type":"object","description":"Either a percentage of a total or a fixed value","properties":{"amount":{"description":"The value","type":"number"},"type":{"description":"Determines if the value is a percentage of a total value or a fixed amount","type":"string","enum":["fixed","percentage"]}}},"PriceOverride":{"type":"object","properties":{"id":{"description":"A unique ID that identifies the price override","type":"string"},"min_kms":{"description":"The minimum odometer reading that this override will apply at","type":"number"},"max_kms":{"description":"The maximum odometer reading that this override will apply at","type":"number"},"trade_price":{"description":"The trade price override, if applicable","type":"number"},"retail_price":{"description":"The retail price override, if applicable","type":"number"}}},"ErrorSchema":{"type":"object","properties":{"error":{"type":"boolean","default":true},"message":{"type":"string","description":"Error message"}}},"Region":{"type":"string","enum":["au","nz","uk","my"]}}},"paths":{"/v2/valuations/predict":{"post":{"summary":"Value a vehicle using an AutoGrab ID","description":"Value a vehicle using an AutoGrab ID","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SinglePrediction"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSchema"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSchema"}}}}},"tags":["Valuations"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["vehicle_id"],"properties":{"region":{"$ref":"#/components/schemas/Region"},"vehicle_id":{"type":"string","description":"The AutoGrab Vehicle ID which corresponds to the vehicle that should be valued"},"kms":{"type":"number","description":"The odometer reading of the vehicle. If no reading is provided, the average value will be subsituted"},"rrp_overwrite":{"type":"number"},"rrp_adjustment":{"type":"number"},"condition_score":{"type":"number"},"rego":{"type":"string","description":"The registration plate of the vehicle, for reference purposes only"},"state_for_pricing":{"type":"string","description":"state to be used for state based valuations instead of national"},"state":{"type":"string","description":"The registration state of the vehicle, if applicable"},"vin":{"type":"string","description":"The VIN of the vehicle, for reference purposes only"}}}}},"description":"request body"}}}}}
```

## Pricing ID

The payload returned by price prediction requests will include an ID, which you can use to refer to the pricing request in the future. The `/v2/valuations/history/{PRICING_ID}` method will return the response from a previous pricing request, and you can also use the Pricing ID to track price changes with the **Price Changes API**.

To get a paginated list of all your previous price predictions, you can use the `/v2/valuations/history` endpoint.

#### Condition Score <a href="#condition-score" id="condition-score"></a>

You can manipulate the valuation returned by the prediction endpoint by supplying a condition score. The condition score can be between `1` and `5`. A condition of 1 is poor, and 5 is excellent.

Supplying any other numbers will return the default trade\_price, which assumes excellent condition.

If you're building a user interface that allows the user to choose a condition, it is recommended that you follow the industry standard in the table below.

<table><thead><tr><th width="162">Condition</th><th>Condition Score</th></tr></thead><tbody><tr><td>Poor</td><td><code>1</code></td></tr><tr><td>Fair</td><td><code>2</code></td></tr><tr><td>Average</td><td><code>3</code></td></tr><tr><td>Good</td><td><code>4</code></td></tr><tr><td>Excellent</td><td><code>5</code></td></tr></tbody></table>

## Features

### Positive Equity

The positive equity feature identifies if the vehicle is in positive equity and the current equity position. To add an equity calculation to the Predict call, use features=equity

```json
{
    "success": true,
    "prediction": {
        "id": "599aff94-7c79-4b9c-a976-ff39c3892190",
        "vehicle_id": "4825547834130432",
        "kms": 20000,
        "price": 32669,
        "score": 0.8515,
        "retail_price": 32669,
        "trade_price": 27769,
        "adjustment": null
    },
    "equity": {
        "positive_equity": true,
        "equity_position": 15769
    }
}
```

### Valuation Bounds

If you require the upper and lower bounds used to calculate a prediction, you can use features=bounds.

```json
{
    "success": true,
    "prediction": {
        "id": "e2813b16-1012-41b5-9ea3-3b65675c50fd",
        "vehicle_id": "5804870883868672",
        "kms": 57306,
        "price": 20622,
        "score": 0.9239,
        "retail_price": 20622,
        "trade_price": 17122,
        "adjustment": null
    },
    "bounds": {
        "retail": {
            "lower": 19622,
            "upper": 21872
        },
        "trade": {
            "lower": 16122,
            "upper": 18372
        }
    }
}
```

## Adjustments

Both the Residual Value and Used Value APIs support pricing adjustments. These can be used to retrieve a more accurate price prediction of a vehicle if the provided price is not already accurate enough.

### **Recommended Retail Price Adjustment**

CommentTo adjust the stored Recommended Retail Price you can supply a `rrp_adjustment` value in the payload which accepts a number — positive or negative.CommentThis is useful when a car is fitted with factory extras, the Price When New can be increased for each of the options to get a better price prediction.Comment

### **Recommended Retail Price Overwrite**

To adjust the stored Recommended Retail Price you can supply a `rrp_adjustment` value in the payload which accepts a number — positive or negative.

### **Predicted Retail and Trade Price Adjustments**

The Pricing Adjustments API (`/v2/valuations/adjustments`) allows you to configure fixed or percentage adjustments for specific Vehicle IDs.

Per-Vehicle pricing adjustments will apply to price predictions that you perform using the same API Key and for the same Vehicle ID.

If you set a Retail Price Adjustment for a vehicle, the trade price will also be affected because the trade price is derived from the retail price. If you set an adjustment for both the retail price and the trade price, both adjustments will be applied to the trade price while the retail price is only affected by the retail price adjustment.

When you perform a price prediction, you will receive a summary of the price adjustments that were applied, if any.

#### **Example**

Below is an example price prediction payload with predicted trade and retail adjustments applied.

```json
{
    "success": true,
    "prediction": {
        "id": "d028809e-0ef5-42de-9699-8b71fd1aee65",
        "vehicle_id": "5631424535199744",
        "price": 12347,
        "score": 0.81820,
        "retail_price": 14847,
        "trade_price": 2042.46,
        "adjustment": {
            "vehicle_id": "5631424535199744",
            "enabled": true,
            "retail_adjustment": {
                "type": "fixed",
                "amount": 2500,
                "overridden": false
            },
            "trade_adjustment": {
                "type": "percentage",
                "amount": 0.2,
                "overridden": false
            },
            "overrides": []
        }
    }
}
```

### Predicted Retail and Trade Price Overrides

In addition to price adjustments, you also have the option to override retail and trade prices for specific vehicle IDs where the odometer reading falls within a set range. Price overrides are configured using the Price Override API at `/v2/valuations/adjustments/{VEHICLE_ID}/overrides`.

If you have configured a retail or trade price override that applies to a price prediction, the overridden price will be returned instead of the AutoGrab valuation. This will bypass any price adjustments that you may have configured, and the response payload will indicate this with the `{overridden: true}` flag.

Retail price overrides will impact the predicted trade price in the same way that retail price adjustments impact the trade-price - unless you have configured a trade price override. Suppose you have both a trade override and a retail override. In that case, the two overridden prices will be returned without pre-processing (except for calculating condition scores, if applicable - see below).

#### Example

Below is an example price prediction payload where price adjustments and price overrides have been configured. In this example, the retail price adjustment has been overridden by the retail price override, and the trade price adjustment has been applied.

```json
{
    "success": true,
    "prediction": {
        "id": "faa847f1-d428-46e1-b2d6-b47a00173d6e",
        "vehicle_id": "5631424535199744",
        "price": 11697,
        "score": 0.81820,
        "retail_price": 12000,
        "trade_price": 1700,
        "adjustment": {
            "vehicle_id": "5631424535199744",
            "retail_adjustment": {
                "type": "fixed",
                "amount": 2500,
                "overridden": true
            },
            "trade_adjustment": {
                "type": "percentage",
                "amount": 0.2,
                "overridden": false
            },
            "overrides": [
                {
                    "id": "1ef42b79-c580-4055-a39b-e5257f81d0d9",
                    "min_kms": 80000,
                    "max_kms": 90000,
                    "trade_price": null,
                    "retail_price": 12000
                }
            ]
        }
    }
}
```
