Dealership OS REST API Reference
Seamlessly connect your automotive dealership website, lead capture calculators, customer CRM, or Dealer Management System (DMS) directly into Modulynk's automated trade-in pipeline and valuation engine.
🔑 Authentication
All requests to the Modulynk REST API require an authorized API key passed via the X-API-Key request header. API keys are never accepted in query strings.
X-API-Key: mk_live_xxxxxxxxxxxxxxxxxxxxxxxx
- Open your Dealership OS Settings Panel.
- Locate the 🔑 API Access & Keys section.
- Enter a label (e.g.
Website Trade-In Lead Widget) and click + Generate Key. - Choose Sandbox or Production, then click + Generate Key.
- Copy the key when it is shown. Live keys use
mk_live_...; sandbox keys usemk_test_....
Sandbox keys write only to tradein_quotes_sandbox, never trigger SMS or push notifications, and use deterministic vehicle fixtures.
Use rego TEST123 or VIN 1HGCV1F34LA123456 for lookups. Create a live key when you are ready to submit real leads.
⚡ Quickstart (cURL)
Fetch your active dealership pipeline with a single command:
curl -X GET "https://modulynk-app.web.app/api/v1/tradein/quotes" \ -H "X-API-Key: YOUR_API_KEY"
GET List Trade-In Quotes
Returns a list of quotes and vehicle leads matching your dealership account. Supports filtering by pipeline stage.
| Parameter | Type | Description |
|---|---|---|
stage |
string (optional) | Filter by pipeline stage (new_submission, under_review, offer_sent, accepted, inspection_booked, inspected, contract_payment). |
limit |
number (optional) | Maximum records to return (default: 50). |
{
"success": true,
"count": 1,
"quotes": [
{
"id": "Q-X91KA2",
"stage": "offer_sent",
"status": "offer_sent",
"rego": "CY82LP",
"state": "NSW",
"postcode": "2000",
"isPartial": false,
"customer": {
"name": "Sarah Jenkins",
"phone": "+61412345678",
"email": "sarah.j@example.com.au"
},
"vehicle": {
"vin": "6T1AA110000000001",
"year": 2020,
"make": "Toyota",
"model": "RAV4",
"odometer": 42000
},
"priceExpectation": 30000,
"offeredAmount": 31500,
"benchmarkMid": 32000,
"offerUrl": "https://modulynk-app.web.app/dealership-offer.html?id=Q-X91KA2&dealer=dealer_123",
"createdAt": "2026-10-15T02:15:00.000Z"
}
]
}
GET Get Single Quote by ID
Retrieve complete condition declarations, valuation history, and vehicle metadata for a single lead.
{
"success": true,
"quote": {
"id": "Q-X91KA2",
"stage": "offer_sent",
"rego": "CY82LP",
"state": "NSW",
"customer": {
"name": "Sarah Jenkins",
"phone": "+61412345678"
},
"vehicle": {
"year": 2020,
"make": "Toyota",
"model": "RAV4",
"odometer": 42000
},
"offeredAmount": 31500,
"offerUrl": "https://modulynk-app.web.app/dealership-offer.html?id=Q-X91KA2&dealer=dealer_123"
}
}
POST Create Trade-In Lead / Quote
Submit an inbound trade-in lead directly into your pipeline from an external website form, dealer aggregator, or landing page.
⚡ Automated Rego-to-Specs Resolution: You do not need to make a separate registry lookup. Passing simply rego and state automatically queries Modulynk's multi-tier Australian registry gateway, resolves make, model, year, body type, transmission, fuel, and VIN, estimates vehicle mileage, and computes valuation benchmarks immediately.
If make, model, or year cannot be resolved, the API returns 422 VEHICLE_SPECS_UNRESOLVED or VEHICLE_YEAR_REQUIRED instead of inventing vehicle details.
| Field | Type | Description |
|---|---|---|
rego / plate |
string (required*) | Australian registration plate (e.g. DK29QA). Required unless vin is provided. |
state |
string (required) | State of registration (NSW, VIC, QLD, WA, SA, TAS, ACT, NT). Strictly required. |
photos |
array (optional) | Array of vehicle photos. Supports Base64 data URLs (data:image/jpeg;base64,...), raw Base64 strings, or image URLs. Uploaded to cloud storage and rendered in your dealership appraisal worksheet. |
customer.name / name |
string (optional) | Full name of vehicle seller (defaults to "Private Seller"). |
customer.phone / phone |
string (optional) | Mobile phone number for automated 24-hour review acknowledgment SMS. |
customer.email / email |
string (optional) | Customer contact email address. |
vehicle.make / make |
string (optional) | Vehicle make (e.g. Toyota). If omitted, automatically resolved from the Australian registry. |
vehicle.model / model |
string (optional) | Vehicle model (e.g. RAV4). If omitted, automatically resolved from the Australian registry. |
vehicle.year / year |
number (optional) | Model year (e.g. 2021). Auto-resolved if omitted. |
vehicle.odometer / odometer |
number (optional) | Odometer in km. If omitted, estimated based on vehicle age (~13,500 km/year). |
postcode / customer.postcode |
string (optional) | Four-digit Australian postcode (for example 3000). Leading zeroes are preserved. |
condition / vehicle.condition |
string (optional) | Required on a completed quote. Exact values: excellent, good, fair, poor. needs_work maps to poor. Omitted condition is rejected, not defaulted. |
priceExpectation / sellerExpectation |
number (optional) | Seller's target dollar expectation. Both field names are accepted and stored under both keys. Automatically calculates price gap and priority flag. |
leadId |
string (optional) | ID returned by /tradein/partial-leads. Supply it to complete the same lead instead of creating a duplicate. Letters, numbers, underscores, and hyphens only. |
{
"rego": "DK29QA",
"state": "NSW",
"postcode": "3000",
"name": "Alex Miller",
"phone": "0412345678"
}
{
"rego": "DK29QA",
"state": "NSW",
"postcode": "3000",
"condition": "good",
"name": "Sarah Connor",
"phone": "0412345678",
"email": "sarah.c@example.com",
"photos": [
"data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"https://images.example.com/cars/interior.jpg"
],
"priceExpectation": 18500,
"notes": "One owner, always garaged, full service logbook"
}
{
"success": true,
"id": "TI-K9M4Z2",
"stage": "new_submission",
"priority": "High",
"vehicle": "2021 Toyota RAV4",
"rego": "DK29QA",
"state": "NSW",
"vin": "JTMDFREV20D...",
"odometer": 54000,
"photoCount": 2,
"photos": [
{
"url": "https://firebasestorage.googleapis.com/.../photo_1.jpg",
"slot": "exterior",
"title": "Photo 1"
}
],
"benchmark": {
"low": 24000,
"mid": 26500,
"high": 28500,
"retail": 31000
},
"slaExpiresAt": "2026-10-16T22:15:00.000Z",
"offerUrl": "https://modulynk-app.web.app/dealership-offer.html?id=TI-K9M4Z2&dealer=dealer_123",
"message": "Trade-in quote created in dealership pipeline."
}
POST Save a Partial Lead
Persist a seller's details as soon as they submit the first step of your form. Partial leads do not run a valuation, do not trigger SMS, and appear in your pipeline with isPartial: true.
Supply the returned leadId when calling POST /api/v1/tradein/quotes to complete the same lead without creating a duplicate.
| Field | Type | Description |
|---|---|---|
rego / vin | string (required*) | At least one vehicle identifier is required. |
state | string (required) | State of registration. |
postcode | string (required) | Four-digit postcode where the car is kept. Registration state is not enough. |
customer.phone / customer.email | string (required*) | At least one contact method is required. |
leadId | string (optional) | Continue updating an existing partial lead. |
{
"rego": "DK29QA",
"state": "NSW",
"postcode": "3000",
"name": "Alex Miller",
"mobile": "0412345678",
"stepReached": 1
}
{
"success": true,
"leadId": "TI-LEAD-A1B2C3",
"isPartial": true,
"stage": "new_submission",
"message": "Partial lead saved. Continue with vehicle and photo details when available."
}
POST Look Up Vehicle by Rego
Resolve a registration plate to make, model, year, VIN, body, fuel, transmission, and odometer without creating a lead. Use this when your form needs to confirm vehicle details before submission.
{
"rego": "DK29QA",
"state": "NSW"
}
{
"success": true,
"source": "Australian Vehicle Registry",
"vehicle": {
"make": "Toyota",
"model": "RAV4",
"year": 2021,
"badge": "GXL",
"vin": "JTMDFREV20D123456",
"body": "SUV / Wagon",
"fuel": "Petrol",
"transmission": "Automatic",
"odo": 54000
}
}
Sandbox: use rego TEST123. Any other plate returns 404 SANDBOX_FIXTURE_NOT_FOUND.
POST Decode a VIN
Decode a 17-character VIN into vehicle specifications. Australian registration is not required.
{
"vin": "1HGCV1F34LA123456"
}
Sandbox: use VIN 1HGCV1F34LA123456. The response uses the same vehicle shape as the rego lookup.
POST Signed Photo Upload
Preferred for website forms. POST /api/v1/tradein/photos/upload-url returns a 15-minute signed PUT URL. Upload the raw image bytes with the returned Content-Type, then POST /api/v1/tradein/photos/complete with filePath, slot, and optional quoteId. Base64 remains available on /tradein/upload-photo for small images only.
POST Upload Photos to Existing Quote
Append additional vehicle photos to an existing quote in your pipeline.
{
"photos": [
"data:image/jpeg;base64,/9j/4AAQSkZJRg...",
{
"dataUrl": "data:image/jpeg;base64,/9j/4AAQSk...",
"slot": "odometer",
"title": "Cluster Mileage"
}
]
}
{
"success": true,
"id": "TI-K9M4Z2",
"addedCount": 2,
"totalPhotos": 4,
"photos": [ ... ]
}
POST Update Quote Pipeline Stage
Allows an external Dealer Management System (DMS) or CRM to synchronize stage progression (e.g. marking a deal as accepted or inspected).
{
"stage": "accepted",
"notes": "Seller confirmed conditional cash offer via phone consultation"
}
📋 Error Codes
| HTTP Status | Error Code / Message | Remedy |
|---|---|---|
400 Bad Request |
MISSING_REQUIRED_FIELD / INVALID_STATE / INVALID_POSTCODE / INVALID_CONDITION / INVALID_PRICE_EXPECTATION / INVALID_LEAD_ID / MISSING_VEHICLE_IDENTIFIER / MISSING_CONTACT / INVALID_VIN / MISSING_STAGE / MISSING_PHOTOS / MISSING_PHOTO |
Check the supplied field values. Postcode must be four digits; condition must be excellent, good, fair, or poor; stage and photo payloads are required where documented. |
401 Unauthorized |
MISSING_API_KEY / INVALID_API_KEY |
Check that your API key is generated in your Dealership Settings and passed in the X-API-Key header. |
422 Unprocessable Entity |
VEHICLE_SPECS_UNRESOLVED / VEHICLE_YEAR_REQUIRED / SANDBOX_FIXTURE_NOT_FOUND |
The registry could not resolve the vehicle, or a sandbox request used a non-fixture plate/VIN. Supply vehicle.make, vehicle.model, and vehicle.year, call a lookup endpoint first, or use the sandbox fixtures. |
404 Not Found |
QUOTE_NOT_FOUND / SANDBOX_FIXTURE_NOT_FOUND |
Verify the quote ID exists in your authenticated dealership account, or use the documented sandbox fixture. |
429 Too Many Requests |
RATE_LIMITED / REGISTRY_RATE_LIMITED |
API request limit reached. Read retryAfter and retry after that many seconds. Lookups are limited to 30 requests per minute per tenant. |
500 Server Error |
Internal server error |
An unexpected server error occurred. Retry request or contact Modulynk support. |
{
"success": false,
"error": "Too many requests. Please retry later.",
"code": "RATE_LIMITED",
"retryAfter": 30,
"limit": 30,
"windowSeconds": 60
}