{
    "openapi": "3.1.0",
    "info": {
        "title": "פרחי צעירי — כלים לסוכנים",
        "version": "0.1.0",
        "description": "חיפוש בחנות, הרכבת זר והצעת מחיר. אין הזמנה ואין תשלום דרך הממשק הזה. מדריך מלא: https://zairiflowers.co.il/agents.md"
    },
    "servers": [
        {
            "url": "https://zairiflowers.co.il"
        }
    ],
    "paths": {
        "/wp-json/zairi/v1/agent/catalog": {
            "get": {
                "operationId": "search_catalog",
                "summary": "חיפוש בחנות",
                "description": "מחפש מוצרים אמיתיים מהחנות לפי קטגוריה, מילת חיפוש, תקציב ויום. מחזיר מחיר באגורות, זמינות וכתובת העמוד. המחיר והזמינות הם של הרגע, ולכן יש לציין אותם כך.",
                "responses": {
                    "200": {
                        "description": "תוצאה",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer"
                                        },
                                        "offset": {
                                            "type": "integer"
                                        },
                                        "products": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "הכלי סגור כרגע"
                    },
                    "422": {
                        "description": "קלט לא תקין או רכיב לא זמין"
                    },
                    "429": {
                        "description": "יותר מדי בקשות"
                    }
                },
                "parameters": [
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "מזהה קטגוריה, אחד מהרשימה בלבד. flowers = זרים ועציצים (bouquets = זרי פרחים, flowering-plants = עציצים, arrangements = סידורי פרחים, orchids = סחלבים, air-plants = צמחי אוויר, flower-crowns = זר פרחים לראש, bridal-car = זר כלה וקישוט לרכב, wreaths = גלגלי אבל); plants = משתלה (nursery-pots = עציצים, herbs-vegetables = תבלינים וירקות, home-office = לבית ולמשרד, garden = גינה, cacti-succulents = קקטוסים וסוקולנטים, trees = עצים, special-plants = מיוחדים); planters = כלי שתילה מעוצבים (vases = אגרטלים, ceramics = קרמיקה); garden-tools = אביזרים וכלי גינון (window-boxes = אדניות, seeds-bulbs = זרעים ופקעות, fertilizers = דשנים והדברה, soil = אדמה ותערובות); greeting-cards = כרטיסי ברכה מעוצבים; events = אירועים",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "flowers",
                                "bouquets",
                                "flowering-plants",
                                "arrangements",
                                "orchids",
                                "air-plants",
                                "flower-crowns",
                                "bridal-car",
                                "wreaths",
                                "plants",
                                "nursery-pots",
                                "herbs-vegetables",
                                "home-office",
                                "garden",
                                "cacti-succulents",
                                "trees",
                                "special-plants",
                                "planters",
                                "vases",
                                "ceramics",
                                "garden-tools",
                                "window-boxes",
                                "seeds-bulbs",
                                "fertilizers",
                                "soil",
                                "greeting-cards",
                                "events"
                            ]
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "חיפוש חופשי בשם, בתיאור ובקטגוריה.",
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "description": "היום המבוקש, YYYY-MM-DD. מסנן לפי זמינות באותו יום.",
                        "schema": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        }
                    },
                    {
                        "name": "budget_max",
                        "in": "query",
                        "required": false,
                        "description": "תקציב מרבי למוצר, בשקלים.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 99999
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "כמה תוצאות להחזיר. ברירת מחדל 20.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "required": false,
                        "description": "מאיזו תוצאה להתחיל.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    }
                ]
            }
        },
        "/wp-json/zairi/v1/agent/components": {
            "get": {
                "operationId": "list_bouquet_components",
                "summary": "רכיבים לבניית זר",
                "description": "רשימת הפרחים והאריזות שאפשר לשלב בזר, עם מחיר ליחידה באגורות. role הוא flower או wrap (אריזה, לכל היותר אחת). max הוא המקסימום לרכיב, ו-remaining הערכה לצורך הבונה ולא התחייבות מלאי.",
                "responses": {
                    "200": {
                        "description": "תוצאה",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "components": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "הכלי סגור כרגע"
                    },
                    "422": {
                        "description": "קלט לא תקין או רכיב לא זמין"
                    },
                    "429": {
                        "description": "יותר מדי בקשות"
                    }
                },
                "parameters": []
            }
        },
        "/wp-json/zairi/v1/agent/compose": {
            "post": {
                "operationId": "compose_bouquet",
                "summary": "הרכבת זר והצעת מחיר",
                "description": "מרכיב זר מרכיבים אמיתיים, בודק מלאי וגבולות, ומחזיר הצעת מחיר ו-handoff_url. את הקישור שולחים לאדם: הוא פותח את הבונה עם הזר מונח, משנה, רואה הדמיה ומזמין. לא מזמינים ולא גובים בשמו. ההרכב והכמויות מחייבים, והמיקום להמחשה. השתמשו ב-items (רכיב וכמות, והשרת מסדר) או ב-stems (שליטה במיקום). הקישור תקף שבוע. אם מותרים לכם רק כלי קריאה, השתמשו ב-preview_bouquet.",
                "responses": {
                    "200": {
                        "description": "תוצאה",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer"
                                        },
                                        "total_display": {
                                            "type": "string"
                                        },
                                        "currency": {
                                            "type": "string"
                                        },
                                        "notice": {
                                            "type": "string"
                                        },
                                        "handoff_url": {
                                            "type": "string"
                                        },
                                        "handoff_expires_days": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "הכלי סגור כרגע"
                    },
                    "422": {
                        "description": "קלט לא תקין או רכיב לא זמין"
                    },
                    "429": {
                        "description": "יותר מדי בקשות"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "items": {
                                        "type": "array",
                                        "description": "רכיב וכמות. מזהים מ-list_bouquet_components. סך הכמויות עד 50.",
                                        "minItems": 1,
                                        "maxItems": 50,
                                        "items": {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "required": [
                                                "product_id",
                                                "quantity"
                                            ],
                                            "properties": {
                                                "product_id": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "quantity": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 50
                                                }
                                            }
                                        }
                                    },
                                    "stems": {
                                        "type": "array",
                                        "description": "גבעול לכל פריט, עם מיקום. x ו-z בתוך עיגול היחידה, height בין 0.7 ל-1.3. במקום items.",
                                        "minItems": 1,
                                        "maxItems": 50,
                                        "items": {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "required": [
                                                "product_id"
                                            ],
                                            "properties": {
                                                "product_id": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "x": {
                                                    "type": "number",
                                                    "minimum": -1,
                                                    "maximum": 1
                                                },
                                                "z": {
                                                    "type": "number",
                                                    "minimum": -1,
                                                    "maximum": 1
                                                },
                                                "height": {
                                                    "type": "number",
                                                    "minimum": 0.7,
                                                    "maximum": 1.3
                                                }
                                            }
                                        }
                                    },
                                    "preferences": {
                                        "type": "object",
                                        "description": "העדפות לפלוריסט, אופציונלי.",
                                        "additionalProperties": false,
                                        "properties": {
                                            "occasion": {
                                                "type": "string",
                                                "description": "אירוע",
                                                "maxLength": 80
                                            },
                                            "style": {
                                                "type": "string",
                                                "description": "סגנון",
                                                "maxLength": 80
                                            },
                                            "colour": {
                                                "type": "string",
                                                "description": "צבע",
                                                "maxLength": 80
                                            },
                                            "size": {
                                                "type": "string",
                                                "description": "גודל",
                                                "maxLength": 80
                                            },
                                            "wrapping": {
                                                "type": "string",
                                                "description": "אריזה",
                                                "maxLength": 80
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/zairi/v1/agent/preview": {
            "post": {
                "operationId": "preview_bouquet",
                "summary": "הצעת מחיר לזר, בלי שמירה",
                "description": "כמו compose_bouquet, אבל קריאה בלבד: לא נשמר דבר בשרת, והקישור נושא את הזר בתוכו ואינו פג. מתאים כשמותרים רק כלי קריאה. אותו קלט (items או stems, preferences), אותה הצעת מחיר מהשרת, ו-handoff_url שפותח את הבונה עם הזר מונח. ההרכב והכמויות מחייבים, והמיקום להמחשה.",
                "responses": {
                    "200": {
                        "description": "תוצאה",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer"
                                        },
                                        "total_display": {
                                            "type": "string"
                                        },
                                        "currency": {
                                            "type": "string"
                                        },
                                        "notice": {
                                            "type": "string"
                                        },
                                        "handoff_url": {
                                            "type": "string"
                                        },
                                        "handoff_expires_days": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "הכלי סגור כרגע"
                    },
                    "422": {
                        "description": "קלט לא תקין או רכיב לא זמין"
                    },
                    "429": {
                        "description": "יותר מדי בקשות"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "items": {
                                        "type": "array",
                                        "description": "רכיב וכמות. מזהים מ-list_bouquet_components. סך הכמויות עד 50.",
                                        "minItems": 1,
                                        "maxItems": 50,
                                        "items": {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "required": [
                                                "product_id",
                                                "quantity"
                                            ],
                                            "properties": {
                                                "product_id": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "quantity": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 50
                                                }
                                            }
                                        }
                                    },
                                    "stems": {
                                        "type": "array",
                                        "description": "גבעול לכל פריט, עם מיקום. x ו-z בתוך עיגול היחידה, height בין 0.7 ל-1.3. במקום items.",
                                        "minItems": 1,
                                        "maxItems": 50,
                                        "items": {
                                            "type": "object",
                                            "additionalProperties": false,
                                            "required": [
                                                "product_id"
                                            ],
                                            "properties": {
                                                "product_id": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "x": {
                                                    "type": "number",
                                                    "minimum": -1,
                                                    "maximum": 1
                                                },
                                                "z": {
                                                    "type": "number",
                                                    "minimum": -1,
                                                    "maximum": 1
                                                },
                                                "height": {
                                                    "type": "number",
                                                    "minimum": 0.7,
                                                    "maximum": 1.3
                                                }
                                            }
                                        }
                                    },
                                    "preferences": {
                                        "type": "object",
                                        "description": "העדפות לפלוריסט, אופציונלי.",
                                        "additionalProperties": false,
                                        "properties": {
                                            "occasion": {
                                                "type": "string",
                                                "description": "אירוע",
                                                "maxLength": 80
                                            },
                                            "style": {
                                                "type": "string",
                                                "description": "סגנון",
                                                "maxLength": 80
                                            },
                                            "colour": {
                                                "type": "string",
                                                "description": "צבע",
                                                "maxLength": 80
                                            },
                                            "size": {
                                                "type": "string",
                                                "description": "גודל",
                                                "maxLength": 80
                                            },
                                            "wrapping": {
                                                "type": "string",
                                                "description": "אריזה",
                                                "maxLength": 80
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/zairi/v1/agent/soil": {
            "get": {
                "operationId": "calculate_soil",
                "summary": "כמה אדמה צריך",
                "description": "מחשב כמה אדמה נכנסת לכלי: מידות פנימיות בסנטימטרים (box: אורך, רוחב, גובה; cylinder: קוטר, גובה) ונפח גוש השורשים בליטרים. מחזיר ליטרים והנחות החישוב.",
                "responses": {
                    "200": {
                        "description": "תוצאה",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "הכלי סגור כרגע"
                    },
                    "422": {
                        "description": "קלט לא תקין או רכיב לא זמין"
                    },
                    "429": {
                        "description": "יותר מדי בקשות"
                    }
                },
                "parameters": [
                    {
                        "name": "shape",
                        "in": "query",
                        "required": false,
                        "description": "",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "box",
                                "cylinder"
                            ]
                        }
                    },
                    {
                        "name": "length",
                        "in": "query",
                        "required": false,
                        "description": "אורך פנימי בס״מ (box)",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "width",
                        "in": "query",
                        "required": false,
                        "description": "רוחב פנימי בס״מ (box)",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "diameter",
                        "in": "query",
                        "required": false,
                        "description": "קוטר פנימי בס״מ (cylinder)",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "height",
                        "in": "query",
                        "required": false,
                        "description": "גובה פנימי בס״מ",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "root_litres",
                        "in": "query",
                        "required": false,
                        "description": "נפח גוש השורשים בליטרים, 0 אם לא ידוע",
                        "schema": {
                            "type": "number"
                        }
                    }
                ]
            }
        },
        "/wp-json/zairi/v1/agent/guides": {
            "get": {
                "operationId": "search_guides",
                "summary": "מדריכים מאושרים",
                "description": "מדריכי טיפול שהמשפחה אישרה, עם כותב, בודק, מקורות ותאריך. מחזיר קטעים וקישורים. אם אין תוצאה, אין לנו מידע מאושר על זה.",
                "responses": {
                    "200": {
                        "description": "תוצאה",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "guides": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "הכלי סגור כרגע"
                    },
                    "422": {
                        "description": "קלט לא תקין או רכיב לא זמין"
                    },
                    "429": {
                        "description": "יותר מדי בקשות"
                    }
                },
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "required": false,
                        "description": "",
                        "schema": {
                            "type": "string",
                            "maxLength": 80
                        }
                    }
                ]
            }
        },
        "/wp-json/zairi/v1/agent/delivery": {
            "get": {
                "operationId": "check_delivery",
                "summary": "בדיקת יום מסירה",
                "description": "האם אפשר למסור ביום מסוים: משלוח לעיר או איסוף עצמי. מחזיר כן/לא ומשפט מהחנות. אין חלונות שעות; את המועד סוגרים בשיחה.",
                "responses": {
                    "200": {
                        "description": "תוצאה",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "הכלי סגור כרגע"
                    },
                    "422": {
                        "description": "קלט לא תקין או רכיב לא זמין"
                    },
                    "429": {
                        "description": "יותר מדי בקשות"
                    }
                },
                "parameters": [
                    {
                        "name": "method",
                        "in": "query",
                        "required": false,
                        "description": "",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "delivery",
                                "pickup"
                            ]
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "required": false,
                        "description": "",
                        "schema": {
                            "type": "string",
                            "maxLength": 60
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "description": "",
                        "schema": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        }
                    }
                ]
            }
        }
    }
}
