{"openapi":"3.1.0","info":{"title":"DealerCore API","version":"1.1.0","description":"Read a dealership’s cars for sale and send leads and visit bookings. Each key belongs to one dealership, which creates it in DealerCore › Settings › Website. Docs: https://test.dealercore.ca/developers"},"servers":[{"url":"https://test.dealercore.ca/api/public/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"dck_… key from the dealer"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"type":"string"}},"required":["code","message"]}}},"Car":{"type":"object","properties":{"id":{"type":"integer"},"stock_number":{"type":"string"},"vin":{"type":"string"},"year":{"type":"integer"},"make":{"type":"string"},"model":{"type":"string"},"odometer_km":{"type":"integer"},"colour":{"type":"string"},"price_cad":{"type":["number","null"],"description":"All-in price in CAD (plus HST and licensing). null = call for price."},"price_note":{"type":"string"},"status":{"type":"string","enum":["available","deposit_received"]},"description":{"type":"string"},"disclosures":{"type":"string","description":"Must be shown next to the price (Ontario)."},"carfax_url":{"type":"string"},"location_name":{"type":"string"},"location_address":{"type":"string"},"location_phone":{"type":"string"},"url":{"type":"string","description":"The car page on the dealer’s DealerCore website."},"image_urls":{"type":"array","items":{"type":"string"},"description":"In order; the first is the main photo. A replaced photo gets a new URL."},"photo_count":{"type":"integer"},"photo_credits":{"type":"array","description":"V10.61 credits for photos used under a free licence (show them under the photos). Empty when none.","items":{"type":"object","properties":{"photo":{"type":"integer"},"author":{"type":"string"},"license":{"type":"string"},"license_url":{"type":"string"},"source":{"type":"string"}}}},"dealer":{"type":"string"},"dealer_phone":{"type":"string"},"dealer_address":{"type":"string"},"omvic":{"type":"string"},"last_updated":{"type":"string","format":"date-time"}},"required":["id","year","make","model","status","last_updated"]},"Day":{"type":"object","properties":{"date":{"type":"string","format":"date"},"label":{"type":"string"},"times":{"type":"array","items":{"type":"object","properties":{"time":{"type":"string"},"label":{"type":"string"}}}}}},"Lead":{"type":"object","required":["car_id","name","consent"],"properties":{"car_id":{"type":"integer"},"name":{"type":"string","maxLength":100},"phone":{"type":"string"},"email":{"type":"string","format":"email"},"message":{"type":"string","maxLength":1000},"interest":{"type":"string","enum":["contact","financing"]},"consent":{"type":"boolean","const":true,"description":"The shopper agreed the dealer may contact them."}}},"Booking":{"type":"object","required":["car_id","name","email","phone","day","time"],"properties":{"car_id":{"type":"integer"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"day":{"type":"string","format":"date"},"time":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"note":{"type":"string","maxLength":500}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["car.created","car.updated","car.sold","car.removed","ping"]},"created_at":{"type":"string","format":"date-time"},"dealer":{"type":"string"},"data":{"type":"object"}}}}},"paths":{"/dealer":{"get":{"summary":"The dealership","responses":{"200":{"description":"OK"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/cars":{"get":{"summary":"Cars for sale","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"status","in":"query","schema":{"type":"string","enum":["available","deposit_received"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Car"}},"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}}}}}},"304":{"description":"Not modified (ETag)"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/cars/{id}":{"get":{"summary":"One car","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Car"}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/cars/{id}/photos":{"get":{"summary":"Photos in order","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/cars/{id}/booking-slots":{"get":{"summary":"Open visit times","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"booking":{"type":"boolean"},"days":{"type":"array","items":{"$ref":"#/components/schemas/Day"}}}}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leads":{"post":{"summary":"Send a lead (Contact us / financing)","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Same key + same body within 24 h returns the first answer; a different body returns 409."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"responses":{"201":{"description":"Created"},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhook":{"get":{"summary":"This key’s instant-updates address","responses":{"200":{"description":"OK"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Set this key’s instant-updates address (https). new_secret: true returns a new signing secret.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"new_secret":{"type":"boolean"}}}}}},"responses":{"200":{"description":"On; data.secret is set when new"},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Turn this key’s instant updates off","responses":{"200":{"description":"Off"}}}},"/bookings":{"post":{"summary":"Book a visit (open times only)","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Same key + same body within 24 h returns the first answer; a different body returns 409."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Booking"}}}},"responses":{"201":{"description":"Booked"},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"carEvent":{"post":{"summary":"Instant change alert","description":"Header DealerCore-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your signing secret>. Answer 2xx within 10 s.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Received"}}}}}}