API reference

Vehicle stock API

Send your stock from your dealer management system and keep it current. Base URL https://api.motorsync.co.uk/api/v1/stock, version 1.0.0. Dealer keys.
In short
  • Send each vehicle with your own stock code: the first call adds it, later calls update it, and one call takes it off sale.
  • Up to 100 vehicles in one call, checked exactly like cars added in Mira Business.
  • When a car you sent sells through Mira, your system hears about it by signed webhook.

Overview

Your system sends each vehicle with its own stock code. The first call adds it to your Mira stock, later calls update it, and you take it off sale when it goes. Vehicles go through the same checks as cars added in Mira Business, so they appear in search, on your storefront and in Mira's answers in the same way.

Sync only what changed, or send your whole stock in batches of 100: sending a vehicle that has not changed is harmless.

Stock codes

A stock code is your system's own id for a vehicle: 1 to 64 letters, digits, dots, dashes or underscores, unique within your company. It is how Mira matches your calls to the vehicle, so keep it the same for the life of the car. Mira's own vehicle id is in the answer as vehicle.id if you want to store it.

Endpoints

PUT/api/v1/stock/{stockCode}VEHICLES_WRITE

Add or update a vehicle

The first call with a stock code adds the vehicle (201); later calls update it (200). Stock codes are 1 to 64 letters, digits, dots, dashes or underscores.

Request
curl -X PUT https://api.motorsync.co.uk/api/v1/stock/STK-10482 \
  -H "Authorization: Bearer ms_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "make": "BMW", "model": "3 Series", "variant": "320d M Sport",
    "year": 2021, "registrationNumber": "AB21XYZ",
    "price": 2399500, "mileage": 28450,
    "fuelType": "DIESEL", "transmission": "AUTOMATIC", "bodyType": "SALOON",
    "colour": "Black", "doors": 4, "seats": 5,
    "imageUrls": ["https://yourdms.example.com/photos/STK-10482-1.jpg"]
  }'
Response
{
  "success": true,
  "data": {
    "stockCode": "STK-10482",
    "outcome": "ADDED",
    "vehicle": { "id": "0192f1c2-...", "make": "BMW", "model": "3 Series", "price": 2399500, "isActive": true, "soldAt": null, ... },
    "problems": []
  },
  "message": "ADDED"
}
POST/api/v1/stock/batchVEHICLES_WRITE

Add or update vehicles in bulk

Up to 100 vehicles, each with its stock code. Each is handled on its own: one bad vehicle does not stop the rest, and the answer lists what happened to each.

Request
curl -X POST https://api.motorsync.co.uk/api/v1/stock/batch \
  -H "Authorization: Bearer ms_live_..." \
  -H "Content-Type: application/json" \
  -d '[
    { "stockCode": "STK-10482", "vehicle": { "make": "BMW", "model": "3 Series", ... } },
    { "stockCode": "STK-10483", "vehicle": { "make": "Ford", "model": "Focus", ... } }
  ]'
DELETE/api/v1/stock/{stockCode}VEHICLES_WRITE

Take a vehicle off sale

The vehicle stays on record so past enquiries and sales still make sense.

GET/api/v1/stock/{stockCode}VEHICLES_READ

Read a vehicle

Also returns vehicles taken off sale or sold, with soldAt set when the car sold.

GET/api/v1/stockVEHICLES_READ

List your vehicles

Vehicles you sent through this API that are on sale, newest first. Paging: page (from 0), size (up to 100).

Vehicle fields

The same fields as adding a car in Mira Business. Codes must be sent exactly as listed.

FieldRequiredRules
make, modelYesUp to 100 characters each
variantNoFor example 320d M Sport
yearYes1900 to five years ahead
priceYesIn pence, above 0 (2399500 is £23,995)
priceWasNoThe earlier price in pence, when reduced
mileageYes0 or more
fuelTypeYesPETROL, DIESEL, ELECTRIC, HYBRID, PLUG_IN_HYBRID, MILD_HYBRID, HYDROGEN, LPG, CNG
transmissionYesMANUAL, AUTOMATIC, SEMI_AUTO, CVT, DCT
registrationNumberNoUp to 15 characters
vinNoExactly 17 characters
registrationYearNoThe year it was first registered
bodyTypeNoHATCHBACK, SALOON, ESTATE, SUV, COUPE, CONVERTIBLE, MPV, PICKUP, VAN, SPORTS, CROSSOVER, LIMOUSINE
doors, seatsNoWhole numbers
engineSizeNoIn cc
colour, interiorNoFree text
bhp, co2Emissions, mpgCombinedNoNumbers
motExpiryNoYYYY-MM-DD
serviceHistoryNoFULL, PART, NONE, DEALER
previousOwnersNoWhole number
descriptionNoWhat customers read about the car
imageUrlsNoUp to 50 photo links, main photo first

When a car sells

When a vehicle you sent through this API sells through Mira, Mira sends a signed stock.vehicle_sold event to your webhook endpoint with your stock code, so your system can mark it sold too. Reading the vehicle afterwards shows soldAt.

stock.vehicle_sold
{
  "id": "0192f1d0-2a4b-7c3d-8e9f-0a1b2c3d4e5f",
  "type": "stock.vehicle_sold",
  "apiVersion": "1.0.0",
  "livemode": true,
  "createdAt": "2026-11-09T14:03:11Z",
  "data": {
    "stockCode": "STK-10482",
    "vehicleId": "0192f1c2-6f3b-7d2a-9d6e-1a2b3c4d5e6f",
    "soldAt": "2026-11-09T14:03:10Z",
    "saleType": "FINANCE_SALE"
  }
}

Set up and verify webhooks as described in Webhooks and events.

Errors

StatusCodeWhat to do
400VALIDATION_ERRORA field is missing or not valid, the stock code is not in the allowed format, or the same car (by VIN) is already in your stock under another code. The message says which.
404NOT_FOUNDNo vehicle with this stock code for your company.

Errors every API shares are in Keys, errors and limits.