Create a vehiclesale
POST/dms/{connection_id}/vehiclesale
Creates a DmsVehiclesale. Provide the unified DmsVehiclesale fields in the request body; they are mapped to the provider's API. Returns the created DmsVehiclesale.
Parameters
fieldsstring array
Fields to return
rawstring
Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
connection_idstring required
ID of the connection
Payload
A vehicle sale or deal (retail, wholesale, fleet or dealer trade)
idstring
created_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
updated_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
numberstring
Dealer-visible deal number
type enum
Valid values:
"RETAIL"
"WHOLESALE"
"FLEET"
"DEALER_TRADE"
"OTHER"
Sale channel
finance_type enum
Valid values:
"CASH"
"FINANCE"
"LEASE"
"BALLOON"
"OTHER"
contact_idsstring array
Buyers as CRM Contacts, primary buyer first
company_idsstring array
Business buyers as CRM Companies
lead_idstring
The CRM Lead this sale came from (reference to CrmLead)
salesperson_user_idsstring array
Salespeople, as HR Employees
sales_manager_user_idstring
Sales manager, as an HR Employee (reference to HrisEmployee)
finance_manager_user_idsstring array
Finance (F&I) managers, as HR Employees
currencystring
ISO 4217 currency code
rebate_amountnumber
Manufacturer and dealer rebates and incentives
down_payment_amountnumber
Cash down payment and deposits
tax_amountnumber
Total tax
total_amountnumber
Total cash price including fees, products and taxes, before trade-ins
front_gross_amountnumber
Front-end (vehicle) gross profit
back_gross_amountnumber
Back-end (F&I) gross profit
sold_atdate-time
Sale or contract date (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
delivered_atdate-time
When the vehicle was handed over (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
posted_atdate-time
When the sale was finalized or posted to accounting (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
sourcestring
Lead or advertising source
notesstring
Returns
| Response field | Type | Required | Description |
|---|---|---|---|
id | string | No | |
created_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
updated_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
number | string | No | Dealer-visible deal number |
status | enum | No | Values: QUOTE, PENDING, SOLD, DELIVERED, FINALIZED, CANCELLED, OTHER |
type | enum | No | Sale channel Values: RETAIL, WHOLESALE, FLEET, DEALER_TRADE, OTHER |
finance_type | enum | No | Values: CASH, FINANCE, LEASE, BALLOON, OTHER |
contact_ids | string[] | No | Buyers as CRM Contacts, primary buyer first |
company_ids | string[] | No | Business buyers as CRM Companies |
lead_id | string | No | The CRM Lead this sale came from (reference to CrmLead) |
salesperson_user_ids | string[] | No | Salespeople, as HR Employees |
sales_manager_user_id | string | No | Sales manager, as an HR Employee (reference to HrisEmployee) |
finance_manager_user_ids | string[] | No | Finance (F&I) managers, as HR Employees |
vehicles | DmsVehiclesaleVehicle[] | No | Vehicles sold |
vehicles[].vehicle_id | string | No | The DmsVehicle ID |
vehicles[].vin | string | No | VIN as sold |
vehicles[].stock_number | string | No | Stock number as sold |
vehicles[].odometer | number | No | Odometer at sale |
vehicles[].price_amount | number | No | Agreed selling price of the vehicle |
vehicles[].msrp_amount | number | No | |
vehicles[].cost_amount | number | No | Dealer cost of the vehicle |
trade_ins | DmsVehiclesaleTradein[] | No | |
trade_ins[].vehicle_id | string | No | The DmsVehicle ID of the trade-in, when recorded |
trade_ins[].vin | string | No | |
trade_ins[].year | number | No | |
trade_ins[].make | string | No | |
trade_ins[].model | string | No | |
trade_ins[].odometer | number | No | |
trade_ins[].allowance_amount | number | No | Trade allowance given to the buyer |
trade_ins[].actual_cash_value_amount | number | No | Actual cash value (dealer valuation) |
trade_ins[].payoff_amount | number | No | Outstanding loan payoff |
trade_ins[].lienholder_name | string | No | Lender owed the payoff |
fees | DmsVehiclesaleFee[] | No | |
fees[].name | string | No | |
fees[].price_amount | number | No | Amount charged to the buyer |
fees[].cost_amount | number | No | Dealer cost |
fees[].is_capitalized | boolean | No | Rolled into the financed or leased amount |
products | DmsVehiclesaleProduct[] | No | Finance and insurance (F&I) products |
products[].type | enum | No | Values: SERVICE_CONTRACT, GAP, CREDIT_LIFE, ACCIDENT_HEALTH, MAINTENANCE, PROTECTION, INSURANCE, OTHER |
products[].name | string | No | Product or plan name |
products[].provider | string | No | Provider or carrier name |
products[].price_amount | number | No | Price charged to the buyer |
products[].cost_amount | number | No | Dealer cost |
products[].term_months | number | No | Coverage term in months |
products[].term_mileage | number | No | Coverage distance limit |
products[].deductible_amount | number | No | |
products[].contract_number | string | No | Policy or contract number |
taxes | DmsVehiclesaleTax[] | No | |
taxes[].name | string | No | |
taxes[].rate | number | No | Tax rate, as a percentage |
taxes[].total_amount | number | No | Tax amount |
finance | object | No | Finance or lease terms |
finance.lender_name | string | No | Bank or finance company |
finance.term_months | number | No | |
finance.interest_rate | number | No | APR, as a percentage |
finance.payment_amount | number | No | Regular payment amount |
finance.payment_frequency | enum | No | Values: MONTHLY, SEMI_MONTHLY, BIWEEKLY, WEEKLY, YEARLY, OTHER |
finance.financed_amount | number | No | Amount financed |
finance.residual_amount | number | No | Lease residual or guaranteed future value |
finance.money_factor | number | No | Lease money factor |
finance.first_payment_at | string (date-time) | No | First payment due date (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
currency | string | No | ISO 4217 currency code |
rebate_amount | number | No | Manufacturer and dealer rebates and incentives |
down_payment_amount | number | No | Cash down payment and deposits |
tax_amount | number | No | Total tax |
total_amount | number | No | Total cash price including fees, products and taxes, before trade-ins |
front_gross_amount | number | No | Front-end (vehicle) gross profit |
back_gross_amount | number | No | Back-end (F&I) gross profit |
sold_at | string (date-time) | No | Sale or contract date (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
delivered_at | string (date-time) | No | When the vehicle was handed over (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
posted_at | string (date-time) | No | When the sale was finalized or posted to accounting (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
source | string | No | Lead or advertising source |
notes | string | No | |
metadata | DmsMetadata[] | No | |
metadata[].id | string | No | The ID of the custom field definition (from the metadata/metadata endpoint). |
metadata[].slug | string | No | The integration's API name (key) of an existing custom field. |
metadata[].value | object | No | The field's value, typed by format. |
metadata[].namespace | string | No | |
metadata[].format | enum | No | The data type of the custom field, which determines how value is formatted. Values: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE_SELECT, MULTIPLE_SELECT, MEASUREMENT, PRICE, YES_NO, CURRENCY, URL |
metadata[].extra_data | object | No |
Errors
Errors return the HTTP status code and a JSON body with statusCode, error (the short label) and message (a human-readable detail).
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Too many requests to unified.to API; max requests per minute: N"
}| Status | Error | Meaning |
|---|---|---|
400 | Bad Request | The request was malformed or failed validation. |
401 | Unauthorized | The connection is likely broken; re-authorize it. |
403 | Forbidden | The connection is missing permissions or scopes. |
404 | Not Found | The requested resource does not exist. |
429 | Too Many Requests | Rate limit exceeded (see the two sources below). |
500 | Internal Server Error | An unexpected error occurred. |
501 | Not Implemented | Not supported by this integration. |
Errors from the underlying integration pass through: the integration's status comes back as ours (429, 401, 403, 404 or 5xx), usually with its message. When the integration's error body is unclear, Unified extracts what it can and returns a clearer message.
429 Too Many Requests
A 429 has two possible sources:
- The integration's own rate limit, passed through.
- Unified's workspace limit: a rolling 60 seconds, set by plan, with the message
Too many requests to unified.to API; max requests per minute: N.
const options = {
method: 'POST',
url: 'https://api.unified.to/dms/5de520f96e439b002043d8dc/vehiclesale',
headers: {
authorization: 'bearer .....'
},
data: undefined,
params: {
fields: '',
raw: '',
}
};
const results = await axios.request(options); Are we missing anything? Let us know
Was this page helpful?