{
  "openapi": "3.1.0",
  "info": {
    "title": "lock.md public information API",
    "version": "1.0.0",
    "description": "Read-only public service information in Romanian and Russian. No authentication, registration, booking, dispatch or payment operations. Prices and availability require confirmation by the dispatcher."
  },
  "servers": [
    {
      "url": "https://lock.md"
    }
  ],
  "security": [],
  "externalDocs": {
    "url": "https://lock.md/api/docs.md"
  },
  "paths": {
    "/api/public/catalog.json": {
      "get": {
        "operationId": "listPublicPages",
        "summary": "List public pages and service keywords",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Current public website data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource. No account or credential is provisioned."
          }
        }
      }
    },
    "/api/public/business.json": {
      "get": {
        "operationId": "getPublicBusiness",
        "summary": "Read contact channels, area and operating conditions",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Current public website data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Business"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource. No account or credential is provisioned."
          }
        }
      }
    },
    "/api/public/pages/{locale}/{pageId}.json": {
      "get": {
        "operationId": "getPublicPage",
        "summary": "Read a page, its Markdown, FAQ and price conditions",
        "parameters": [
          {
            "name": "locale",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ro",
                "ru"
              ]
            }
          },
          {
            "name": "pageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "home",
                "emergency-locksmith",
                "services",
                "door-opening",
                "broken-key-extraction",
                "lock-repair",
                "door-repair",
                "lock-replacement",
                "cylinder-replacement",
                "lock-installation",
                "key-cutting",
                "intercom-keys",
                "auto-hub",
                "auto-keys",
                "auto-key-duplicate",
                "transponder-key",
                "lost-car-keys",
                "auto-opening",
                "safe-opening",
                "rekeying",
                "smart-locks",
                "business-service",
                "prices",
                "locations",
                "safety-access",
                "guarantees",
                "while-waiting",
                "about",
                "contact",
                "ignition-lock-repair",
                "privacy",
                "cookies"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current public website data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource. No account or credential is provisioned."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Price": {
        "type": "object",
        "properties": {
          "currency": {
            "const": "MDL"
          },
          "from": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "kind": {
            "enum": [
              "starting_price",
              "after_diagnosis"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "confirmationRequired": {
            "const": true
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "currency",
          "from",
          "kind",
          "label",
          "confirmationRequired",
          "conditions"
        ],
        "additionalProperties": false
      },
      "PageSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "locale": {
            "type": "string",
            "enum": [
              "ru",
              "ro"
            ]
          },
          "language": {
            "type": "string",
            "minLength": 1
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri"
          },
          "jsonUrl": {
            "type": "string",
            "format": "uri"
          },
          "lastModified": {
            "type": "string",
            "format": "date"
          },
          "serviceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "id",
          "locale",
          "language",
          "title",
          "description",
          "type",
          "url",
          "markdownUrl",
          "jsonUrl",
          "lastModified",
          "serviceId",
          "keywords"
        ],
        "additionalProperties": false
      },
      "Page": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": "1.0"
          },
          "id": {
            "type": "string",
            "minLength": 1
          },
          "locale": {
            "type": "string",
            "enum": [
              "ru",
              "ro"
            ]
          },
          "language": {
            "type": "string",
            "minLength": 1
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri"
          },
          "jsonUrl": {
            "type": "string",
            "format": "uri"
          },
          "lastModified": {
            "type": "string",
            "format": "date"
          },
          "serviceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "markdown": {
            "type": "string",
            "minLength": 1
          },
          "faq": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "question": {
                  "type": "string",
                  "minLength": 1
                },
                "answer": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "question",
                "answer"
              ],
              "additionalProperties": false
            }
          },
          "price": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Price"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "schemaVersion",
          "id",
          "locale",
          "language",
          "title",
          "description",
          "type",
          "url",
          "markdownUrl",
          "jsonUrl",
          "lastModified",
          "serviceId",
          "keywords",
          "markdown",
          "faq",
          "price"
        ],
        "additionalProperties": false
      },
      "Catalog": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": "1.0"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ru",
                "ro"
              ]
            }
          },
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageSummary"
            }
          }
        },
        "required": [
          "schemaVersion",
          "name",
          "url",
          "languages",
          "pages"
        ],
        "additionalProperties": false
      },
      "Business": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": "1.0"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "legalName": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "telephone": {
            "type": "string",
            "minLength": 1
          },
          "telephoneDisplay": {
            "type": "string",
            "minLength": 1
          },
          "contactLinks": {
            "type": "object",
            "properties": {
              "tel": {
                "type": "string",
                "format": "uri"
              },
              "viber": {
                "type": "string",
                "format": "uri"
              },
              "whatsapp": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "tel",
              "viber",
              "whatsapp"
            ],
            "additionalProperties": false
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ru",
                "ro"
              ]
            }
          },
          "timezone": {
            "type": "string",
            "minLength": 1
          },
          "hours": {
            "type": "object",
            "properties": {
              "urgentRequestLine": {
                "type": "string",
                "minLength": 1
              },
              "planned": {
                "type": "string",
                "minLength": 1
              },
              "arrival": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "urgentRequestLine",
              "planned",
              "arrival"
            ],
            "additionalProperties": false
          },
          "serviceArea": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ru": {
                  "type": "string",
                  "minLength": 1
                },
                "ro": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "ru",
                "ro"
              ],
              "additionalProperties": false
            }
          },
          "pricing": {
            "type": "object",
            "properties": {
              "currency": {
                "const": "MDL"
              },
              "standardFrom": {
                "type": "number"
              },
              "smallKeysFrom": {
                "type": "number"
              },
              "ignition": {
                "const": "after_diagnosis"
              },
              "calloutCancellation": {
                "type": "number"
              },
              "outsideCityPerKm": {
                "type": "number"
              },
              "conditions": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "currency",
              "standardFrom",
              "smallKeysFrom",
              "ignition",
              "calloutCancellation",
              "outsideCityPerKm",
              "conditions"
            ],
            "additionalProperties": false
          },
          "emergencyNumber": {
            "type": "string",
            "minLength": 1
          },
          "accessPolicy": {
            "type": "string",
            "format": "uri"
          },
          "contactPage": {
            "type": "string",
            "format": "uri"
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "publicReadOnly": {
                "const": true
              },
              "registration": {
                "const": false
              },
              "booking": {
                "const": false
              },
              "onlinePayment": {
                "const": false
              }
            },
            "required": [
              "publicReadOnly",
              "registration",
              "booking",
              "onlinePayment"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "schemaVersion",
          "name",
          "legalName",
          "url",
          "telephone",
          "telephoneDisplay",
          "contactLinks",
          "languages",
          "timezone",
          "hours",
          "serviceArea",
          "pricing",
          "emergencyNumber",
          "accessPolicy",
          "contactPage",
          "capabilities"
        ],
        "additionalProperties": false
      }
    }
  }
}
