{"openapi":"3.1.0","info":{"title":"VINtoGlass API","version":"1","description":"Manufacturer glass part numbers and ARGIC codes from a VIN or a UK registration number. Version 1 only ever gains fields and endpoints; a breaking change is a new version in the path. A version that is going away is announced at least 12 months ahead with Deprecation and Sunset headers."},"servers":[{"url":"https://api.vintoglass.com"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/":{"get":{"summary":"API information","operationId":"index","responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. See the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account":{"get":{"summary":"Your account\u0027s allowance and prices","operationId":"getAccount","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Missing, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. See the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/lookups":{"post":{"summary":"Look up a VIN or a registration number","operationId":"createLookup","description":"Send a VIN, or a UK registration number as vrn (it is turned into its VIN first: the answer is the same, and the registration and the vehicle it was said to be are shown in the lookup). Answers at once (201) when the vehicle has been looked up before, otherwise queues the lookup (202): poll GET /v1/lookups/{id}. Send an Idempotency-Key header so a retry never looks up or charges twice.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupRequest"}}}},"responses":{"201":{"description":"Answered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lookup"}}}},"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lookup"}}}},"402":{"description":"Allowance used up (code insufficient_allowance)."},"409":{"description":"Idempotency-Key reused with a different request."},"422":{"description":"Invalid request: not a VIN or positions we know, both or neither of vin and vrn, or a registration we could not find (code vrn_not_found)."},"401":{"description":"Missing, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests, or this key started a new VIN less than 2 minutes after its last one (code new_vin_limit). See the Retry-After header. A VIN we already hold is answered at once and never limited. Also code vrn_limit: more paid registration lookups today than the account allows (use the VIN instead).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Registration lookups are not available right now (code vrn_unavailable). Nothing was charged. See the Retry-After header; a VIN still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List your account\u0027s lookups, newest first","operationId":"listLookups","parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"vin","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. See the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/lookups/{id}":{"get":{"summary":"One lookup","operationId":"getLookup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lookup"}}}},"404":{"description":"No such lookup on this account."},"401":{"description":"Missing, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. See the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/lookups/{id}/flag":{"post":{"summary":"Report a lookup as wrong","operationId":"flagLookup","description":"We review every report. If we agree the result was wrong, the charge is credited back; the lookup\u0027s \u0060flag\u0060 shows the outcome. One report per lookup, within 30 days of the answer.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagRequest"}}}},"responses":{"201":{"description":"Reported","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lookup"}}}},"404":{"description":"No such lookup on this account."},"409":{"description":"Already reported (code already_flagged)."},"422":{"description":"Invalid request, or the lookup cannot be reported."},"401":{"description":"Missing, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. See the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/openapi.json":{"get":{"summary":"This document","operationId":"openapi","security":[],"responses":{"200":{"description":"OK"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key, e.g. vtg_live_..."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Account":{"type":"object","properties":{"object":{"type":"string"},"name":{"type":"string"},"mode":{"type":"string"},"currency":{"type":"string"},"balance":{"type":"string"},"available":{"type":"string"},"price":{"type":"string"},"extra_position_price":{"type":"string"},"repeat_free_hours":{"type":"integer"}}},"LookupRequest":{"type":"object","properties":{"vin":{"type":"string","minLength":17,"maxLength":17,"description":"The 17-character VIN. Give this or vrn, not both."},"vrn":{"type":"string","maxLength":10,"description":"A UK registration number, such as AB12 CDE (spaces and case do not matter). Give this or vin, not both."},"positions":{"type":"array","items":{"type":"string","enum":["windscreen","rear_window","front_door_left","front_door_right","rear_door_left","rear_door_right","back_door_left","back_door_right","fixed_left","fixed_right","roof_glass"]},"default":["windscreen"]},"reference":{"type":"string","maxLength":80}},"description":"The vehicle, given as either a VIN or a UK registration number (a number plate), and the glass wanted. A registration is first turned into its VIN; the answer is then the same.","oneOf":[{"required":["vin"]},{"required":["vrn"]}]},"FlagRequest":{"type":"object","required":["problem"],"properties":{"problem":{"enum":["wrong_number","wrong_argic","wrong_options","missing","wrong_vehicle","other"]},"position":{"type":"string","enum":["windscreen","rear_window","front_door_left","front_door_right","rear_door_left","rear_door_right","back_door_left","back_door_right","fixed_left","fixed_right","roof_glass"]},"correct_oem":{"type":"string"},"correct_argic":{"type":"string"},"details":{"type":"string","maxLength":2000}}},"Flag":{"type":["object","null"],"properties":{"status":{"enum":["pending","approved","rejected"]},"problem":{"type":"string"},"position":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"decided_at":{"type":["string","null"],"format":"date-time"},"staff_note":{"type":"string"},"refunded":{"type":["string","null"]}}},"Lookup":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"lookup"},"vin":{"type":"string"},"vrn":{"type":"string","description":"The registration number the vehicle was asked for by. Present only when the lookup was made with a vrn."},"vrn_vehicle":{"type":"string","description":"What that registration was said to be (make, model, year), so you can check it is the vehicle you meant. Present only with vrn."},"positions":{"type":"array","items":{"type":"string"}},"reference":{"type":"string"},"status":{"enum":["queued","running","done","failed"]},"created_at":{"type":"string","format":"date-time"},"answered_at":{"type":["string","null"],"format":"date-time"},"cached":{"type":"boolean"},"charged":{"type":"string"},"currency":{"const":"GBP"},"result":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Result"}]},"flag":{"$ref":"#/components/schemas/Flag"},"queue":{"type":"object","properties":{"position":{"type":"integer"},"eta_s":{"type":"integer"}}}}},"Result":{"type":"object","properties":{"status":{"enum":["ok","no_vehicle","invalid_vin","not_covered","unavailable"]},"vehicle":{"type":"string"},"message":{"type":"string"},"positions":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Position"}}}},"Position":{"type":"object","properties":{"label":{"type":"string"},"status":{"enum":["ok","options","none","not_covered"]},"part_number":{"type":"string"},"numbers":{"type":"array","items":{"type":"string"}},"argic":{"type":"string"},"argic_status":{"enum":["unique","options","none",""]},"argic_options":{"type":"array","items":{"type":"object"}},"candidates":{"type":"array","items":{"type":"object","properties":{"number":{"type":"string"},"argic":{"type":"array","items":{"type":"string"}},"differs":{"type":"array","items":{"type":"string"}},"alternative_of":{"type":"array","items":{"type":"string"}}}}},"replaces":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"remark":{"type":"string"},"fitment":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}},"check_fit":{"type":"boolean"}}}}}}