{
    "openapi": "3.1.0",
    "info": {
        "title": "Medilife Online Public Store API",
        "version": "2026-08-22",
        "description": "Read-only public product discovery for the Medilife Online catalogue. Cart, checkout, accounts, orders, payments, returns, inventory changes, webhooks, and other state-changing operations are outside this public interface.",
        "contact": {
            "name": "Medilife Online",
            "url": "https://medilifeonline.shop/contact-us/",
            "email": "sales@medilifeonline.in"
        }
    },
    "servers": [
        {
            "url": "https://medilifeonline.shop/wp-json/wc/store/v1"
        }
    ],
    "paths": {
        "/products": {
            "get": {
                "operationId": "searchMedilifeOnlineProducts",
                "summary": "Search the public Medilife Online product catalogue",
                "description": "Returns current public product records. Use the canonical permalink in each record for the customer-facing product page. This operation does not diagnose, prescribe, or provide medical advice.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Product, brand, remedy, medicine, or category search text.",
                        "schema": {
                            "type": "string",
                            "minLength": 1
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "required": false,
                        "description": "One or more comma-separated product slugs.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Results page number.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Number of products to return.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Public product records.",
                        "headers": {
                            "X-WP-Total": {
                                "description": "Total matching records.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-WP-TotalPages": {
                                "description": "Total matching pages.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/PublicProduct"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid query parameter."
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "PublicProduct": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "slug",
                    "permalink",
                    "prices",
                    "is_in_stock"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "permalink": {
                        "type": "string",
                        "format": "uri"
                    },
                    "short_description": {
                        "type": "string"
                    },
                    "prices": {
                        "$ref": "#/components/schemas/ProductPrices"
                    },
                    "is_in_stock": {
                        "type": "boolean"
                    },
                    "images": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "src": {
                                    "type": "string",
                                    "format": "uri"
                                },
                                "alt": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "ProductPrices": {
                "type": "object",
                "required": [
                    "price",
                    "currency_code",
                    "currency_minor_unit"
                ],
                "properties": {
                    "price": {
                        "type": "string",
                        "description": "Price in the smallest currency unit. Apply currency_minor_unit for display."
                    },
                    "regular_price": {
                        "type": "string"
                    },
                    "sale_price": {
                        "type": "string"
                    },
                    "currency_code": {
                        "type": "string",
                        "example": "INR"
                    },
                    "currency_minor_unit": {
                        "type": "integer",
                        "example": 2
                    }
                }
            }
        }
    },
    "externalDocs": {
        "description": "Medilife Online developer resources",
        "url": "https://medilifeonline.shop/developers/"
    }
}
