{
    "openapi": "3.1.2",
    "info": {
        "title": "Enotale REST API",
        "version": "1.0.0",
        "description": "Wine catalog (public) and the signed-in buyer's account, cart and orders. Money is integer euro cents with a formatted string. Wines are bought in packs; delivery is charged per winery. Human documentation: https://enotale.bg/docs/api. Purchase rules for agents: https://enotale.bg/docs/pravila."
    },
    "servers": [
        {
            "url": "https://enotale.bg/api/v1"
        }
    ],
    "paths": {
        "/me": {
            "get": {
                "operationId": "get-me",
                "tags": [
                    "Account"
                ],
                "summary": "The signed-in buyer",
                "description": "Identity, saved cards (`saved_cards[].id` is the `card_token_id` for an order) and `api_purchasing`: whether this buyer may grant the purchase right and what the presented credential may do. A 401 carries `WWW-Authenticate` with the RFC 9728 `resource_metadata` address where OAuth is enabled.",
                "security": [
                    {
                        "bearerAuth": []
                    },
                    {
                        "oauth2": [
                            "read"
                        ]
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The buyer.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Me"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid credential. The `WWW-Authenticate` header names the protected-resource metadata where OAuth is enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The credential lacks the scope, the buyer has no right for this action, or the buyer is blocked from API access.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/addresses": {
            "get": {
                "operationId": "get-me-addresses",
                "tags": [
                    "Account"
                ],
                "summary": "The buyer's address book",
                "description": "`id` is the `user_address_id` for an order.",
                "security": [
                    {
                        "bearerAuth": []
                    },
                    {
                        "oauth2": [
                            "read"
                        ]
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The saved addresses.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Address"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid credential. The `WWW-Authenticate` header names the protected-resource metadata where OAuth is enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The credential lacks the scope, the buyer has no right for this action, or the buyer is blocked from API access.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/cart": {
            "get": {
                "operationId": "get-me-cart",
                "tags": [
                    "Cart"
                ],
                "summary": "The cart",
                "description": "Groups by winery. `checkout_url` is where the buyer pays on the site; hand it over when the credential cannot place orders.",
                "security": [
                    {
                        "bearerAuth": []
                    },
                    {
                        "oauth2": [
                            "read"
                        ]
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The cart.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Cart"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid credential. The `WWW-Authenticate` header names the protected-resource metadata where OAuth is enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The credential lacks the scope, the buyer has no right for this action, or the buyer is blocked from API access.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/cart/items": {
            "post": {
                "operationId": "post-me-cart-items",
                "tags": [
                    "Cart"
                ],
                "summary": "Add a pack to the cart",
                "description": "Send `pack_id` (a bottle pack from a wine response) or `tasting_pack_id`, with an optional `count` (1 to 99, default 1). The quantity rules of the storefront apply, so a wine below its minimum number of bottles is refused with 422. Closed with online sales: 503.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "pack_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "A bottle pack: `active_vintage.packs[].id` from `GET /wines/{slug}`. Required unless `tasting_pack_id` is sent."
                                    },
                                    "tasting_pack_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "A tasting pack id. Required unless `pack_id` is sent."
                                    },
                                    "count": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 1,
                                        "maximum": 99,
                                        "description": "How many of the pack to add (1 to 99). Default 1."
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    },
                    {
                        "oauth2": [
                            "read"
                        ]
                    }
                ],
                "responses": {
                    "201": {
                        "description": "The cart after the change.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Cart"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; `errors` maps each field to its messages.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid credential. The `WWW-Authenticate` header names the protected-resource metadata where OAuth is enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The credential lacks the scope, the buyer has no right for this action, or the buyer is blocked from API access.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API surface is switched off, or online sales are closed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/cart/items/{item}": {
            "delete": {
                "operationId": "delete-me-cart-items-item",
                "tags": [
                    "Cart"
                ],
                "summary": "Remove a cart line",
                "description": "Idempotent. Closed with online sales: 503.",
                "parameters": [
                    {
                        "name": "item",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "The `item_id` of a cart line."
                    }
                ],
                "security": [
                    {
                        "bearerAuth": []
                    },
                    {
                        "oauth2": [
                            "read"
                        ]
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The cart after the change.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Cart"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid credential. The `WWW-Authenticate` header names the protected-resource metadata where OAuth is enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The credential lacks the scope, the buyer has no right for this action, or the buyer is blocked from API access.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API surface is switched off, or online sales are closed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/orders": {
            "get": {
                "operationId": "get-me-orders",
                "tags": [
                    "Orders"
                ],
                "summary": "Order history",
                "description": "Newest first, 10 per page. Orders still awaiting payment on the site are not listed.",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "1-based page number.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "security": [
                    {
                        "bearerAuth": []
                    },
                    {
                        "oauth2": [
                            "read"
                        ]
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of orders.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/OrderSummary"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "description": "Pagination links: first, last, prev, next (null at the ends).",
                                            "additionalProperties": true
                                        },
                                        "meta": {
                                            "type": "object",
                                            "description": "Pagination meta: current_page, per_page, last_page, total, from, to, path, links.",
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid credential. The `WWW-Authenticate` header names the protected-resource metadata where OAuth is enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The credential lacks the scope, the buyer has no right for this action, or the buyer is blocked from API access.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "post-me-orders",
                "tags": [
                    "Orders"
                ],
                "summary": "Place the cart as an order (two phases)",
                "description": "Needs the `orders:place` scope. Phase 1: send the delivery data without `confirmation_code`; the answer is 200 with a summary and a one-time code, and nothing is created. Show the summary to the buyer and wait for an explicit yes. Phase 2: send the same body plus the value of `confirmation.code` as `confirmation_code`. 202: the order exists and the saved card is being charged; read `payment.status` on the order afterwards. 201: the order exists but was NOT charged (the total is above the credential's cap, or the card could not be used); give the buyer `placement.pay_url`. 200 with a new summary and code: the cart, a price, the address or the total changed since phase 1; confirm again. Delivery: send `user_address_id`, or `recipient_name`, `phone` and `city` with either `street` and `postcode` or `speedy_office_id`. 403 when the credential cannot place orders (the message says what the buyer must do) or the buyer has not accepted the current terms.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "confirmation_code": {
                                        "type": "string",
                                        "description": "Absent in phase 1. In phase 2: the code from the phase-1 answer."
                                    },
                                    "user_address_id": {
                                        "type": "integer",
                                        "description": "A saved address from `/me/addresses`. Replaces the manual delivery fields."
                                    },
                                    "recipient_name": {
                                        "type": "string",
                                        "description": "Required without `user_address_id`.",
                                        "maxLength": 150
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Required without `user_address_id`; a Bulgarian phone number.",
                                        "maxLength": 32
                                    },
                                    "street": {
                                        "type": "string",
                                        "description": "Required without `user_address_id` and `speedy_office_id`.",
                                        "maxLength": 255
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Required without `user_address_id`.",
                                        "maxLength": 100
                                    },
                                    "postcode": {
                                        "type": "string",
                                        "pattern": "^\\d{4}$",
                                        "description": "Four digits. Required without `user_address_id` and `speedy_office_id`."
                                    },
                                    "speedy_site_id": {
                                        "type": "integer",
                                        "description": "Courier city id, for an office pick-up."
                                    },
                                    "speedy_office_id": {
                                        "type": "integer",
                                        "description": "Courier office id; replaces `street` and `postcode`."
                                    },
                                    "card_token_id": {
                                        "type": "integer",
                                        "description": "A saved card from `/me`. Default: the most recently used active card."
                                    },
                                    "invoice_requested": {
                                        "type": "boolean",
                                        "description": "When true the `invoice_*` fields below are required except `invoice_vat_number`."
                                    },
                                    "invoice_company": {
                                        "type": "string",
                                        "description": "Company name.",
                                        "maxLength": 150
                                    },
                                    "invoice_eik": {
                                        "type": "string",
                                        "description": "Valid Bulgarian EIK.",
                                        "maxLength": 16
                                    },
                                    "invoice_vat_number": {
                                        "type": "string",
                                        "pattern": "^BG\\d{9,10}$",
                                        "description": "Optional VAT number."
                                    },
                                    "invoice_mol": {
                                        "type": "string",
                                        "description": "Accountable person.",
                                        "maxLength": 150
                                    },
                                    "invoice_address": {
                                        "type": "string",
                                        "description": "Registered address.",
                                        "maxLength": 255
                                    },
                                    "invoice_city": {
                                        "type": "string",
                                        "description": "Registered city.",
                                        "maxLength": 100
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    },
                    {
                        "oauth2": [
                            "orders:place"
                        ]
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phase 1 summary, or a new summary after something changed: confirm again.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OrderConfirmationRequired"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The order exists and is NOT charged: over the cap or the card could not be used. `placement.pay_url` is where the buyer pays.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OrderPlaced"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The order exists and the card charge is in progress. Read `payment.status` on the order.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OrderPlaced"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; `errors` maps each field to its messages.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid credential. The `WWW-Authenticate` header names the protected-resource metadata where OAuth is enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The credential lacks the scope, the buyer has no right for this action, or the buyer is blocked from API access.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API surface is switched off, or online sales are closed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/orders/{order}": {
            "get": {
                "operationId": "get-me-orders-order",
                "tags": [
                    "Orders"
                ],
                "summary": "One order with its sub-orders, shipments and payment status",
                "description": "After placing an order, poll `payment.status`: charging, then paid or failed. Another buyer's order is 404.",
                "parameters": [
                    {
                        "name": "order",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The public order id (UUID) from `id` in an order response."
                    }
                ],
                "security": [
                    {
                        "bearerAuth": []
                    },
                    {
                        "oauth2": [
                            "read"
                        ]
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The order.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Order"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown id, or not the signed-in buyer's own record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid credential. The `WWW-Authenticate` header names the protected-resource metadata where OAuth is enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The credential lacks the scope, the buyer has no right for this action, or the buyer is blocked from API access.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/reference": {
            "get": {
                "operationId": "get-reference",
                "tags": [
                    "Catalog"
                ],
                "summary": "Filter vocabulary",
                "description": "The codes the `/wines` filters accept: colors, varieties, regions and subregions, origin scopes, sweetness classes, price buckets and sort options.",
                "security": [],
                "responses": {
                    "200": {
                        "description": "The vocabulary.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Reference"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/search": {
            "get": {
                "operationId": "get-search",
                "tags": [
                    "Catalog"
                ],
                "summary": "Search wines, wineries, packs, articles and pages",
                "description": "The same reader as the site search. Each result carries its `type`, `title`, `excerpt` and storefront `url`.",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "The search text.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "1-based page number.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "excerpt": {
                                                        "oneOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "required": [
                                                    "type",
                                                    "title",
                                                    "excerpt",
                                                    "url"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wines": {
            "get": {
                "operationId": "get-wines",
                "tags": [
                    "Catalog"
                ],
                "summary": "Search and list wines",
                "description": "Same filter engine as the storefront catalog. 12 wines per page. `price` on a card is per bottle; wines are bought in packs, so use `minimum_pack` for the smallest orderable total. `meta.facet_counts` counts the filtered result per filter value, keyed by the values the filters accept. A free-text search with no result adds `meta.hints`. Delivery is charged per winery, not per wine.",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Free-text search in Cyrillic or Latin: matches the wine name and its name in the other script, grape varieties, winery, vineyard and village, and the wine texts. Words shorter than 3 letters are ignored.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "color",
                        "in": "query",
                        "required": false,
                        "description": "Comma-separated color codes (OR): red, white, rose, orange, claret. Sparkling is not a color: use `sparkling`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sparkling",
                        "in": "query",
                        "required": false,
                        "description": "Only sparkling wines (any color).",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "style",
                        "in": "query",
                        "required": false,
                        "description": "Set to `natural` for natural wines only.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sweetness",
                        "in": "query",
                        "required": false,
                        "description": "Comma-separated sweetness codes (OR) from `/reference`, for example DRY, SEMI_DRY, SWEET.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "region",
                        "in": "query",
                        "required": false,
                        "description": "Comma-separated region aliases (OR) from `/reference`, for example danubian, thracian.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "subregion",
                        "in": "query",
                        "required": false,
                        "description": "Comma-separated subregion slugs (OR) from `/reference`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "variety",
                        "in": "query",
                        "required": false,
                        "description": "Comma-separated grape variety canonical names (OR) from `/reference`, for example MAVRUD, MERLOT.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "origin",
                        "in": "query",
                        "required": false,
                        "description": "Comma-separated grape origin scopes (OR): single_vineyard, single_village, multi_village, regional.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "price",
                        "in": "query",
                        "required": false,
                        "description": "Comma-separated price bucket keys (OR): u15, 15-25, 25-40, o40.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "winery",
                        "in": "query",
                        "required": false,
                        "description": "Comma-separated winery slugs (OR).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "new (default), price_asc or price_desc.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "1-based page number.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "A page of wine cards.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WineCard"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "description": "Pagination links: first, last, prev, next (null at the ends).",
                                            "additionalProperties": true
                                        },
                                        "meta": {
                                            "type": "object",
                                            "description": "Pagination meta: current_page, per_page, last_page, total, from, to, path, links.",
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wines/{slug}": {
            "get": {
                "operationId": "get-wines-slug",
                "tags": [
                    "Catalog"
                ],
                "summary": "One wine with its active vintage and packs",
                "description": "`active_vintage.packs` lists what can be ordered; take `pack_id` from there for `POST /me/cart/items`. 404 for an unknown or unreachable slug.",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The public slug from a list response."
                    }
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "The wine.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Wine"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown slug.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wineries": {
            "get": {
                "operationId": "get-wineries",
                "tags": [
                    "Catalog"
                ],
                "summary": "List wineries",
                "description": "Ordered by name. 24 per page by default, at most 50.",
                "parameters": [
                    {
                        "name": "region",
                        "in": "query",
                        "required": false,
                        "description": "A region alias from `/reference`, for example danubian.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Page size, 1 to 50 (default 24).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "1-based page number.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "A page of winery cards.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WineryCard"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "description": "Pagination links: first, last, prev, next (null at the ends).",
                                            "additionalProperties": true
                                        },
                                        "meta": {
                                            "type": "object",
                                            "description": "Pagination meta: current_page, per_page, last_page, total, from, to, path, links.",
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wineries/{slug}": {
            "get": {
                "operationId": "get-wineries-slug",
                "tags": [
                    "Catalog"
                ],
                "summary": "One winery",
                "description": "`delivery_fee` is charged once per winery in an order. A paused winery keeps its page; check `buyable`.",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The public slug from a list response."
                    }
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "The winery.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Winery"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown slug.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit reached; wait for `Retry-After` seconds. Limits are on https://enotale.bg/docs/api.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The API is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Money": {
                "type": "object",
                "properties": {
                    "minor_units": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Integer euro cents; never a float. null only when a price is not set."
                    },
                    "currency": {
                        "type": "string",
                        "description": "Always EUR."
                    },
                    "formatted": {
                        "type": "string",
                        "description": "Display string in the storefront format, for example \"14,80 €\"."
                    }
                },
                "required": [
                    "minor_units",
                    "currency",
                    "formatted"
                ]
            },
            "Pack": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Value for `pack_id` when adding to the cart."
                    },
                    "bottles": {
                        "type": "integer",
                        "description": "Number of bottles in the pack."
                    },
                    "total_price": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "What the buyer pays for the whole pack, after the bundle discount and any active campaign."
                    },
                    "price_per_bottle": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "`total_price` divided by `bottles`."
                    },
                    "orderable": {
                        "type": "boolean",
                        "description": "False when the pack is below the wine's minimum, out of stock, withdrawn, or the winery is not selling."
                    }
                },
                "required": [
                    "id",
                    "bottles",
                    "total_price",
                    "price_per_bottle",
                    "orderable"
                ]
            },
            "MinimumPack": {
                "type": "object",
                "properties": {
                    "bottles": {
                        "type": "integer",
                        "description": "Number of bottles in the pack."
                    },
                    "total_price": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "What the buyer pays for the whole pack."
                    },
                    "price_per_bottle": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "`total_price` divided by `bottles`."
                    }
                },
                "required": [
                    "bottles",
                    "total_price",
                    "price_per_bottle"
                ],
                "description": "The smallest enabled pack that clears the wine's minimum number of bottles. Stock is not consulted."
            },
            "WineCard": {
                "type": "object",
                "properties": {
                    "slug": {
                        "type": "string",
                        "description": "Public slug; use it in `GET /wines/{slug}`."
                    },
                    "name": {
                        "type": "string",
                        "description": "The wine name."
                    },
                    "alt_name": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The name in the other script (Cyrillic or Latin); null when there is none."
                    },
                    "color": {
                        "type": "string",
                        "description": "red, white, rose, orange or claret."
                    },
                    "is_sparkling": {
                        "type": "boolean",
                        "description": "True for sparkling wines of any color."
                    },
                    "sweetness": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "code": {
                                        "type": "string"
                                    },
                                    "label_bg": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "code",
                                    "label_bg"
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "null when the wine has no sweetness class."
                    },
                    "region": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Region name in Bulgarian; null when not set."
                    },
                    "subregion": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Subregion name in Bulgarian; null when not set."
                    },
                    "grape_varieties": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Grape variety names in Bulgarian."
                    },
                    "vintage_year": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Year of the vintage on sale; null when not set."
                    },
                    "price": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "Price of ONE bottle."
                    },
                    "price_basis": {
                        "type": "string",
                        "description": "Always \"per_bottle\"."
                    },
                    "minimum_pack": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/MinimumPack"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The smallest pack the buyer can order; null when none is orderable."
                    },
                    "winery": {
                        "type": "object",
                        "properties": {
                            "slug": {
                                "type": "string"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "slug",
                            "name"
                        ],
                        "description": "The producing winery: `slug` and `name`."
                    },
                    "image_url": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "uri"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Bottle image address; null when there is no image."
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "The wine's page on the storefront."
                    }
                },
                "required": [
                    "slug",
                    "name",
                    "alt_name",
                    "color",
                    "is_sparkling",
                    "sweetness",
                    "region",
                    "subregion",
                    "grape_varieties",
                    "vintage_year",
                    "price",
                    "price_basis",
                    "minimum_pack",
                    "winery",
                    "image_url",
                    "url"
                ]
            },
            "WineVintage": {
                "type": "object",
                "properties": {
                    "year": {
                        "type": "integer",
                        "description": "Year of the vintage."
                    },
                    "is_current": {
                        "type": "boolean",
                        "description": "Always true: this object is the edition on sale."
                    },
                    "price": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "Price of ONE bottle."
                    },
                    "price_basis": {
                        "type": "string",
                        "description": "Always \"per_bottle\"."
                    },
                    "in_stock": {
                        "type": "boolean",
                        "description": "Whether the edition has bottles on hand. Whether the wine can be bought now is the wine's availability."
                    },
                    "packs": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Pack"
                        },
                        "description": "The enabled packs; wines are bought only in packs."
                    },
                    "minimum_pack": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/MinimumPack"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The smallest pack the buyer can order; null when none is orderable."
                    },
                    "produced_bottles": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Bottles produced in this vintage; null when not stated."
                    },
                    "alcohol_pct": {
                        "oneOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Alcohol by volume, in percent."
                    },
                    "volume_ml": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Bottle volume in milliliters."
                    },
                    "harvest_type": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "One of standard, late_harvest, select_harvest, botrytis, ice_wine, dried_grape; null when not stated."
                    },
                    "must_weight": {
                        "oneOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Sugar of the must before fermentation, in the unit named by `must_weight_unit`. Not the sugar left in the wine: see `residual_sugar_g_l`."
                    },
                    "must_weight_unit": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "oechsle, brix or baume."
                    },
                    "residual_sugar_g_l": {
                        "oneOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Sugar left in the wine after fermentation, in grams per liter."
                    },
                    "aging": {
                        "type": "object",
                        "properties": {
                            "text": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "months": {
                                "oneOf": [
                                    {
                                        "type": "integer"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "barrel_types": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        },
                        "required": [
                            "text",
                            "months",
                            "barrel_types"
                        ],
                        "description": "Aging: `text` (Bulgarian), `months` and `barrel_types` (Bulgarian labels)."
                    },
                    "vintage_note": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The winery's note on this vintage, in Bulgarian."
                    },
                    "harvest_story": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The winery's story of this harvest, in Bulgarian."
                    },
                    "elabel_url": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "uri"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Address of the electronic label (ingredients and nutrition) of this vintage; null when the winery has none."
                    },
                    "nutrition": {
                        "type": "object",
                        "properties": {
                            "energy_kj": {
                                "oneOf": [
                                    {
                                        "type": "integer"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "energy_kcal": {
                                "oneOf": [
                                    {
                                        "type": "integer"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "fat_g": {
                                "oneOf": [
                                    {
                                        "type": "number"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "saturates_g": {
                                "oneOf": [
                                    {
                                        "type": "number"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "carbs_g": {
                                "oneOf": [
                                    {
                                        "type": "number"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "sugars_g": {
                                "oneOf": [
                                    {
                                        "type": "number"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "protein_g": {
                                "oneOf": [
                                    {
                                        "type": "number"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "salt_g": {
                                "oneOf": [
                                    {
                                        "type": "number"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            }
                        },
                        "required": [
                            "energy_kj",
                            "energy_kcal",
                            "fat_g",
                            "saturates_g",
                            "carbs_g",
                            "sugars_g",
                            "protein_g",
                            "salt_g"
                        ],
                        "description": "EU nutrition declaration. A field is null when the winery has not entered it; never read null as zero."
                    }
                },
                "required": [
                    "year",
                    "is_current",
                    "price",
                    "price_basis",
                    "in_stock",
                    "packs",
                    "minimum_pack",
                    "produced_bottles",
                    "alcohol_pct",
                    "volume_ml",
                    "harvest_type",
                    "must_weight",
                    "must_weight_unit",
                    "residual_sugar_g_l",
                    "aging",
                    "vintage_note",
                    "harvest_story",
                    "elabel_url",
                    "nutrition"
                ]
            },
            "Wine": {
                "type": "object",
                "properties": {
                    "slug": {
                        "type": "string",
                        "description": "Public slug of the wine."
                    },
                    "name": {
                        "type": "string",
                        "description": "The wine name."
                    },
                    "alt_name": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The name in the other script (Cyrillic or Latin); null when there is none."
                    },
                    "color": {
                        "type": "string",
                        "description": "red, white, rose, orange or claret."
                    },
                    "is_sparkling": {
                        "type": "boolean",
                        "description": "True for sparkling wines of any color."
                    },
                    "description": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Description of the wine in Bulgarian."
                    },
                    "style_descriptor": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Short description of the wine's style, in Bulgarian."
                    },
                    "occasion_note": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the wine suits, in Bulgarian."
                    },
                    "audience_note": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Who the wine suits, in Bulgarian."
                    },
                    "serving_note": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Serving advice in Bulgarian."
                    },
                    "food_pairing_note": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Food pairing advice in Bulgarian."
                    },
                    "sweetness": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "code": {
                                        "type": "string"
                                    },
                                    "label_bg": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "code",
                                    "label_bg"
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "null when the wine has no sweetness class."
                    },
                    "grape_composition": {
                        "type": "object",
                        "properties": {
                            "primary": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "secondary": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        },
                        "required": [
                            "primary",
                            "secondary"
                        ],
                        "description": "`primary` is the main grape variety; `secondary` lists the others. Names are in Bulgarian."
                    },
                    "origin": {
                        "type": "object",
                        "properties": {
                            "region": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "subregion": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "scope": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "scope_label_bg": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "line": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            }
                        },
                        "required": [
                            "region",
                            "subregion",
                            "scope",
                            "scope_label_bg",
                            "line"
                        ],
                        "description": "Where the grapes come from: `region`, `subregion`, `scope` (single_vineyard, single_village, multi_village or regional), `scope_label_bg` and `line`, the origin sentence the page shows."
                    },
                    "is_natural": {
                        "type": "boolean",
                        "description": "True for natural wines."
                    },
                    "food_pairing_tags": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Each tag has `label_bg` and `description_bg`."
                    },
                    "availability": {
                        "type": "string",
                        "description": "Whether the wine can be bought now; same vocabulary as the storefront."
                    },
                    "active_vintage": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/WineVintage"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The edition on sale; null when there is none."
                    },
                    "vintages": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "The wine's vintages: `year`, `slug`, `url` and `is_current`."
                    },
                    "winery": {
                        "type": "object",
                        "properties": {
                            "slug": {
                                "type": "string"
                            },
                            "name": {
                                "type": "string"
                            },
                            "story": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "philosophy": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "url": {
                                "type": "string",
                                "format": "uri"
                            }
                        },
                        "required": [
                            "slug",
                            "name",
                            "story",
                            "philosophy",
                            "url"
                        ],
                        "description": "The producing winery: `slug`, `name`, `story`, `philosophy` and `url`."
                    },
                    "author": {
                        "oneOf": [
                            {
                                "type": "object",
                                "additionalProperties": true
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The person behind the wine: `name`, `role_title`, `bio` and `quote`; null when none is named."
                    },
                    "images": {
                        "type": "object",
                        "properties": {
                            "front": {
                                "oneOf": [
                                    {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "back": {
                                "oneOf": [
                                    {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            }
                        },
                        "required": [
                            "front",
                            "back"
                        ],
                        "description": "Bottle images: `front` and `back` addresses, null when missing."
                    },
                    "prep_days": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Days the winery needs to prepare a shipment; null when not stated."
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "The wine's page on the storefront."
                    }
                },
                "required": [
                    "slug",
                    "name",
                    "alt_name",
                    "color",
                    "is_sparkling",
                    "description",
                    "style_descriptor",
                    "occasion_note",
                    "audience_note",
                    "serving_note",
                    "food_pairing_note",
                    "sweetness",
                    "grape_composition",
                    "origin",
                    "is_natural",
                    "food_pairing_tags",
                    "availability",
                    "active_vintage",
                    "vintages",
                    "winery",
                    "author",
                    "images",
                    "prep_days",
                    "url"
                ]
            },
            "WineryCard": {
                "type": "object",
                "properties": {
                    "slug": {
                        "type": "string",
                        "description": "Public slug; use it in `GET /wineries/{slug}`."
                    },
                    "name": {
                        "type": "string",
                        "description": "The winery name."
                    },
                    "region": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Region name in Bulgarian; null when not set."
                    },
                    "subregion": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Subregion name in Bulgarian; null when not set."
                    },
                    "hero_text": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Short introduction of the winery in Bulgarian."
                    },
                    "published_wines_count": {
                        "type": "integer",
                        "description": "Number of the winery's wines listed in the catalog."
                    },
                    "hero_image_url": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "uri"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Cover image address; null when there is none."
                    },
                    "buyable": {
                        "type": "boolean",
                        "description": "False while the winery does not sell online; `availability` says why."
                    },
                    "availability": {
                        "type": "string",
                        "description": "buyable, winery_paused or winery_not_yet_selling."
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "The winery's page on the storefront."
                    }
                },
                "required": [
                    "slug",
                    "name",
                    "region",
                    "subregion",
                    "hero_text",
                    "published_wines_count",
                    "hero_image_url",
                    "buyable",
                    "availability",
                    "url"
                ]
            },
            "Winery": {
                "type": "object",
                "properties": {
                    "slug": {
                        "type": "string",
                        "description": "Public slug of the winery."
                    },
                    "name": {
                        "type": "string",
                        "description": "The winery name."
                    },
                    "region": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Region name in Bulgarian; null when not set."
                    },
                    "subregion": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Subregion name in Bulgarian; null when not set."
                    },
                    "locality": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Village or town of the winery."
                    },
                    "founding_year": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Year the winery was founded."
                    },
                    "size": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "family, medium or boutique."
                    },
                    "visitors_policy": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "yes, no or by_reservation."
                    },
                    "visitors_policy_label_bg": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The visitors policy in Bulgarian."
                    },
                    "hero_text": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Short introduction of the winery in Bulgarian."
                    },
                    "story": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The winery's story in Bulgarian."
                    },
                    "philosophy": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The winery's philosophy in Bulgarian."
                    },
                    "style_overview": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Overview of the winery's wine style in Bulgarian."
                    },
                    "principles": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "The winery's principles, one text line each."
                    },
                    "faqs": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Each entry has `question` and `answer`."
                    },
                    "people": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Each entry has `name`, `role_title` and `bio`."
                    },
                    "delivery_fee": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "Charged once per winery in an order."
                    },
                    "fulfillment_sla_days": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Days the winery commits to ship within; null when not stated."
                    },
                    "hero_image_url": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "uri"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Cover image address; null when there is none."
                    },
                    "buyable": {
                        "type": "boolean",
                        "description": "False while the winery does not sell online; `availability` says why."
                    },
                    "availability": {
                        "type": "string",
                        "description": "buyable, winery_paused or winery_not_yet_selling."
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "The winery's page on the storefront."
                    }
                },
                "required": [
                    "slug",
                    "name",
                    "region",
                    "subregion",
                    "locality",
                    "founding_year",
                    "size",
                    "visitors_policy",
                    "visitors_policy_label_bg",
                    "hero_text",
                    "story",
                    "philosophy",
                    "style_overview",
                    "principles",
                    "faqs",
                    "people",
                    "delivery_fee",
                    "fulfillment_sla_days",
                    "hero_image_url",
                    "buyable",
                    "availability",
                    "url"
                ]
            },
            "SavedCard": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Value for `card_token_id` when placing an order."
                    },
                    "label": {
                        "type": "string",
                        "description": "Display label of the card."
                    },
                    "brand": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Card brand, for example VISA; null when unknown."
                    },
                    "last_four": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Last four digits of the card number."
                    },
                    "expires_on": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "date"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Expiry date of the card."
                    },
                    "last_used_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the card was last used for a payment."
                    }
                },
                "required": [
                    "id",
                    "label",
                    "brand",
                    "last_four",
                    "expires_on",
                    "last_used_at"
                ]
            },
            "Me": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "The buyer's public id (UUID)."
                    },
                    "name": {
                        "type": "string",
                        "description": "Full name."
                    },
                    "first_name": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "First name; null when not set."
                    },
                    "last_name": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Last name; null when not set."
                    },
                    "email": {
                        "type": "string",
                        "description": "Sign-in e-mail address."
                    },
                    "phone": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Phone number; null when not set."
                    },
                    "api_purchasing": {
                        "type": "object",
                        "properties": {
                            "eligible": {
                                "type": "boolean"
                            },
                            "has_saved_card": {
                                "type": "boolean"
                            },
                            "completed_orders": {
                                "type": "integer"
                            },
                            "required_completed_orders": {
                                "type": "integer"
                            },
                            "max_order_cap_minor": {
                                "type": "integer"
                            },
                            "this_token": {
                                "oneOf": [
                                    {
                                        "type": "object",
                                        "additionalProperties": true
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            }
                        },
                        "required": [
                            "eligible",
                            "has_saved_card",
                            "completed_orders",
                            "required_completed_orders",
                            "max_order_cap_minor",
                            "this_token"
                        ],
                        "description": "Whether this buyer may grant the purchase right and what the presented credential may do. `this_token` is null for a credential that is not an API key or connector grant."
                    },
                    "saved_cards": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SavedCard"
                        },
                        "description": "Cards saved in the profile."
                    }
                },
                "required": [
                    "id",
                    "name",
                    "first_name",
                    "last_name",
                    "email",
                    "phone",
                    "api_purchasing",
                    "saved_cards"
                ]
            },
            "Address": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Value for `user_address_id` when placing an order."
                    },
                    "label": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The buyer's name for the address; null when not set."
                    },
                    "recipient_name": {
                        "type": "string",
                        "description": "Who receives the parcel."
                    },
                    "phone": {
                        "type": "string",
                        "description": "Phone number of the recipient."
                    },
                    "street": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Street and number; null when not set."
                    },
                    "city": {
                        "type": "string",
                        "description": "City or village."
                    },
                    "postcode": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Four-digit postcode; null when not set."
                    },
                    "speedy_site_id": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Courier city id, for an office pick-up."
                    },
                    "speedy_office_id": {
                        "oneOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Courier office id; set for an office pick-up."
                    },
                    "is_default": {
                        "type": "boolean",
                        "description": "True for the buyer's default address."
                    }
                },
                "required": [
                    "id",
                    "label",
                    "recipient_name",
                    "phone",
                    "street",
                    "city",
                    "postcode",
                    "speedy_site_id",
                    "speedy_office_id",
                    "is_default"
                ]
            },
            "Cart": {
                "type": "object",
                "properties": {
                    "groups": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "One group per winery: `winery`, `items` (bottle packs and tasting packs with `item_id`, `count`, `unit_price`, `line_total`) and `subtotal`."
                    },
                    "goods_total": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "Sum of all lines, before delivery fees."
                    },
                    "checkout_url": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "uri"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Where the buyer pays on the site; null while the cart is empty or online sales are closed."
                    },
                    "cart_url": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "uri"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The cart page on the storefront."
                    }
                },
                "required": [
                    "groups",
                    "goods_total",
                    "checkout_url",
                    "cart_url"
                ]
            },
            "SubOrder": {
                "type": "object",
                "properties": {
                    "reference": {
                        "type": "string",
                        "description": "Sub-order number shown to the buyer."
                    },
                    "status": {
                        "type": "string",
                        "description": "Machine status of the sub-order."
                    },
                    "status_label_bg": {
                        "type": "string",
                        "description": "The status in Bulgarian."
                    },
                    "winery": {
                        "type": "object",
                        "properties": {
                            "slug": {
                                "type": "string"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "slug",
                            "name"
                        ],
                        "description": "The shipping winery: `slug` and `name`."
                    },
                    "ship_by": {
                        "type": "string",
                        "format": "date",
                        "description": "Date by which the winery must ship."
                    },
                    "shipped_at": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the winery shipped; null before that."
                    },
                    "delivered_at": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the parcel was delivered; null before that."
                    },
                    "carrier": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Courier code; null before shipping."
                    },
                    "tracking_no": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Courier tracking number; null before shipping."
                    },
                    "parcel_leg": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Stage of the parcel in the courier network; null before shipping."
                    },
                    "office_hold_until": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the hold of a parcel waiting in a courier office ends; null otherwise."
                    },
                    "delivery_fee": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Delivery fee of this sub-order."
                    },
                    "lines": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Each line: `wine_name`, `wine_slug`, `qty`, `pack_bottles`, `pack_count`, `unit_price`, `line_total`."
                    },
                    "shipment_events": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Tracking events: `occurred_at` and `description`."
                    }
                },
                "required": [
                    "reference",
                    "status",
                    "status_label_bg",
                    "winery",
                    "ship_by",
                    "shipped_at",
                    "delivered_at",
                    "carrier",
                    "tracking_no",
                    "parcel_leg",
                    "office_hold_until",
                    "delivery_fee",
                    "lines",
                    "shipment_events"
                ]
            },
            "Order": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "The public order id (UUID), used in `/me/orders/{order}`."
                    },
                    "display_number": {
                        "type": "string",
                        "description": "The order number shown to the buyer. Not an identifier: use `id`."
                    },
                    "status": {
                        "type": "string",
                        "description": "Machine status of the order."
                    },
                    "status_label_bg": {
                        "type": "string",
                        "description": "The status in Bulgarian."
                    },
                    "placed_at": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the order was placed."
                    },
                    "delivery_address": {
                        "oneOf": [
                            {
                                "type": "object",
                                "additionalProperties": true
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The delivery address the order was placed with; null when there is none."
                    },
                    "invoice": {
                        "oneOf": [
                            {
                                "type": "object",
                                "additionalProperties": true
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Invoice details when the buyer asked for an invoice; otherwise null."
                    },
                    "totals": {
                        "type": "object",
                        "properties": {
                            "subtotal": {
                                "$ref": "#/components/schemas/Money"
                            },
                            "discount": {
                                "$ref": "#/components/schemas/Money"
                            },
                            "benefit_discount": {
                                "$ref": "#/components/schemas/Money"
                            },
                            "benefit_code": {
                                "oneOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "delivery_fee": {
                                "$ref": "#/components/schemas/Money"
                            },
                            "total": {
                                "$ref": "#/components/schemas/Money"
                            }
                        },
                        "required": [
                            "subtotal",
                            "discount",
                            "benefit_discount",
                            "benefit_code",
                            "delivery_fee",
                            "total"
                        ],
                        "description": "total = subtotal - discount - benefit_discount + delivery_fee."
                    },
                    "sub_orders": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SubOrder"
                        },
                        "description": "One sub-order per winery."
                    },
                    "payment": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string"
                            },
                            "pay_url": {
                                "oneOf": [
                                    {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            }
                        },
                        "required": [
                            "status",
                            "pay_url"
                        ],
                        "description": "`status` is one of unpaid, charging, paid, failed, cancelled. `pay_url` is set for unpaid and failed orders."
                    }
                },
                "required": [
                    "id",
                    "display_number",
                    "status",
                    "status_label_bg",
                    "placed_at",
                    "delivery_address",
                    "invoice",
                    "totals",
                    "sub_orders",
                    "payment"
                ]
            },
            "OrderSummary": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "The public order id (UUID), used in `/me/orders/{order}`."
                    },
                    "display_number": {
                        "type": "string",
                        "description": "The order number shown to the buyer."
                    },
                    "status": {
                        "type": "string",
                        "description": "Machine status of the order."
                    },
                    "status_label_bg": {
                        "type": "string",
                        "description": "The status in Bulgarian."
                    },
                    "placed_at": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the order was placed."
                    },
                    "total": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "Total the buyer pays."
                    },
                    "sub_orders_count": {
                        "type": "integer",
                        "description": "Number of sub-orders, one per winery."
                    },
                    "wineries": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Names of the wineries in the order."
                    }
                },
                "required": [
                    "id",
                    "display_number",
                    "status",
                    "status_label_bg",
                    "placed_at",
                    "total",
                    "sub_orders_count",
                    "wineries"
                ]
            },
            "OrderSummaryPreview": {
                "type": "object",
                "properties": {
                    "wineries": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Per winery: `winery`, `lines` (with `unit_price`, `line_total`), `goods`, `delivery_fee`."
                    },
                    "subtotal": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "Sum of the wine lines before discounts."
                    },
                    "discount": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "Discount applied to the order."
                    },
                    "benefit_discount": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "Discount from the buyer's benefit code."
                    },
                    "delivery_fee": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "Delivery fees of all wineries."
                    },
                    "total": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Money"
                            }
                        ],
                        "description": "What the buyer pays: subtotal minus discounts plus delivery."
                    },
                    "delivery_to": {
                        "oneOf": [
                            {
                                "type": "object",
                                "additionalProperties": true
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The address the order will be delivered to."
                    },
                    "invoice_to": {
                        "oneOf": [
                            {
                                "type": "object",
                                "additionalProperties": true
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The invoice details the order will use; null when no invoice was asked for."
                    },
                    "payment": {
                        "type": "object",
                        "properties": {
                            "card": {
                                "type": "object",
                                "additionalProperties": true
                            },
                            "cap": {
                                "$ref": "#/components/schemas/Money"
                            },
                            "verdict": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "card",
                            "cap",
                            "verdict",
                            "message"
                        ],
                        "description": "`verdict` is will_be_charged or cap_exceeded."
                    }
                },
                "required": [
                    "wineries",
                    "subtotal",
                    "discount",
                    "benefit_discount",
                    "delivery_fee",
                    "total",
                    "delivery_to",
                    "invoice_to",
                    "payment"
                ],
                "description": "What the buyer agrees to by confirming; nothing is created while this is returned."
            },
            "OrderConfirmationRequired": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "description": "Always \"confirmation_required\"."
                    },
                    "reason": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "\"summary_changed\" when a confirmation_code was sent but the cart, a price, the address or the total changed since; null on the first call."
                    },
                    "summary": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/OrderSummaryPreview"
                            }
                        ],
                        "description": "What the buyer agrees to by confirming."
                    },
                    "confirmation": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "string"
                            },
                            "expires_at": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "instructions": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "code",
                            "expires_at",
                            "instructions"
                        ],
                        "description": "Send `confirmation.code` back, unchanged, with the same body, after the buyer said yes to the summary."
                    }
                },
                "required": [
                    "status",
                    "reason",
                    "summary",
                    "confirmation"
                ]
            },
            "OrderPlacement": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "description": "charging (the card charge is in progress), not_charged (the card could not be used) or cap_exceeded (the total is above the credential's cap)."
                    },
                    "message": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Text for the buyer, in Bulgarian."
                    },
                    "pay_url": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "uri"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Set for not_charged and cap_exceeded: the buyer pays on the site."
                    }
                },
                "required": [
                    "status",
                    "message",
                    "pay_url"
                ]
            },
            "OrderPlaced": {
                "type": "object",
                "properties": {
                    "data": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Order"
                            }
                        ],
                        "description": "The created order."
                    },
                    "placement": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/OrderPlacement"
                            }
                        ],
                        "description": "What happened to the payment."
                    }
                },
                "required": [
                    "data",
                    "placement"
                ]
            },
            "ValidationError": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string",
                        "description": "Summary of the first problem."
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "Field name to a list of messages."
                    }
                },
                "required": [
                    "message",
                    "errors"
                ]
            },
            "Error": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string",
                        "description": "What went wrong; safe to show to the buyer."
                    }
                },
                "required": [
                    "message"
                ]
            },
            "Reference": {
                "type": "object",
                "properties": {
                    "colors": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Wine colors: `value`, `label_bg`."
                    },
                    "varieties": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Grape varieties: `canonical_name` (filter value), `display_name_bg`, `color_group`."
                    },
                    "regions": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Regions: `alias` (filter value), `name_bg`, `subregions` with `slug` and `name_bg`."
                    },
                    "origin_scopes": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "sweetness_levels": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Sweetness classes: `code` (filter value), `scale`, `label_bg`."
                    },
                    "price_buckets": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        },
                        "description": "Price buckets: `key` (filter value), `min_minor`, `max_minor`, `label_bg`."
                    },
                    "sort_options": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                },
                "required": [
                    "colors",
                    "varieties",
                    "regions",
                    "origin_scopes",
                    "sweetness_levels",
                    "price_buckets",
                    "sort_options"
                ],
                "description": "The vocabulary the catalog filters accept."
            }
        },
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "An API key minted on https://enotale.bg/profil/api (scopes chosen when minting), or an OAuth access token obtained by signing in with an Enotale profile. Both are sent as `Authorization: Bearer <token>`."
            },
            "oauth2": {
                "type": "oauth2",
                "description": "OAuth 2.1 authorization code with PKCE and dynamic client registration; discovery at https://id.enotale.bg/.well-known/oauth-authorization-server.",
                "flows": {
                    "authorizationCode": {
                        "authorizationUrl": "https://id.enotale.bg/oauth/authorize",
                        "tokenUrl": "https://id.enotale.bg/oauth/token",
                        "scopes": {
                            "read": "Read the buyer's orders, addresses, cart and saved cards (label, brand, last four digits, expiry; never the full number), and fill the cart.",
                            "orders:place": "Place orders and pay with the saved card (the purchase right)."
                        }
                    }
                }
            }
        }
    },
    "tags": [
        {
            "name": "Catalog",
            "description": "Public wine, winery and search data. No credential needed."
        },
        {
            "name": "Account",
            "description": "The signed-in buyer's profile and address book."
        },
        {
            "name": "Cart",
            "description": "The buyer's one cart, shared with the storefront."
        },
        {
            "name": "Orders",
            "description": "Order history and the two-phase order placement."
        }
    ]
}