{
  "openapi": "3.0.3",
  "info": {
    "title": "Pizza Fashion Partner API",
    "version": "1.2.0",
    "description": "Публичен каталог, точни цени и входящи поръчки в брой за отделно удостоверени партньори. Пълно описание: https://api.pizzafashion.bg/bg/"
  },
  "servers": [
    {
      "url": "https://api.pizzafashion.bg/v1",
      "description": "Canonical v1"
    },
    {
      "url": "https://pizzafashion.bg/api/index.php/v1/pizzafashion/partner",
      "description": "Compatible original v1"
    }
  ],
  "paths": {
    "/catalogue": {
      "get": {
        "operationId": "getCatalogue",
        "summary": "Продукти, опции и комбота",
        "security": [
          {
            "partnerBasic": []
          }
        ],
        "responses": {
          "200": {
            "description": "Успешен отговор; данни в meta.data.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Catalogue"
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": true
                    },
                    "links": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "jsonapi": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "meta"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Неподдържани query параметри / gateway заявка.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Липсващ, грешен, спрян или сменен ключ/парола.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS е задължителен; HTTP API заявки не се пренасочват с ключа.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Няма ваша поръчка с този ID или маршрутът не съществува.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Променена/изтекла оферта, конфликтен external_order_id или заета заявка. Проверете статуса.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Невалидни полета, опции, телефон, минимум, затворен период или липсваща наличност. Коригирайте данните.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Достигнат лимит. Спазете Retry-After.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Изключен прием/API/партньор или временна недостъпност. Ограничени повторни опити със същия ID.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Страница от 1 до 10000. Четете до has_more=false.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            }
          }
        ]
      }
    },
    "/availability": {
      "get": {
        "operationId": "getAvailability",
        "summary": "Зони и получаване",
        "security": [
          {
            "partnerBasic": []
          }
        ],
        "responses": {
          "200": {
            "description": "Успешен отговор; данни в meta.data.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Availability"
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": true
                    },
                    "links": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "jsonapi": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "meta"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Неподдържани query параметри / gateway заявка.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Липсващ, грешен, спрян или сменен ключ/парола.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS е задължителен; HTTP API заявки не се пренасочват с ключа.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Няма ваша поръчка с този ID или маршрутът не съществува.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Променена/изтекла оферта, конфликтен external_order_id или заета заявка. Проверете статуса.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Невалидни полета, опции, телефон, минимум, затворен период или липсваща наличност. Коригирайте данните.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Достигнат лимит. Спазете Retry-After.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Изключен прием/API/партньор или временна недостъпност. Ограничени повторни опити със същия ID.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/quote": {
      "post": {
        "operationId": "createQuote",
        "summary": "Цена без създаване на поръчка",
        "security": [
          {
            "partnerBasic": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешен отговор; данни в meta.data.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/QuoteResponse"
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": true
                    },
                    "links": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "jsonapi": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "meta"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Неподдържани query параметри / gateway заявка.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Липсващ, грешен, спрян или сменен ключ/парола.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS е задължителен; HTTP API заявки не се пренасочват с ключа.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Няма ваша поръчка с този ID или маршрутът не съществува.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Променена/изтекла оферта, конфликтен external_order_id или заета заявка. Проверете статуса.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Невалидни полета, опции, телефон, минимум, затворен период или липсваща наличност. Коригирайте данните.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Достигнат лимит. Спазете Retry-After.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Изключен прием/API/партньор или временна недостъпност. Ограничени повторни опити със същия ID.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/orders": {
      "post": {
        "operationId": "submitOrder",
        "summary": "Създай поръчка със защита от дублиране",
        "security": [
          {
            "partnerBasic": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешен отговор; данни в meta.data.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/OrderStatus"
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": true
                    },
                    "links": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "jsonapi": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "meta"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Неподдържани query параметри / gateway заявка.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Липсващ, грешен, спрян или сменен ключ/парола.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS е задължителен; HTTP API заявки не се пренасочват с ключа.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Няма ваша поръчка с този ID или маршрутът не съществува.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Променена/изтекла оферта, конфликтен external_order_id или заета заявка. Проверете статуса.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Невалидни полета, опции, телефон, минимум, затворен период или липсваща наличност. Коригирайте данните.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Достигнат лимит. Спазете Retry-After.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Изключен прием/API/партньор или временна недостъпност. Ограничени повторни опити със същия ID.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/orderstatus": {
      "post": {
        "operationId": "getOwnOrderStatus",
        "summary": "Провери собствена поръчка",
        "security": [
          {
            "partnerBasic": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешен отговор; данни в meta.data.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/OrderStatus"
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": true
                    },
                    "links": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "jsonapi": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "meta"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Неподдържани query параметри / gateway заявка.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Липсващ, грешен, спрян или сменен ключ/парола.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "HTTPS е задължителен; HTTP API заявки не се пренасочват с ключа.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Няма ваша поръчка с този ID или маршрутът не съществува.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Променена/изтекла оферта, конфликтен external_order_id или заета заявка. Проверете статуса.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "Тяло над 128 KiB / изисква се Content-Type: application/json.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Невалидни полета, опции, телефон, минимум, затворен период или липсваща наличност. Коригирайте данните.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Достигнат лимит. Спазете Retry-After.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Изключен прием/API/партньор или временна недостъпност. Ограничени повторни опити със същия ID.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "partnerBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "Username=API ключ; password=отделна парола. Само HTTPS и само backend."
      }
    },
    "schemas": {
      "RequestHeaders": {
        "type": "object",
        "description": "Заглавки на заявките",
        "properties": {
          "Authorization": {
            "type": "string",
            "description": "HTTP Basic: API ключът е username, отделната парола е password. Само към HTTPS адреса на API.",
            "example": "Basic <base64(API_KEY:API_PASSWORD)>"
          },
          "Accept": {
            "type": "string",
            "description": "Изрично поискайте JSON API отговор.",
            "example": "application/vnd.api+json"
          },
          "Content-Type": {
            "type": "string",
            "description": "За POST тялото трябва да е UTF-8 JSON обект. Не изпращайте HTML form или form-data. [post]",
            "example": "application/json"
          }
        },
        "required": [
          "Authorization",
          "Accept"
        ],
        "additionalProperties": false
      },
      "CatalogueQuery": {
        "type": "object",
        "description": "Страници на каталога",
        "properties": {
          "page": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000,
            "default": 1,
            "description": "Цяло число 1–10000, по подразбиране 1. Пример: /catalogue?page=2. Други query параметри не се поддържат.",
            "example": 1
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "Catalogue": {
        "type": "object",
        "description": "Отговор на каталога",
        "properties": {
          "schema": {
            "type": "integer",
            "minimum": 0,
            "description": "Версия на структурата; в момента 1.",
            "readOnly": true,
            "example": 1
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR"
            ],
            "description": "Валутата на всички цени.",
            "readOnly": true,
            "example": "EUR"
          },
          "timezone": {
            "type": "string",
            "description": "Часова зона за работното време.",
            "readOnly": true,
            "example": "Europe/Sofia"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            },
            "description": "Категории; свържете чрез category_ids на продукта.",
            "readOnly": true
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            },
            "description": "До 50 продукта на страница, включително деца за избор.",
            "readOnly": true
          },
          "page": {
            "type": "integer",
            "minimum": 0,
            "description": "Номер на текущата страница; започва от 1.",
            "readOnly": true,
            "example": 1
          },
          "page_size": {
            "type": "integer",
            "minimum": 0,
            "description": "Размер на страницата: 50.",
            "readOnly": true,
            "example": 50
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Общ брой продукти, не само видимите карти.",
            "readOnly": true,
            "example": 144
          },
          "has_more": {
            "type": "boolean",
            "description": "При true извикайте следващата страница.",
            "readOnly": true,
            "example": true
          },
          "combos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Combo"
            },
            "description": "Комбо предложения; обединявайте страниците по code.",
            "readOnly": true
          },
          "pizza_bases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Base"
            },
            "description": "Общ списък основи; използвайте конкретния products[].bases за продукта.",
            "readOnly": true
          },
          "half": {
            "allOf": [
              {
                "$ref": "#/components/schemas/HalfSettings"
              }
            ],
            "description": "Настройки за пица 50/50.",
            "readOnly": true
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Час на генериране, RFC3339.",
            "readOnly": true,
            "example": "2026-10-18T12:00:00+00:00"
          }
        },
        "required": [
          "schema",
          "currency",
          "timezone",
          "categories",
          "products",
          "page",
          "page_size",
          "total",
          "has_more",
          "combos",
          "pizza_bases",
          "half",
          "generated_at"
        ],
        "additionalProperties": true
      },
      "Category": {
        "type": "object",
        "description": "Категории",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 0,
            "description": "Постоянен идентификатор на категорията.",
            "readOnly": true,
            "example": 7
          },
          "name": {
            "type": "string",
            "description": "Публично име на категорията.",
            "readOnly": true,
            "example": "Пици"
          },
          "icon": {
            "type": "string",
            "description": "Код на иконка; визуален метаданен атрибут.",
            "readOnly": true,
            "example": "pizza"
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "description": "Брой продукти в категорията според менюто.",
            "readOnly": true,
            "example": 24
          }
        },
        "required": [
          "id",
          "name",
          "icon",
          "count"
        ],
        "additionalProperties": true
      },
      "Product": {
        "type": "object",
        "description": "Атрибути на продукт",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 0,
            "description": "Стабилен ID; изпратете го като selection.product_id.",
            "readOnly": true,
            "example": 123
          },
          "name": {
            "type": "string",
            "description": "Име за показване; API не превежда имената на ястията.",
            "readOnly": true,
            "example": "Пица Чикън"
          },
          "description": {
            "type": "string",
            "description": "Обикновен текст без HTML.",
            "readOnly": true,
            "example": "Пилешко месо, моцарела"
          },
          "category_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Категориите, към които принадлежи продуктът.",
            "readOnly": true,
            "example": [
              7
            ]
          },
          "image": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "Абсолютен HTTPS адрес на снимката или null.",
            "readOnly": true,
            "example": "https://pizzafashion.bg/images/example.webp"
          },
          "thumbnail": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "По-малка снимка за каталог или null.",
            "readOnly": true,
            "example": "https://pizzafashion.bg/images/example-thumb.webp"
          },
          "image_illustrative": {
            "type": "boolean",
            "description": "Дали снимката е илюстративна.",
            "readOnly": true,
            "example": false
          },
          "listed": {
            "type": "boolean",
            "description": "false: дете за вкус/разфасовка; пазете го, но не показвайте отделна карта.",
            "readOnly": true,
            "example": true
          },
          "minor": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Базова показвана цена в евроцентове. Проверявайте конкретния размер.",
            "readOnly": true,
            "example": 790
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR"
            ],
            "description": "Валута EUR.",
            "readOnly": true,
            "example": "EUR"
          },
          "available": {
            "type": "boolean",
            "description": "При false забранете поръчването на този продукт.",
            "readOnly": true,
            "example": true
          },
          "available_at": {
            "type": "string",
            "nullable": true,
            "description": "Планирано връщане в наличност или null; не заменя текущото available.",
            "readOnly": true
          },
          "availability_notice": {
            "type": "string",
            "description": "Текст за наличността, ако е зададен.",
            "readOnly": true,
            "example": ""
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Variant"
            },
            "description": "Размерите и съответните цени, съставки и опции.",
            "readOnly": true
          },
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Addon"
            },
            "description": "Допустими добавки. Цената за избрания размер е във variants[].addons.",
            "readOnly": true
          },
          "bases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Base"
            },
            "description": "Допустими основи за тази пица; празно за неприложими продукти.",
            "readOnly": true
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChoiceGroup"
            },
            "description": "Избори за вкус/разфасовка, водещи към друг product_id.",
            "readOnly": true
          },
          "half_eligible": {
            "type": "boolean",
            "description": "Може да участва в 50/50 при включена функция и размер family.",
            "readOnly": true,
            "example": true
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "category_ids",
          "image",
          "thumbnail",
          "image_illustrative",
          "listed",
          "minor",
          "currency",
          "available",
          "available_at",
          "availability_notice",
          "variants",
          "addons",
          "bases",
          "choices",
          "half_eligible"
        ],
        "additionalProperties": true
      },
      "Variant": {
        "type": "object",
        "description": "Размери",
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "standard",
              "medium",
              "family"
            ],
            "description": "Ключ за selection.size; използвайте само върнат размер.",
            "readOnly": true,
            "example": "medium"
          },
          "label": {
            "type": "string",
            "description": "Човешко име на размера.",
            "readOnly": true,
            "example": "Средна"
          },
          "minor": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Пълна цена на този размер, не доплащане спрямо друг размер.",
            "readOnly": true,
            "example": 790
          },
          "weight_g": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Грамаж или null, когато не е зададен.",
            "readOnly": true,
            "example": 550
          },
          "ingredients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ingredient"
            },
            "description": "Съставки; премахвайте само тези с removable=1.",
            "readOnly": true
          },
          "allergens": {
            "type": "array",
            "maxItems": 14,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 14
            },
            "description": "Числови кодове 1–14; премахване на съставка не гарантира липса на алерген.",
            "readOnly": true,
            "example": [
              1,
              7
            ]
          },
          "crust_selectable": {
            "type": "boolean",
            "description": "Разрешен ли е изборът на борд.",
            "readOnly": true,
            "example": true
          },
          "crust_included": {
            "type": "boolean",
            "description": "Борд по рецепта; използвайте като начална стойност на crust.",
            "readOnly": true,
            "example": false
          },
          "crust_extra_minor": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Доплащане при добавяне на борд; null не означава безплатно.",
            "readOnly": true,
            "example": 250
          },
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Addon"
            },
            "description": "Добавки с изчислена цена за този размер.",
            "readOnly": true
          }
        },
        "required": [
          "key",
          "label",
          "minor",
          "weight_g",
          "ingredients",
          "allergens",
          "crust_selectable",
          "crust_included",
          "crust_extra_minor",
          "addons"
        ],
        "additionalProperties": true
      },
      "Ingredient": {
        "type": "object",
        "description": "Съставки",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 0,
            "description": "ID за selection.removed[], ако премахването е разрешено.",
            "readOnly": true,
            "example": 17
          },
          "name": {
            "type": "string",
            "description": "Име на съставката.",
            "readOnly": true,
            "example": "Лук"
          },
          "removable": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            ],
            "description": "1/true: може да се премахне; 0/false: не може.",
            "readOnly": true,
            "example": 1
          }
        },
        "required": [
          "id",
          "name",
          "removable"
        ],
        "additionalProperties": true
      },
      "Addon": {
        "type": "object",
        "description": "Сосове и добавки",
        "properties": {
          "code": {
            "type": "string",
            "description": "Изпратете този код в selection.addons[], без повторения.",
            "readOnly": true,
            "example": "garlic_sauce"
          },
          "name": {
            "type": "string",
            "description": "Име на добавката за избрания размер.",
            "readOnly": true,
            "example": "Чеснов сос"
          },
          "group": {
            "type": "string",
            "enum": [
              "sauce",
              "topping"
            ],
            "description": "Група: сос или добавка за пица.",
            "readOnly": true,
            "example": "sauce"
          },
          "enabled": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            ],
            "description": "Флаг за включена дефиниция; каталогът връща разрешените добавки.",
            "readOnly": true,
            "example": 1
          },
          "minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Цена в евроцентове; във variant е за конкретния размер.",
            "readOnly": true,
            "example": 100
          },
          "allergens": {
            "type": "array",
            "maxItems": 14,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 14
            },
            "description": "Алергените на добавката.",
            "readOnly": true,
            "example": [
              7
            ]
          },
          "reviewed": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            ],
            "description": "Потвърдени ли са данните за алергени.",
            "readOnly": true,
            "example": 1
          },
          "family_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Допълнителна метаинформация за семейния размер, ако е налична.",
            "readOnly": true,
            "example": 200
          },
          "weight_g": {
            "type": "integer",
            "minimum": 0,
            "description": "Грамаж на добавката, ако е известен.",
            "readOnly": true,
            "example": 50
          },
          "family_weight_g": {
            "type": "integer",
            "minimum": 0,
            "description": "Грамаж за семейния размер, ако е наличен.",
            "readOnly": true,
            "example": 100
          },
          "family_name": {
            "type": "string",
            "description": "Етикет за семейния размер, ако е наличен.",
            "readOnly": true,
            "example": "Добавка — 100 г"
          }
        },
        "required": [
          "code",
          "name",
          "group",
          "enabled",
          "minor",
          "allergens",
          "reviewed"
        ],
        "additionalProperties": true
      },
      "Base": {
        "type": "object",
        "description": "Основи за пица",
        "properties": {
          "code": {
            "type": "string",
            "description": "Код за selection.base; не е платена добавка.",
            "readOnly": true,
            "example": "tomato"
          },
          "name": {
            "type": "string",
            "description": "Име за показване.",
            "readOnly": true,
            "example": "Доматено пюре"
          },
          "enabled": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            ],
            "description": "Флаг на дефиницията; липсва в някои нормализирани отговори за цена.",
            "readOnly": true,
            "example": 1
          },
          "default": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            ],
            "description": "Основата по подразбиране; избира се при пропуснат base.",
            "readOnly": true,
            "example": 1
          },
          "minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Основите са включени; стойността е 0.",
            "readOnly": true,
            "example": 0
          },
          "allergens": {
            "type": "array",
            "maxItems": 14,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 14
            },
            "description": "Алергенни кодове за основата.",
            "readOnly": true
          },
          "reviewed": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            ],
            "description": "Потвърдени ли са алергенните данни.",
            "readOnly": true,
            "example": 1
          }
        },
        "required": [
          "code",
          "name",
          "default",
          "minor",
          "allergens",
          "reviewed"
        ],
        "additionalProperties": true
      },
      "ChoiceGroup": {
        "type": "object",
        "description": "Вкус и разфасовка",
        "properties": {
          "label": {
            "type": "string",
            "description": "Заглавие на групата за избор.",
            "readOnly": true,
            "example": "Избери вкус"
          },
          "show_price": {
            "type": "boolean",
            "description": "Дали интерфейсът да показва цената до избора.",
            "readOnly": true,
            "example": true
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChoiceOption"
            },
            "description": "Варианти, всеки с отделен product_id.",
            "readOnly": true
          }
        },
        "required": [
          "label",
          "show_price",
          "options"
        ],
        "additionalProperties": true
      },
      "ChoiceOption": {
        "type": "object",
        "description": "Опция за вкус/разфасовка",
        "properties": {
          "product_id": {
            "type": "integer",
            "minimum": 0,
            "description": "След избора заредете този продукт и неговите размери/добавки.",
            "readOnly": true,
            "example": 124
          },
          "label": {
            "type": "string",
            "description": "Текст на избора.",
            "readOnly": true,
            "example": "Без захар"
          },
          "minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Самостоятелна цена на целевия продукт.",
            "readOnly": true,
            "example": 200
          },
          "current": {
            "type": "boolean",
            "description": "Тази опция ли е текущият продукт.",
            "readOnly": true,
            "example": false
          }
        },
        "required": [
          "product_id",
          "label",
          "minor",
          "current"
        ],
        "additionalProperties": true
      },
      "Combo": {
        "type": "object",
        "description": "Комбо предложения",
        "properties": {
          "code": {
            "type": "string",
            "description": "Постоянен код за selection.combo_code.",
            "readOnly": true,
            "example": "combo-example"
          },
          "revision": {
            "type": "string",
            "description": "Копирайте точно в combo_revision; не генерирайте своя стойност.",
            "readOnly": true,
            "example": "<revision-from-catalogue>"
          },
          "name": {
            "type": "string",
            "description": "Публично име.",
            "readOnly": true,
            "example": "Комбо предложение"
          },
          "description": {
            "type": "string",
            "description": "Кратко описание.",
            "readOnly": true,
            "example": "Пица и напитка"
          },
          "image": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "HTTPS снимка или null.",
            "readOnly": true
          },
          "minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Цена на конфигурацията по подразбиране; опции може да добавят доплащане.",
            "readOnly": true,
            "example": 1490
          },
          "available": {
            "type": "boolean",
            "description": "Текуща достъпност; сървърът проверява отново при поръчка.",
            "readOnly": true,
            "example": true
          },
          "schedule": {
            "type": "string",
            "description": "Човешко описание, не машинно разрешение за поръчка.",
            "readOnly": true,
            "example": "Всеки ден · през работното време"
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComboSlot"
            },
            "description": "Подредени позиции; запазете броя и реда.",
            "readOnly": true
          },
          "default_selection": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Selection"
              }
            ],
            "description": "Готов selection за заявка; променяйте само разрешените опции.",
            "readOnly": true
          }
        },
        "required": [
          "code",
          "revision",
          "name",
          "description",
          "image",
          "minor",
          "available",
          "schedule",
          "slots",
          "default_selection"
        ],
        "additionalProperties": true
      },
      "ComboSlot": {
        "type": "object",
        "description": "Позиции в комбо",
        "properties": {
          "product_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Допустими продукти за тази позиция; не използвайте други ID.",
            "readOnly": true,
            "example": [
              123,
              124
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "standard",
              "medium",
              "family"
            ],
            "description": "Задължителен размер за позицията; не може да се сменя.",
            "readOnly": true,
            "example": "medium"
          }
        },
        "required": [
          "product_ids",
          "size"
        ],
        "additionalProperties": true
      },
      "HalfSettings": {
        "type": "object",
        "description": "Настройки 50/50",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Ако false, не предлагайте билдера 50/50.",
            "readOnly": true,
            "example": true
          },
          "size": {
            "type": "string",
            "enum": [
              "family"
            ],
            "description": "50/50 е само семейна пица.",
            "readOnly": true,
            "example": "family"
          },
          "price_mode": {
            "type": "string",
            "enum": [
              "higher",
              "average",
              "fixed",
              "unset"
            ],
            "description": "Метод за цена; винаги вземайте окончателната сума от /quote.",
            "readOnly": true,
            "example": "higher"
          },
          "fixed_minor": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Фиксирана цена при mode=fixed; null не означава 0.",
            "readOnly": true
          }
        },
        "required": [
          "enabled",
          "size",
          "price_mode",
          "fixed_minor"
        ],
        "additionalProperties": true
      },
      "Availability": {
        "type": "object",
        "description": "Получаване и работно време",
        "properties": {
          "currency": {
            "type": "string",
            "enum": [
              "EUR"
            ],
            "description": "Валута на сумите.",
            "readOnly": true,
            "example": "EUR"
          },
          "timezone": {
            "type": "string",
            "description": "Местна часова зона за графиците.",
            "readOnly": true,
            "example": "Europe/Sofia"
          },
          "payment_methods": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "За тази версия се връща само cash.",
            "readOnly": true,
            "example": [
              "cash"
            ]
          },
          "ordering_enabled": {
            "type": "boolean",
            "description": "Общ и партньорски прием; не гарантира, че дадена зона е отворена.",
            "readOnly": true,
            "example": true
          },
          "zones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Zone"
            },
            "description": "Зони за доставка. Числата може да са JSON числа или цифрови низове.",
            "readOnly": true
          },
          "pickup": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pickup"
              }
            ],
            "description": "Информация за вземане от ресторанта.",
            "readOnly": true
          },
          "notice": {
            "type": "string",
            "description": "Напомняне да се ползва /quote за окончателните правила.",
            "readOnly": true,
            "example": "Use POST /quote for authoritative current eligibility, fees and minimums."
          }
        },
        "required": [
          "currency",
          "timezone",
          "payment_methods",
          "ordering_enabled",
          "zones",
          "pickup",
          "notice"
        ],
        "additionalProperties": true
      },
      "Zone": {
        "type": "object",
        "description": "Зони за доставка",
        "properties": {
          "id": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            ],
            "description": "ID за choice.zone_id; изпращайте като цяло число.",
            "readOnly": true,
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "Име на обслужваното място.",
            "readOnly": true,
            "example": "Велинград"
          },
          "enabled": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            ],
            "description": "1: включена зона; 0: изключена.",
            "readOnly": true,
            "example": 1
          },
          "days_mask": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            ],
            "description": "Битова маска: понеделник=1, вторник=2, … неделя=64; 127=всеки ден.",
            "readOnly": true,
            "example": 127
          },
          "acceptance_opens": {
            "type": "string",
            "description": "Обичаен начален час, HH:MM, Europe/Sofia.",
            "readOnly": true,
            "example": "09:00"
          },
          "acceptance_cutoff": {
            "type": "string",
            "description": "Обичаен краен час; късни правила/почивни дни се проверяват чрез /quote.",
            "readOnly": true,
            "example": "22:00"
          },
          "delivery_fee_minor": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            ],
            "description": "Обичайна такса или null; точната такса идва от /quote.",
            "readOnly": true,
            "example": 0
          },
          "minimum_order_minor": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            ],
            "description": "Обичаен минимум или null, ако не е конфигуриран.",
            "readOnly": true,
            "example": 0
          },
          "free_delivery_over_minor": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0,
                "nullable": true
              },
              {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            ],
            "description": "Праг за безплатна доставка или null, ако няма такъв.",
            "readOnly": true
          }
        },
        "required": [
          "id",
          "name",
          "enabled",
          "days_mask",
          "acceptance_opens",
          "acceptance_cutoff",
          "delivery_fee_minor",
          "minimum_order_minor",
          "free_delivery_over_minor"
        ],
        "additionalProperties": true
      },
      "Pickup": {
        "type": "object",
        "description": "Вземане от място",
        "properties": {
          "location_id": {
            "type": "string",
            "enum": [
              "main"
            ],
            "description": "Използвайте main в choice.location_id.",
            "readOnly": true,
            "example": "main"
          },
          "name": {
            "type": "string",
            "description": "Име на обекта.",
            "readOnly": true,
            "example": "Pizza Fashion"
          },
          "address": {
            "type": "string",
            "description": "Адрес за получаване.",
            "readOnly": true,
            "example": "Велинград, адрес на обекта"
          },
          "opens": {
            "type": "string",
            "description": "Обичаен начален час.",
            "readOnly": true,
            "example": "09:00"
          },
          "cutoff": {
            "type": "string",
            "description": "Обичаен краен час.",
            "readOnly": true,
            "example": "22:00"
          },
          "days": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                }
              ]
            },
            "description": "ISO дни: 1=понеделник, 7=неделя; стойностите може да са низове.",
            "readOnly": true,
            "example": [
              1,
              2,
              3,
              4,
              5,
              6,
              7
            ]
          }
        },
        "required": [
          "location_id",
          "name",
          "address",
          "opens",
          "cutoff",
          "days"
        ],
        "additionalProperties": true
      },
      "OrderRequest": {
        "type": "object",
        "description": "Наливане на поръчка към Pizza Fashion",
        "properties": {
          "external_order_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,79}$",
            "description": "Ваш постоянен уникален номер, 1–80 ASCII букви/цифри и _ . : -; започва с буква/цифра. Пазете при повторен опит.",
            "example": "ONEBITE-2026-10001"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Line"
            },
            "description": "1–40 позиции; същите като при подписаната оферта.",
            "minItems": 1,
            "maxItems": 40
          },
          "choice": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ReceiptChoice"
              }
            ],
            "description": "Начин на получаване и плащане; същият като в /quote."
          },
          "customer": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Customer"
              }
            ],
            "description": "Данни за изпълнение на тази поръчка; не създават Club профил."
          },
          "expected_total_minor": {
            "type": "integer",
            "minimum": 1,
            "description": "Точно quote.total_minor като JSON integer; не е ръчно задаване на цена.",
            "example": 790
          },
          "quote_token": {
            "type": "string",
            "description": "Непроменен токен от /quote; първото изпращане трябва да е до 15 минути.",
            "example": "<quote_token-from-matching-quote>"
          }
        },
        "required": [
          "external_order_id",
          "items",
          "choice",
          "customer",
          "expected_total_minor",
          "quote_token"
        ],
        "additionalProperties": false
      },
      "QuoteRequest": {
        "type": "object",
        "description": "Заявка за точна цена",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Line"
            },
            "description": "1–40 позиции с избори; цени не се изпращат.",
            "minItems": 1,
            "maxItems": 40
          },
          "choice": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ReceiptChoice"
              }
            ],
            "description": "Начин на получаване и cash плащане."
          }
        },
        "required": [
          "items",
          "choice"
        ],
        "additionalProperties": false
      },
      "Line": {
        "type": "object",
        "description": "Позиция в поръчката",
        "properties": {
          "selection": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Selection"
              }
            ],
            "description": "Избор на продукт, 50/50 или комбо."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "default": 1,
            "description": "Количество 1–20; по подразбиране 1.",
            "example": 1
          }
        },
        "required": [
          "selection"
        ],
        "additionalProperties": false
      },
      "Selection": {
        "type": "object",
        "description": "Конфигуриране на продукт",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "product",
              "half",
              "combo"
            ],
            "description": "Вид избор; по подразбиране product. За 50/50 и комбо го задайте изрично.",
            "example": "product"
          },
          "product_id": {
            "type": "integer",
            "minimum": 1,
            "description": "ID от каталога; за нормален продукт или за вложена половина/комбо позиция. [product]",
            "example": 123
          },
          "size": {
            "type": "string",
            "enum": [
              "standard",
              "medium",
              "family"
            ],
            "description": "Размер от variants[].key. В комбо запазете размера на позицията; за 50/50 е family. [product]",
            "example": "medium"
          },
          "removed": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "До 100 уникални ID от ingredients с removable=1; по подразбиране [].",
            "example": [
              17
            ],
            "maxItems": 100,
            "uniqueItems": true,
            "default": []
          },
          "crust": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            ],
            "description": "Избор на борд: 0/1 или false/true. Инициализирайте от crust_included; сменяйте само ако selectable.",
            "example": 0
          },
          "addons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "До 40 различни кода за този продукт/размер; не на общото ниво на 50/50.",
            "example": [
              "garlic_sauce"
            ],
            "maxItems": 40,
            "uniqueItems": true,
            "default": []
          },
          "base": {
            "type": "string",
            "description": "Един код от product.bases; при пропуск се взема default. За 50/50 е на общото ниво.",
            "example": "tomato"
          },
          "halves": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Selection"
            },
            "description": "Точно две половини с product_id, size=family и removed. Бордът на половините следва рецептата; добавки не се конфигурират тук. [half]",
            "minItems": 2,
            "maxItems": 2
          },
          "combo_code": {
            "type": "string",
            "description": "Точният code от combos[]. [combo]",
            "example": "combo-example"
          },
          "combo_revision": {
            "type": "string",
            "description": "Изпратете върнатата revision, за да засечете променен състав/цена. [combo]",
            "example": "<revision-from-catalogue>"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Selection"
            },
            "description": "Подредени позиции от default_selection.items; точно една за всеки slot. Без quantity в тях. [combo]",
            "minItems": 2,
            "maxItems": 12
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "ReceiptChoice": {
        "type": "object",
        "description": "Доставка, вземане и плащане",
        "properties": {
          "fulfilment": {
            "type": "string",
            "enum": [
              "delivery",
              "pickup"
            ],
            "description": "Изпращайте изрично delivery или pickup.",
            "example": "delivery"
          },
          "zone_id": {
            "type": "integer",
            "minimum": 1,
            "description": "ID от /availability.zones за delivery. [delivery]",
            "example": 1
          },
          "location_id": {
            "type": "string",
            "enum": [
              "main"
            ],
            "description": "За pickup използвайте main; не сменяйте зона с друг начин за по-ниска цена. [pickup]",
            "example": "main"
          },
          "payment": {
            "type": "string",
            "enum": [
              "cash"
            ],
            "description": "Само плащане в брой при доставка/вземане; няма онлайн плащане или такса за обработка.",
            "example": "cash"
          }
        },
        "required": [
          "fulfilment",
          "payment"
        ],
        "additionalProperties": false
      },
      "Customer": {
        "type": "object",
        "description": "Контакти за изпълнение",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "description": "Истинско име, до 100 знака, обикновен текст.",
            "example": "Име на клиента"
          },
          "phone": {
            "type": "string",
            "maxLength": 80,
            "description": "Пълен валиден телефон, препоръчително E.164. Български мобилен: 10 цифри с начална 0 или +359 и 9 цифри; непълни номера се отхвърлят.",
            "example": "0888123456"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 190,
            "description": "Валиден имейл; задължителен, ако ресторантът го изисква. Изпращайте реалния адрес при наличност. [email]",
            "example": "customer@example.com"
          },
          "address": {
            "type": "string",
            "maxLength": 240,
            "description": "При delivery: улица, номер и нужните уточнения, до 240 знака. При pickup не се използва. [delivery]",
            "example": "Улица Примерна 10, вход А"
          },
          "note": {
            "type": "string",
            "maxLength": 500,
            "description": "Бележка до 500 знака; може да бъде изключена от ресторанта. Без HTML или нови редове.",
            "example": "Звънец 3"
          }
        },
        "required": [
          "name",
          "phone"
        ],
        "additionalProperties": false
      },
      "StatusRequest": {
        "type": "object",
        "description": "Заявка за собствен статус",
        "properties": {
          "external_order_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,79}$",
            "description": "Същият номер, с който този партньор е изпратил поръчката.",
            "example": "ONEBITE-2026-10001"
          }
        },
        "required": [
          "external_order_id"
        ],
        "additionalProperties": false
      },
      "OrderStatus": {
        "type": "object",
        "description": "Отговор след поръчка / статус",
        "properties": {
          "external_order_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,79}$",
            "description": "Вашият номер на поръчката.",
            "readOnly": true,
            "example": "ONEBITE-2026-10001"
          },
          "order_number": {
            "type": "string",
            "description": "Номерът, генериран от Pizza Fashion; не го изпращайте като собствен ID.",
            "readOnly": true,
            "example": "PF-A2000"
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "preparing",
              "sent",
              "delivered",
              "cancelled",
              "payment_review"
            ],
            "description": "Машинен статус за интеграцията; значенията са описани отделно.",
            "readOnly": true,
            "example": "accepted"
          },
          "status_label": {
            "type": "string",
            "description": "Етикет от ресторанта; може да е на български независимо от езика на документацията.",
            "readOnly": true,
            "example": "Приета"
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR"
            ],
            "description": "Валута на поръчката.",
            "readOnly": true,
            "example": "EUR"
          },
          "total_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Записана крайна сума, включително доставка.",
            "readOnly": true,
            "example": 790
          },
          "payment": {
            "type": "string",
            "enum": [
              "cash"
            ],
            "description": "Начинът на плащане е cash.",
            "readOnly": true,
            "example": "cash"
          },
          "paid": {
            "type": "boolean",
            "description": "Флаг за отчетено плащане. При нова поръчка в брой false е нормално.",
            "readOnly": true,
            "example": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC време на създаване.",
            "readOnly": true,
            "example": "2026-10-18T12:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC време на последна промяна.",
            "readOnly": true,
            "example": "2026-10-18T12:05:00Z"
          },
          "replayed": {
            "type": "boolean",
            "description": "Само от /orders: true означава повторен отговор за същата поръчка, не нова поръчка.",
            "readOnly": true,
            "example": false
          }
        },
        "required": [
          "external_order_id",
          "order_number",
          "status",
          "status_label",
          "currency",
          "total_minor",
          "payment",
          "paid",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": true
      },
      "QuoteResponse": {
        "type": "object",
        "description": "Отговор на офертата",
        "properties": {
          "quote": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Quote"
              }
            ],
            "description": "Авторитетна ценова разбивка; не изпращайте целия обект като поръчка.",
            "readOnly": true
          },
          "quote_token": {
            "type": "string",
            "description": "Запазете и изпратете с оригиналните items/choice в /orders.",
            "readOnly": true,
            "example": "<signed-token>"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Краен срок за първо изпращане на офертата, около 15 минути.",
            "readOnly": true,
            "example": "2026-10-18T12:15:00+00:00"
          }
        },
        "required": [
          "quote",
          "quote_token",
          "expires_at"
        ],
        "additionalProperties": true
      },
      "Quote": {
        "type": "object",
        "description": "Крайни суми и правила",
        "properties": {
          "schema": {
            "type": "integer",
            "minimum": 0,
            "description": "Версия на ценовата структура.",
            "readOnly": true,
            "example": 1
          },
          "test_only": {
            "type": "boolean",
            "description": "При true не може да се подаде реална партньорска поръчка.",
            "readOnly": true,
            "example": false
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR"
            ],
            "description": "Всички суми са в евроцентове.",
            "readOnly": true,
            "example": "EUR"
          },
          "choice": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QuoteChoice"
              }
            ],
            "description": "Нормализиран избор за показване; за /orders запазете оригиналната заявка choice.",
            "readOnly": true
          },
          "location": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QuoteLocation"
              }
            ],
            "description": "Зона за доставка или обект за вземане.",
            "readOnly": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuotedLine"
            },
            "description": "Конфигурирани позиции и ценови разбивки.",
            "readOnly": true
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "description": "Сбор на количествата, не брой редове.",
            "readOnly": true,
            "example": 2
          },
          "subtotal_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Сума на продуктите преди общи отстъпки и доставка.",
            "readOnly": true,
            "example": 1580
          },
          "delivery_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Авторитетна такса за избраното получаване.",
            "readOnly": true,
            "example": 0
          },
          "total_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Крайна сума за показване и expected_total_minor.",
            "readOnly": true,
            "example": 1580
          },
          "minimum_minor": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Приложим минимум за поръчка.",
            "readOnly": true,
            "example": 0
          },
          "minimum_exclusive": {
            "type": "boolean",
            "description": "true: сумата трябва да е строго над минимума.",
            "readOnly": true,
            "example": false
          },
          "minimum_includes_delivery": {
            "type": "boolean",
            "description": "Дали минимумът включва доставката.",
            "readOnly": true,
            "example": false
          },
          "period": {
            "type": "string",
            "enum": [
              "regular",
              "late",
              "pickup"
            ],
            "description": "Вид приложен времеви режим.",
            "readOnly": true,
            "example": "pickup"
          },
          "schedule_ready": {
            "type": "boolean",
            "description": "Разрешено ли е изпращане според текущите правила.",
            "readOnly": true,
            "example": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Предупреждения за показване.",
            "readOnly": true
          },
          "discount_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Обща промо отстъпка; API не приема промокод и обичайно е 0.",
            "readOnly": true,
            "example": 0
          },
          "discount_code": {
            "type": "string",
            "description": "Промокод; за този API е празен.",
            "readOnly": true,
            "example": ""
          },
          "online_discount_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Отстъпка за онлайн плащане; при cash е 0.",
            "readOnly": true,
            "example": 0
          },
          "online_discount_basis_points": {
            "type": "integer",
            "minimum": 0,
            "description": "Базисни точки на онлайн отстъпка; при cash е 0.",
            "readOnly": true,
            "example": 0
          },
          "delivery_net_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Доставка без включения ДДС.",
            "readOnly": true,
            "example": 0
          },
          "delivery_tax_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Включен ДДС върху доставката.",
            "readOnly": true,
            "example": 0
          },
          "net_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Обща нетна сума; не се добавя повторно към total.",
            "readOnly": true,
            "example": 1317
          },
          "tax_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Общ включен ДДС; не е допълнителна такса.",
            "readOnly": true,
            "example": 263
          },
          "vat_percent": {
            "type": "integer",
            "minimum": 0,
            "description": "Приложим процент ДДС от настройките, не твърдо зададена политика.",
            "readOnly": true,
            "example": 20
          }
        },
        "required": [
          "schema",
          "test_only",
          "currency",
          "choice",
          "location",
          "items",
          "count",
          "subtotal_minor",
          "delivery_minor",
          "total_minor",
          "minimum_minor",
          "minimum_exclusive",
          "minimum_includes_delivery",
          "period",
          "schedule_ready",
          "warnings",
          "discount_minor",
          "discount_code",
          "online_discount_minor",
          "online_discount_basis_points",
          "delivery_net_minor",
          "delivery_tax_minor",
          "net_minor",
          "tax_minor",
          "vat_percent"
        ],
        "additionalProperties": true
      },
      "QuoteChoice": {
        "type": "object",
        "description": "Нормализиран избор в отговора",
        "properties": {
          "fulfilment": {
            "type": "string",
            "enum": [
              "delivery",
              "pickup"
            ],
            "description": "Потвърден начин на получаване.",
            "readOnly": true,
            "example": "pickup"
          },
          "zone_id": {
            "type": "integer",
            "minimum": 0,
            "description": "Зона при delivery; 0 при pickup.",
            "readOnly": true,
            "example": 0
          },
          "location_id": {
            "type": "string",
            "description": "main при pickup; празен низ при delivery.",
            "readOnly": true,
            "example": "main"
          },
          "payment": {
            "type": "string",
            "enum": [
              "cash"
            ],
            "description": "Потвърден cash начин на плащане.",
            "readOnly": true,
            "example": "cash"
          }
        },
        "required": [
          "fulfilment",
          "zone_id",
          "location_id",
          "payment"
        ],
        "additionalProperties": true
      },
      "QuoteLocation": {
        "type": "object",
        "description": "Място в офертата",
        "properties": {
          "id": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "enum": [
                  "main"
                ]
              }
            ],
            "description": "ID на зона (число) или main за pickup.",
            "readOnly": true,
            "example": "main"
          },
          "name": {
            "type": "string",
            "description": "Име на обекта/зоната.",
            "readOnly": true,
            "example": "Pizza Fashion"
          },
          "address": {
            "type": "string",
            "description": "Адрес на обекта при pickup; празно за зона.",
            "readOnly": true,
            "example": "Велинград, адрес на обекта"
          },
          "opens": {
            "type": "string",
            "description": "Обичаен начален час.",
            "readOnly": true,
            "example": "09:00"
          },
          "cutoff": {
            "type": "string",
            "description": "Обичаен краен час.",
            "readOnly": true,
            "example": "22:00"
          }
        },
        "required": [
          "id",
          "name",
          "address",
          "opens",
          "cutoff"
        ],
        "additionalProperties": true
      },
      "QuotedLine": {
        "type": "object",
        "description": "Изчислена позиция",
        "properties": {
          "key": {
            "type": "string",
            "description": "Вътрешен ключ на ценовия ред; не е product_id и не се изпраща обратно.",
            "readOnly": true,
            "example": "<server-line-key>"
          },
          "name": {
            "type": "string",
            "description": "Готово име с конфигурацията.",
            "readOnly": true,
            "example": "Пица Чикън — Средна"
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "description": "Количество.",
            "readOnly": true,
            "example": 1
          },
          "unit_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Цена за един конфигуриран брой.",
            "readOnly": true,
            "example": 790
          },
          "subtotal_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "unit_minor × quantity преди общи отстъпки.",
            "readOnly": true,
            "example": 790
          },
          "configuration": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Configuration"
              }
            ],
            "description": "Пълна изчислена конфигурация; само за четене.",
            "readOnly": true
          },
          "discount_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Разпределена отстъпка за реда.",
            "readOnly": true,
            "example": 0
          },
          "gross_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Ред след отстъпката, с включен ДДС.",
            "readOnly": true,
            "example": 790
          },
          "net_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Ред без включения ДДС.",
            "readOnly": true,
            "example": 658
          },
          "tax_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Включен ДДС за реда.",
            "readOnly": true,
            "example": 132
          }
        },
        "required": [
          "key",
          "name",
          "quantity",
          "unit_minor",
          "subtotal_minor",
          "configuration",
          "discount_minor",
          "gross_minor",
          "net_minor",
          "tax_minor"
        ],
        "additionalProperties": true
      },
      "Configuration": {
        "type": "object",
        "description": "Изчислен продукт / комбо",
        "properties": {
          "schema": {
            "type": "integer",
            "minimum": 0,
            "description": "Версия на конфигурацията.",
            "readOnly": true,
            "example": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "product",
              "half",
              "combo"
            ],
            "description": "Вид на конфигурираната позиция.",
            "readOnly": true,
            "example": "product"
          },
          "name": {
            "type": "string",
            "description": "Име за показване.",
            "readOnly": true,
            "example": "Пица Чикън — Средна"
          },
          "unit_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Крайна единична цена с опциите.",
            "readOnly": true,
            "example": 790
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR"
            ],
            "description": "Валута EUR.",
            "readOnly": true,
            "example": "EUR"
          },
          "weight_g": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Общ грамаж, ако е известен.",
            "readOnly": true,
            "example": 550
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfiguredPart"
            },
            "description": "Един продукт, две половини или позиции в комбо.",
            "readOnly": true
          },
          "allergens": {
            "type": "array",
            "maxItems": 14,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 14
            },
            "description": "Обединени алергенни кодове.",
            "readOnly": true,
            "example": [
              1,
              7
            ]
          },
          "base": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Base"
              }
            ],
            "description": "Нормализирана избрана основа, когато е приложима.",
            "readOnly": true
          },
          "combo_code": {
            "type": "string",
            "description": "Код на комбото.",
            "readOnly": true,
            "example": "combo-example"
          },
          "combo_revision": {
            "type": "string",
            "description": "Приложена ревизия на комбото.",
            "readOnly": true,
            "example": "<revision-from-catalogue>"
          },
          "regular_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Цена на същите продукти поотделно.",
            "readOnly": true,
            "example": 1800
          },
          "combo_savings_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Спестяване от комбо цената.",
            "readOnly": true,
            "example": 270
          },
          "extras_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Доплащания за избраните опции.",
            "readOnly": true,
            "example": 0
          },
          "selection": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Selection"
              }
            ],
            "description": "Нормализиран selection за комбото; оригиналната заявка остава нужна за токена.",
            "readOnly": true
          }
        },
        "required": [
          "schema",
          "type",
          "name",
          "unit_minor",
          "currency",
          "weight_g",
          "parts",
          "allergens"
        ],
        "additionalProperties": true
      },
      "ConfiguredPart": {
        "type": "object",
        "description": "Детайл на изчислен продукт",
        "properties": {
          "product_id": {
            "type": "integer",
            "minimum": 0,
            "description": "ID на продукта.",
            "readOnly": true,
            "example": 123
          },
          "name": {
            "type": "string",
            "description": "Име на продукта/позицията.",
            "readOnly": true,
            "example": "Пица Чикън"
          },
          "size": {
            "type": "string",
            "enum": [
              "standard",
              "medium",
              "family"
            ],
            "description": "Избран размер.",
            "readOnly": true,
            "example": "medium"
          },
          "recipe_revision": {
            "type": "integer",
            "minimum": 0,
            "description": "Ревизия на рецептата; само за четене.",
            "readOnly": true,
            "example": 3
          },
          "weight_g": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Грамаж или null.",
            "readOnly": true,
            "example": 550
          },
          "portion": {
            "type": "string",
            "description": "Етикет за порцията, ако е зададен.",
            "readOnly": true,
            "example": ""
          },
          "ingredients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ingredient"
            },
            "description": "Състав по рецептата.",
            "readOnly": true
          },
          "omitted": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OmittedIngredient"
            },
            "description": "Премахнати съставки.",
            "readOnly": true
          },
          "allergens": {
            "type": "array",
            "maxItems": 14,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 14
            },
            "description": "Алергенни кодове; не се премахват автоматично с компонент.",
            "readOnly": true,
            "example": [
              1,
              7
            ]
          },
          "allergens_reviewed": {
            "type": "boolean",
            "description": "Потвърдени ли са алергенните данни.",
            "readOnly": true,
            "example": true
          },
          "composition_complete": {
            "type": "boolean",
            "description": "Пълен ли е записаният състав.",
            "readOnly": true,
            "example": true
          },
          "crust": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            ],
            "description": "Действително избран борд.",
            "readOnly": true,
            "example": 0
          },
          "crust_included": {
            "type": "boolean",
            "description": "Включен ли е борд по рецепта.",
            "readOnly": true,
            "example": false
          },
          "crust_extra_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Действително начислено доплащане за борд.",
            "readOnly": true,
            "example": 0
          },
          "base_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Базова цена на продукта/размера.",
            "readOnly": true,
            "example": 790
          },
          "unit_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Единична цена на тази част. При 50/50 не я сумирайте самостоятелно.",
            "readOnly": true,
            "example": 790
          },
          "half_eligible": {
            "type": "boolean",
            "description": "Допустимост за 50/50.",
            "readOnly": true,
            "example": true
          },
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Addon"
            },
            "description": "Избрани добавки за продукт/комбо част; липсва при половини.",
            "readOnly": true
          },
          "addons_extra_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Сбор доплащания за добавки.",
            "readOnly": true,
            "example": 0
          },
          "size_extra_minor": {
            "type": "integer",
            "minimum": 0,
            "description": "Информационно доплащане за размер; вече е в цената.",
            "readOnly": true,
            "example": 0
          }
        },
        "required": [
          "product_id",
          "name",
          "size",
          "recipe_revision",
          "weight_g",
          "portion",
          "ingredients",
          "omitted",
          "allergens",
          "allergens_reviewed",
          "composition_complete",
          "crust",
          "crust_included",
          "crust_extra_minor",
          "base_minor",
          "unit_minor",
          "half_eligible"
        ],
        "additionalProperties": true
      },
      "OmittedIngredient": {
        "type": "object",
        "description": "Премахната съставка",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 0,
            "description": "ID на премахнатата съставка.",
            "readOnly": true,
            "example": 17
          },
          "name": {
            "type": "string",
            "description": "Име на премахнатата съставка.",
            "readOnly": true,
            "example": "Лук"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": true
      },
      "ApiError": {
        "type": "object",
        "description": "Грешка от API контролера",
        "properties": {
          "status": {
            "type": "integer",
            "minimum": 0,
            "description": "HTTP статус на грешката.",
            "readOnly": true,
            "example": 422
          },
          "message": {
            "type": "string",
            "description": "Обяснение; някои бизнес грешки са на български. Следете кода, не сравнявайте текстове.",
            "readOnly": true,
            "example": "Invalid request"
          }
        },
        "required": [
          "status",
          "message"
        ],
        "additionalProperties": true
      },
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "properties": {
              "error": {
                "$ref": "#/components/schemas/ApiError"
              }
            },
            "required": [
              "error"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "meta"
        ],
        "additionalProperties": true
      }
    }
  }
}
