{
  "openapi": "3.1.0",
  "info": {
    "title": "Cars4Me Irkutsk — public rental quote API",
    "version": "1.5.0",
    "description": "Публичный API Cars4Me (Иркутск, production). JSON-каталог и контекст nonce доступны без разбора HTML; существующие расчёты сохранены. Наличие и итог проверяются на явный период. Не создаёт бронь, не принимает оплату, не отправляет контакты. Метки environment/test_only есть у новых JSON-ответов и WebMCP; существующие ответы расчёта их не обещают.",
    "x-cars4me-agent-readiness": {
      "agentReadinessDocumentation": "https://cars4me.ru/developers/#verified-performance",
      "documentationVersion": "1.5.5",
      "webmcpOriginTrialTokenInstalled": true,
      "webmcpOriginTrialOrigin": "https://cars4me.ru:443",
      "webmcpOriginTrialIncludesSubdomains": true,
      "webmcpOriginTrialExpiresAt": "2027-03-30T00:00:00Z",
      "webmcpOriginTrialMayEndEarlier": true,
      "lighthouseTestedUrl": "https://cars4me.ru/",
      "lighthouseMeasuredAt": "2026-11-16T05:42:15+08:00",
      "lighthouseFormFactor": "mobile",
      "lighthouseVersion": "13.6.0",
      "lighthouseAgenticPassed": 6,
      "lighthouseAgenticApplicable": 6,
      "lighthouseAgenticInformative": 1,
      "lighthouseReportUrl": "https://pagespeed.web.dev/analysis/https-cars4me-ru/vxpag2v290?form_factor=mobile",
      "webmcpRegisteredTools": 4
    }
  },
  "servers": [
    {
      "url": "https://cars4me.ru",
      "description": "Иркутск"
    }
  ],
  "externalDocs": {
    "url": "https://cars4me.ru/ai-api.txt",
    "description": "JSON-каталог, nonce, расчёт и ссылки"
  },
  "security": [],
  "paths": {
    "/arenda_avto_irkutsk/": {
      "get": {
        "operationId": "readCarCatalogHtml",
        "summary": "Получить HTML каталога",
        "description": "HTML каталога сохранён для пользователей и прежних интеграций. Для машинного чтения используйте GET action=c4m_agent_catalog_v1. Итоговая стоимость и наличие требуют расчёта.",
        "responses": {
          "200": {
            "description": "HTML каталога",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/wp-admin/admin-ajax.php": {
      "post": {
        "operationId": "publicQuoteApi",
        "summary": "Получить контекст или рассчитать аренду",
        "description": "action=c4m_agent_quote_context_v1 возвращает служебный nonce существующего публичного расчёта. Далее используйте c4m_public_booking_quote или c4mcat_quote_batch с data.nonce в том же сеансе. Вход в аккаунт не требуется. Не передавайте контакты.",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SingleQuoteRequest"
                  },
                  {
                    "$ref": "#/components/schemas/BatchQuoteRequest"
                  },
                  {
                    "$ref": "#/components/schemas/QuoteContextRequest"
                  }
                ]
              },
              "encoding": {
                "optional_ids[]": {
                  "style": "form",
                  "explode": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте success, затем available; даже HTTP 200 может содержать прикладную ошибку.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/SingleQuoteResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BatchQuoteResponse"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/QuoteContextResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Некорректные параметры или неизвестное действие. Возможны JSON-ошибка или текстовый ответ WordPress."
          },
          "403": {
            "description": "Nonce отклонён. Получите новый JSON-контекст в том же сеансе и повторите расчёт один раз."
          },
          "429": {
            "description": "Ограничение частоты; не повторяйте запросы в цикле.",
            "headers": {
              "Retry-After": {
                "description": "Ожидание, если заголовок передан сервером.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Расчёт не подтверждён; сохраните неопределённость наличия, предложите обычный интерфейс сайта."
          },
          "405": {
            "description": "Метод не поддерживается новым действием; проверьте Allow."
          }
        }
      },
      "get": {
        "operationId": "readPublicCarCatalogV1",
        "summary": "Публичный JSON-каталог без разбора HTML",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "c4m_agent_catalog_v1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Каталог: success=true. Сам по себе не подтверждает доступность на даты.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogResponse"
                }
              }
            }
          },
          "405": {
            "description": "Для получения контекста нужен POST."
          },
          "429": {
            "description": "Лимит запросов; учитывайте Retry-After."
          },
          "503": {
            "description": "Каталог или зависимости временно недоступны; наличие неизвестно."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SingleQuoteRequest": {
        "type": "object",
        "required": [
          "action",
          "nonce",
          "pickup_at",
          "return_at",
          "car_id"
        ],
        "properties": {
          "nonce": {
            "type": "string",
            "minLength": 1,
            "description": "data.nonce из POST action=c4m_agent_quote_context_v1 в том же сеансе."
          },
          "pickup_at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
            "description": "Местное время Asia/Irkutsk, без Z/UTC. Получение не в прошлом; возврат позже получения."
          },
          "return_at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
            "description": "Местное время Asia/Irkutsk, без Z/UTC. Получение не в прошлом; возврат позже получения."
          },
          "price_id": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "0 для первичного расчёта; затем price_id из tariffs."
          },
          "pickup_delivery": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          "return_pickup": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          "optional_ids[]": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "uniqueItems": true,
            "description": "Повторяемый form-параметр optional_ids[]=1&optional_ids[]=2; ID из optionals, не CSV."
          },
          "action": {
            "type": "string",
            "const": "c4m_public_booking_quote"
          },
          "car_id": {
            "type": "integer",
            "minimum": 1
          }
        },
        "additionalProperties": false
      },
      "BatchQuoteRequest": {
        "type": "object",
        "required": [
          "action",
          "nonce",
          "pickup_at",
          "return_at",
          "car_ids"
        ],
        "properties": {
          "nonce": {
            "type": "string",
            "minLength": 1,
            "description": "data.nonce из POST action=c4m_agent_quote_context_v1 в том же сеансе."
          },
          "pickup_at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
            "description": "Местное время Asia/Irkutsk, без Z/UTC. Получение не в прошлом; возврат позже получения."
          },
          "return_at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
            "description": "Местное время Asia/Irkutsk, без Z/UTC. Получение не в прошлом; возврат позже получения."
          },
          "price_id": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "0 для первичного расчёта; затем price_id из tariffs."
          },
          "pickup_delivery": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          "return_pickup": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          "optional_ids[]": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "uniqueItems": true,
            "description": "Повторяемый form-параметр optional_ids[]=1&optional_ids[]=2; ID из optionals, не CSV."
          },
          "action": {
            "type": "string",
            "const": "c4mcat_quote_batch"
          },
          "car_ids": {
            "type": "string",
            "pattern": "^[1-9]\\d*(,[1-9]\\d*){0,19}$",
            "description": "От 1 до 20 различных ID через запятую."
          },
          "selection_car": {
            "type": "integer",
            "minimum": 1,
            "description": "Ограничивает выбранные тариф и опции одним автомобилем пакета."
          }
        },
        "additionalProperties": false
      },
      "Quote": {
        "type": "object",
        "required": [
          "car_id",
          "available",
          "pickup_at",
          "return_at"
        ],
        "properties": {
          "car_id": {
            "type": "integer",
            "minimum": 1
          },
          "car_name": {
            "type": "string"
          },
          "available": {
            "type": "boolean",
            "description": "false означает недоступность; цена может присутствовать и при false."
          },
          "pickup_at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
            "description": "Местное время Asia/Irkutsk, без Z/UTC. Получение не в прошлом; возврат позже получения."
          },
          "return_at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
            "description": "Местное время Asia/Irkutsk, без Z/UTC. Получение не в прошлом; возврат позже получения."
          },
          "days": {
            "type": "integer",
            "minimum": 1
          },
          "rental_total": {
            "type": "number",
            "minimum": 0,
            "description": "Рубли (RUB)"
          },
          "services_total": {
            "type": "number",
            "minimum": 0,
            "description": "Рубли (RUB)"
          },
          "optionals_total": {
            "type": "number",
            "minimum": 0,
            "description": "Рубли (RUB)"
          },
          "total": {
            "type": "number",
            "minimum": 0,
            "description": "Аренда плюс учтённые услуги; залог отдельно."
          },
          "deposit": {
            "type": "number",
            "minimum": 0,
            "description": "Залог отдельно от total; не аккредитив."
          },
          "cash_total": {
            "type": "number",
            "minimum": 0,
            "description": "Рубли (RUB)"
          },
          "selected_price_id": {
            "type": "integer",
            "minimum": 1
          },
          "tariff_name": {
            "type": "string"
          },
          "daily_mileage": {
            "type": "number",
            "minimum": 0
          },
          "selected_optionals": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "tariffs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "price_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "name": {
                  "type": "string"
                },
                "rental_total": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Рубли (RUB)"
                }
              },
              "additionalProperties": true
            }
          },
          "optionals": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "name": {
                  "type": "string"
                },
                "amount": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Рубли (RUB)"
                },
                "per_day": {
                  "type": "boolean"
                }
              },
              "additionalProperties": true
            }
          },
          "service_lines": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "optional_lines": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "timezone": {
            "type": "string",
            "description": "Смещение часового пояса ответа, например +08:00."
          }
        },
        "additionalProperties": true
      },
      "SingleQuoteResponse": {
        "type": "object",
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "const": true
          },
          "data": {
            "$ref": "#/components/schemas/Quote"
          }
        }
      },
      "BatchQuoteResponse": {
        "type": "object",
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "const": true
          },
          "data": {
            "type": "object",
            "required": [
              "pickup_at",
              "return_at",
              "results"
            ],
            "properties": {
              "pickup_at": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
                "description": "Местное время Asia/Irkutsk, без Z/UTC. Получение не в прошлом; возврат позже получения."
              },
              "return_at": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
                "description": "Местное время Asia/Irkutsk, без Z/UTC. Получение не в прошлом; возврат позже получения."
              },
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "car_id"
                  ],
                  "properties": {
                    "car_id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "quote": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "error": {
                      "description": "Ошибка автомобиля: наличие неизвестно; формат пояснения может различаться."
                    }
                  },
                  "anyOf": [
                    {
                      "required": [
                        "quote"
                      ]
                    },
                    {
                      "required": [
                        "error"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "const": false
          },
          "data": {
            "description": "Пояснение ошибки; структура зависит от обработчика."
          }
        }
      },
      "PublicCar": {
        "type": "object",
        "properties": {
          "car_id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "brand": {
            "type": "string"
          },
          "transmission": {
            "type": "string"
          },
          "seats": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 100
          },
          "drive": {
            "type": "string"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1900,
            "maximum": 2100
          },
          "category": {
            "type": "string"
          },
          "image": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "alt": {
                    "type": "string"
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "url",
                  "alt",
                  "width",
                  "height"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "car_id",
          "name",
          "url",
          "brand",
          "transmission",
          "seats",
          "drive",
          "year",
          "category",
          "image"
        ],
        "additionalProperties": false
      },
      "CatalogResponse": {
        "type": "object",
        "properties": {
          "success": {
            "const": true
          },
          "data": {
            "type": "object",
            "properties": {
              "api_version": {
                "const": "1"
              },
              "release": {
                "type": "string"
              },
              "origin": {
                "const": "https://cars4me.ru"
              },
              "region": {
                "const": "irkutsk"
              },
              "timezone": {
                "const": "Asia/Irkutsk"
              },
              "environment": {
                "const": "production"
              },
              "test_only": {
                "const": false
              },
              "booking_created": {
                "const": false
              },
              "generated_at": {
                "type": "string",
                "format": "date-time"
              },
              "count": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "cars": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "items": {
                  "$ref": "#/components/schemas/PublicCar"
                }
              },
              "availability_requires_quote": {
                "const": true
              },
              "quote_context_url": {
                "const": "https://cars4me.ru/wp-admin/admin-ajax.php?action=c4m_agent_quote_context_v1"
              },
              "notice": {
                "type": "string"
              }
            },
            "required": [
              "api_version",
              "release",
              "origin",
              "region",
              "timezone",
              "environment",
              "test_only",
              "booking_created",
              "generated_at",
              "count",
              "cars",
              "availability_requires_quote",
              "quote_context_url",
              "notice"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "success",
          "data"
        ],
        "additionalProperties": false
      },
      "QuoteContextRequest": {
        "type": "object",
        "properties": {
          "action": {
            "const": "c4m_agent_quote_context_v1"
          }
        },
        "required": [
          "action"
        ],
        "additionalProperties": false
      },
      "QuoteContextResponse": {
        "type": "object",
        "properties": {
          "success": {
            "const": true
          },
          "data": {
            "type": "object",
            "properties": {
              "api_version": {
                "const": "1"
              },
              "release": {
                "type": "string"
              },
              "origin": {
                "const": "https://cars4me.ru"
              },
              "region": {
                "const": "irkutsk"
              },
              "timezone": {
                "const": "Asia/Irkutsk"
              },
              "environment": {
                "const": "production"
              },
              "test_only": {
                "const": false
              },
              "booking_created": {
                "const": false
              },
              "issued_at": {
                "type": "string",
                "format": "date-time"
              },
              "nonce": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9]{10}$"
              },
              "nonce_type": {
                "const": "wordpress_action_nonce"
              },
              "single_use": {
                "const": false
              },
              "refresh_after_seconds": {
                "const": 300
              },
              "refresh_on_http_status": {
                "const": 403
              },
              "reuse_same_session": {
                "const": true
              },
              "quote_url": {
                "const": "https://cars4me.ru/wp-admin/admin-ajax.php"
              },
              "quote_actions": {
                "type": "array",
                "prefixItems": [
                  {
                    "const": "c4m_public_booking_quote"
                  },
                  {
                    "const": "c4mcat_quote_batch"
                  }
                ],
                "minItems": 2,
                "maxItems": 2
              },
              "notice": {
                "type": "string"
              }
            },
            "required": [
              "api_version",
              "release",
              "origin",
              "region",
              "timezone",
              "environment",
              "test_only",
              "booking_created",
              "issued_at",
              "nonce",
              "nonce_type",
              "single_use",
              "refresh_after_seconds",
              "refresh_on_http_status",
              "reuse_same_session",
              "quote_url",
              "quote_actions",
              "notice"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "success",
          "data"
        ],
        "additionalProperties": false
      }
    }
  }
}
