{
 "openapi": "3.1.0",
 "info": {
  "title": "API подбора запчастей по VIN — подойдёт.рф",
  "description": "Проверка применимости запчасти по VIN, номер детали по названию, расшифровка VIN. Все марки в одном каталоге, включая китайские.\n\n**Ключ:** создаётся в кабинете https://подойдёт.рф/lk/api/, передаётся заголовком `Authorization: Bearer <ключ>`.\n\n**Цена (₽ за ответ):** проверка 9, поиск по названию 19, расшифровка VIN 3; «не знаем», уточнения и ошибки бесплатны. Баланс в рублях: пополнение 5 000 ₽ → 5 000 ₽, 20 000 ₽ → 23 000 ₽, 50 000 ₽ → 65 000 ₽; остаток живёт 12 месяцев.\n\n**Ошибки:** 401 нет ключа · 402 на балансе не хватает · 422 неверный VIN или номер · 429 больше 60 запросов в минуту или 1 000 в сутки на ключ.",
  "version": "1.0"
 },
 "servers": [
  {
   "url": "https://xn--d1aaosbd0a3j.xn--p1ai/api",
   "description": "подойдёт.рф"
  }
 ],
 "paths": {
  "/v1/balance": {
   "get": {
    "summary": "Остаток и цены",
    "operationId": "balance_v1_public_balance_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Balance V1 Public Balance Get"
        },
        "example": {
         "ok": true,
         "balance": 59,
         "prices": {
          "vin": 3,
          "check": 9,
          "find": 19
         },
         "key": "pd_live_7Kq2"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "description": "Сколько запросов осталось и сколько стоит каждый метод. Бесплатно.",
    "tags": [
     "Методы"
    ]
   }
  },
  "/v1/vin": {
   "post": {
    "summary": "Расшифровка VIN",
    "operationId": "vin_decode_v1_public_vin_post",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/VinIn"
       },
       "example": {
        "vin": "WDD2120341A123456"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Vin Decode V1 Public Vin Post"
        },
        "example": {
         "ok": true,
         "method": "vin",
         "status": "ok",
         "message": "",
         "car": {
          "make": "Mercedes-Benz",
          "model": "E 200",
          "year": 2011,
          "modification": "",
          "body": "212",
          "production_date": "2011-03-14",
          "steering": null,
          "options": [
           {
            "code": "500",
            "name": "электроскладывание зеркал"
           }
          ]
         },
         "precision": "vin",
         "charged": 3,
         "balance": 59
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "description": "Марка, модель, год, кузов, руль, дата выпуска и заводские опции. 3 ₽; повтор той же машины — бесплатно.",
    "tags": [
     "Методы"
    ]
   }
  },
  "/v1/check": {
   "post": {
    "summary": "Подходит ли деталь на машину",
    "operationId": "check_v1_public_check_post",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CheckIn"
       },
       "example": {
        "vin": "WDD2120341A123456",
        "number": "A2129060203"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Check V1 Public Check Post"
        },
        "example": {
         "ok": true,
         "method": "check",
         "status": "not_fits",
         "message": "Деталь не подходит на эту машину; в поле installed — что стоит на машине в этой позиции.",
         "number": "A2129060203",
         "precision": "vin",
         "installed": [
          "A2129060403"
         ],
         "variants": [],
         "choices": [],
         "car": {
          "make": "Mercedes-Benz",
          "model": "E 200",
          "year": 2011,
          "modification": "",
          "body": "212",
          "production_date": "2011-03-14",
          "steering": null,
          "options": [
           {
            "code": "500",
            "name": "электроскладывание зеркал"
           }
          ]
         },
         "charged": 9,
         "balance": 81
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "description": "VIN и номер детали → `fits` / `not_fits` / `related` / `unknown`. При `not_fits` в `installed` — номера, которые стоят на этой машине в той же позиции. Стоит 9 ₽, списывается только за `fits` и `not_fits`; повтор той же пары VIN и номера 30 дней — бесплатно.",
    "tags": [
     "Методы"
    ]
   }
  },
  "/v1/find": {
   "post": {
    "summary": "Номер детали по названию",
    "operationId": "find_v1_public_find_post",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/FindIn"
       },
       "example": {
        "vin": "LVVDB21B8PD123456",
        "query": "левая фара"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Find V1 Public Find Post"
        },
        "example": {
         "ok": true,
         "method": "find",
         "status": "found",
         "message": "Найдены позиции с номерами.",
         "query": "левая фара",
         "precision": "vin",
         "positions": [
          {
           "name": "Фара левая в сборе",
           "numbers": [
            {
             "number": "T26-4421010",
             "exact": true
            }
           ]
          }
         ],
         "choices": [],
         "node_choices": [],
         "car": null,
         "charged": 19,
         "balance": 62
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "description": "VIN и название детали словами → позиции каталога с номерами (`exact` — номер точно для этой машины). Неоднозначное название → `need_node` и варианты в `node_choices`, повторите с `node_id`. Стоит 19 ₽, списывается только за `found`.",
    "tags": [
     "Методы"
    ]
   }
  }
 },
 "components": {
  "schemas": {
   "CheckIn": {
    "properties": {
     "vin": {
      "type": "string",
      "maxLength": 40,
      "minLength": 1,
      "title": "Vin"
     },
     "number": {
      "type": "string",
      "maxLength": 40,
      "minLength": 1,
      "title": "Number"
     },
     "model": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 40
       },
       {
        "type": "null"
       }
      ],
      "title": "Model"
     }
    },
    "type": "object",
    "required": [
     "vin",
     "number"
    ],
    "title": "CheckIn"
   },
   "FindIn": {
    "properties": {
     "vin": {
      "type": "string",
      "maxLength": 40,
      "minLength": 1,
      "title": "Vin"
     },
     "query": {
      "type": "string",
      "maxLength": 120,
      "minLength": 3,
      "title": "Query"
     },
     "model": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 40
       },
       {
        "type": "null"
       }
      ],
      "title": "Model"
     },
     "node_id": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Node Id"
     }
    },
    "type": "object",
    "required": [
     "vin",
     "query"
    ],
    "title": "FindIn"
   },
   "HTTPValidationError": {
    "properties": {
     "detail": {
      "items": {
       "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
     }
    },
    "type": "object",
    "title": "HTTPValidationError"
   },
   "ValidationError": {
    "properties": {
     "loc": {
      "items": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      },
      "type": "array",
      "title": "Location"
     },
     "msg": {
      "type": "string",
      "title": "Message"
     },
     "type": {
      "type": "string",
      "title": "Error Type"
     },
     "input": {
      "title": "Input"
     },
     "ctx": {
      "type": "object",
      "title": "Context"
     }
    },
    "type": "object",
    "required": [
     "loc",
     "msg",
     "type"
    ],
    "title": "ValidationError"
   },
   "VinIn": {
    "properties": {
     "vin": {
      "type": "string",
      "maxLength": 40,
      "minLength": 1,
      "title": "Vin"
     }
    },
    "type": "object",
    "required": [
     "vin"
    ],
    "title": "VinIn"
   }
  },
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "Ключ из кабинета: pd_live_…"
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ]
}