{
    "openapi": "3.1.0",
    "info": {
        "title": "KvitkoDar Public Product API",
        "version": "1.0.0",
        "description": "Read-only access to published KvitkoDar products. No API key is required. The API never exposes customers, orders, accounts, or private inventory data."
    },
    "servers": [
        {
            "url": "https://kvitkodar.com.ua/wp-json/kvitkodar/v1"
        }
    ],
    "paths": {
        "/products": {
            "get": {
                "operationId": "listKvitkodarProducts",
                "summary": "List published products",
                "description": "Returns a paginated, optionally filtered list of public KvitkoDar products.",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 20,
                            "default": 10
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "description": "Product category slug.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of published products.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Product"
                                            }
                                        },
                                        "page": {
                                            "type": "integer"
                                        },
                                        "per_page": {
                                            "type": "integer"
                                        },
                                        "total_items": {
                                            "type": "integer"
                                        },
                                        "total_pages": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/products/{id}": {
            "get": {
                "operationId": "getKvitkodarProduct",
                "summary": "Get one published product",
                "description": "Returns public details for one published KvitkoDar product.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Published product.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Product"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Product not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded. Retry-After is returned.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Product": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "url",
                    "currency",
                    "in_stock",
                    "purchasable",
                    "categories",
                    "last_updated"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "summary": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "image": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri"
                    },
                    "price": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display price in the stated currency."
                    },
                    "currency": {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                    },
                    "in_stock": {
                        "type": "boolean"
                    },
                    "purchasable": {
                        "type": "boolean"
                    },
                    "categories": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "last_updated": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "Error": {
                "type": "object",
                "required": [
                    "code",
                    "message",
                    "data"
                ],
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "integer"
                            },
                            "resolution": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }
}