{
    "openapi": "3.1.0",
    "info": {
        "title": "zorem Docs API",
        "version": "1.0.0",
        "summary": "Read-only access to the documentation for zorem WooCommerce plugins.",
        "description": "Search and read the official documentation for zorem's WooCommerce plugins.\n\nDocs are hierarchical: top-level docs (parent = 0) are plugins, their children are sections, and sections contain articles. All endpoints are public, read-only and need no API key; only published content is returned.\n\nErrors are JSON objects with `code`, `message` and `data.status`. Every page is also available as Markdown by requesting its `link` with `Accept: text/markdown`.",
        "contact": {
            "name": "zorem",
            "url": "https://www.zorem.com/contact/",
            "email": "info@zorem.com"
        }
    },
    "servers": [
        {
            "url": "https://docs.zorem.com/wp-json",
            "description": "zorem Docs WordPress REST API"
        }
    ],
    "externalDocs": {
        "description": "Guide for AI agents",
        "url": "https://docs.zorem.com/llms.txt"
    },
    "tags": [
        {
            "name": "Docs",
            "description": "Plugins, sections and articles."
        },
        {
            "name": "Search",
            "description": "Full-text search."
        },
        {
            "name": "Categories",
            "description": "Plugin categories."
        }
    ],
    "paths": {
        "/wp/v2/search": {
            "get": {
                "operationId": "searchDocs",
                "tags": [
                    "Search"
                ],
                "summary": "Search documentation",
                "description": "Full-text search across published documentation. Set subtype=docs to return only documentation articles.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": true,
                        "description": "Search phrase.",
                        "schema": {
                            "type": "string",
                            "minLength": 1
                        },
                        "example": "tracking"
                    },
                    {
                        "name": "subtype",
                        "in": "query",
                        "description": "Limit results to documentation.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "docs"
                            ],
                            "default": "docs"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/perPage"
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching articles, best match first.",
                        "headers": {
                            "X-WP-Total": {
                                "description": "Total number of matching items.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-WP-TotalPages": {
                                "description": "Total number of pages.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/SearchResult"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid parameter. The body names the parameter and the rule it broke.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp/v2/docs": {
            "get": {
                "operationId": "listDocs",
                "tags": [
                    "Docs"
                ],
                "summary": "List docs",
                "description": "List published docs. Use parent=0 for the list of plugins, or parent=<id> for the sections or articles under a doc. Use _fields to keep responses small.",
                "parameters": [
                    {
                        "name": "parent",
                        "in": "query",
                        "description": "Parent doc ID. 0 returns the top-level plugin docs.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Find a doc by its URL slug, e.g. ast-pro.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Keyword filter.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "docs-category",
                        "in": "query",
                        "description": "Category ID (see listDocCategories).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "orderby",
                        "in": "query",
                        "description": "Sort field. menu_order matches the order shown on the site.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "menu_order",
                                "title",
                                "date",
                                "modified",
                                "relevance"
                            ],
                            "default": "date"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ],
                            "default": "desc"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/fields"
                    },
                    {
                        "$ref": "#/components/parameters/perPage"
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of docs.",
                        "headers": {
                            "X-WP-Total": {
                                "description": "Total number of matching items.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-WP-TotalPages": {
                                "description": "Total number of pages.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Doc"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid parameter. The body names the parameter and the rule it broke.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp/v2/docs/{id}": {
            "get": {
                "operationId": "getDoc",
                "tags": [
                    "Docs"
                ],
                "summary": "Get a doc",
                "description": "Get one published doc, including its rendered HTML content. For Markdown, request the doc's link with Accept: text/markdown.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Doc ID.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/fields"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The doc.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Doc"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No published doc with this ID (code rest_post_invalid_id).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp/v2/docs-category": {
            "get": {
                "operationId": "listDocCategories",
                "tags": [
                    "Categories"
                ],
                "summary": "List plugin categories",
                "description": "Categories that group the top-level plugin docs, e.g. Fulfillment & Shipping. Filter listDocs with docs-category=<id>.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/fields"
                    },
                    {
                        "$ref": "#/components/parameters/perPage"
                    },
                    {
                        "$ref": "#/components/parameters/page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of categories.",
                        "headers": {
                            "X-WP-Total": {
                                "description": "Total number of matching items.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-WP-TotalPages": {
                                "description": "Total number of pages.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Category"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid parameter. The body names the parameter and the rule it broke.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "parameters": {
            "perPage": {
                "name": "per_page",
                "in": "query",
                "description": "Items per page.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 10
                }
            },
            "page": {
                "name": "page",
                "in": "query",
                "description": "Page number.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                }
            },
            "fields": {
                "name": "_fields",
                "in": "query",
                "description": "Comma-separated fields to include, e.g. id,title,link,parent.",
                "schema": {
                    "type": "string"
                },
                "example": "id,title,link,parent"
            }
        },
        "schemas": {
            "Rendered": {
                "type": "object",
                "properties": {
                    "rendered": {
                        "type": "string",
                        "description": "HTML."
                    }
                }
            },
            "Doc": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "link": {
                        "type": "string",
                        "format": "uri",
                        "description": "Page URL. Request it with Accept: text/markdown for Markdown."
                    },
                    "parent": {
                        "type": "integer",
                        "description": "0 for a top-level plugin doc."
                    },
                    "menu_order": {
                        "type": "integer"
                    },
                    "date_gmt": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "modified_gmt": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "title": {
                        "$ref": "#/components/schemas/Rendered"
                    },
                    "excerpt": {
                        "$ref": "#/components/schemas/Rendered"
                    },
                    "content": {
                        "$ref": "#/components/schemas/Rendered"
                    },
                    "docs-category": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                }
            },
            "SearchResult": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Doc ID (use with getDoc)."
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "type": {
                        "type": "string"
                    },
                    "subtype": {
                        "type": "string"
                    }
                }
            },
            "Category": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "count": {
                        "type": "integer"
                    },
                    "link": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            },
            "Error": {
                "type": "object",
                "required": [
                    "code",
                    "message",
                    "data"
                ],
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "Machine-readable error code, e.g. rest_invalid_param.",
                        "examples": [
                            "rest_post_invalid_id"
                        ]
                    },
                    "message": {
                        "type": "string",
                        "description": "Human-readable explanation."
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "integer",
                                "description": "HTTP status code."
                            },
                            "params": {
                                "type": "object",
                                "description": "For invalid parameters: parameter name → what is wrong.",
                                "additionalProperties": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}