{
  "openapi": "3.1.0",
  "info": {
    "title": "TAGLI Semantic Commerce & Agentic Commerce API",
    "version": "3.3.0",
    "description": "Official machine-to-machine interface for TAGLI (Tzafon Mapping Systems Ltd., Company ID 512945767, Rosh Pina, Israel). Direct B2B manufacturing, industrial UV/DTF/Pad printing, fiber/CO2 laser engraving, server-validated tiered pricing (all-inclusive: product, branding, VAT, and doorstep delivery in ILS), official multi-item B2B quotes, MCP Streamable HTTP (2025-06-18), and Knowledge Graph 6. POLICY NOTICE: Autonomous ordering and autonomous payment are currently ON HOLD. AI agents may search, estimate, and create official quotes, while order execution and payment require human approval.",
    "contact": {
      "name": "TAGLI Machine Support",
      "email": "info@tagli.co.il",
      "url": "https://tagli.co.il/"
    },
    "x-tagli-components": {
      "mcp_server_version": "2.0.0",
      "mcp_protocol_version": "2025-06-18",
      "mcp_tools_count": 10,
      "agentic_commerce_version": "2.0.0",
      "machine_search_version": "4.0",
      "knowledge_graph_version": "6.0",
      "quote_builder_version": "2.1.0"
    },
    "x-tagli-policy": {
      "catalog_search": "ACTIVE",
      "price_estimate": "ACTIVE",
      "official_quote": "ACTIVE",
      "public_quote_pdf": "ACTIVE",
      "autonomous_ordering": "HOLD",
      "autonomous_payment": "HOLD",
      "human_approval_required": true
    }
  },
  "servers": [
    {
      "url": "https://tagli.co.il",
      "description": "Production Server"
    }
  ],
  "externalDocs": {
    "description": "TAGLI AI Transparency & Live Architecture",
    "url": "https://tagli.co.il/ai-transparency/"
  },
  "tags": [
    {
      "name": "Discovery",
      "description": "Corporate identity, capabilities, and machine discovery endpoints."
    },
    {
      "name": "Catalog",
      "description": "Machine-readable product catalog and single-product canonical contracts (BuyAction V2 / V3)."
    },
    {
      "name": "Search",
      "description": "Fast machine search engine (v4.0) for resolving product IDs."
    },
    {
      "name": "KG",
      "description": "Semantic Knowledge Graph (KG6) linking products, materials, printing methods, and offers."
    },
    {
      "name": "MCP",
      "description": "Model Context Protocol (v2.0.0, Streamable HTTP 2025-06-18, JSON-RPC 2.0) discovery and protocol endpoint."
    },
    {
      "name": "Quotes",
      "description": "Agentic Commerce REST (v2.0.0) handshake, server-validated estimates, official B2B quotes, and status."
    },
    {
      "name": "PDF",
      "description": "Public quote PDF delivery endpoint via REST."
    },
    {
      "name": "Restricted/HOLD",
      "description": "Endpoints currently on operational HOLD (autonomous ordering) or restricted to human OTP verification flows."
    }
  ],
  "paths": {
    "/machine-search.json": {
      "get": {
        "tags": [
          "Search"
        ],
        "summary": "Fast Machine Search Engine",
        "description": "Search promotional products, branded gifts, apparel, lighters, and thermal bottles by keyword (Machine Search 4.0).",
        "operationId": "searchProducts",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search keyword in Hebrew or English.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of search results to return (default 10).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of matching products with IDs, titles, base prices, and links.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MachineSearchResponse"
                }
              }
            }
          }
        }
      }
    },
    "/products.json": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Fetch Full Catalog or Single Product Contract",
        "description": "Returns the complete machine-readable product catalog (`ProductDataFeed`), or a full single-product contract (`ProductDataItem`) with live tiered pricing (all-inclusive: product, branding, VAT, and doorstep delivery) and BuyAction V2 / V3 configuration rules when queried with an `id` parameter.",
        "operationId": "getProducts",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Product ID (e.g. 1175, 6668, 3990). When provided, returns the single-product contract.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with product catalog or single-product contract JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ProductCatalogResponse"
                    },
                    {
                      "$ref": "#/components/schemas/SingleProductResponse"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Product not found when an invalid id is requested.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/tagli-capabilities.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Factory Capabilities & Logistics Authority",
        "description": "Returns verified operational capabilities: UV flatbed, DTF textile, TOSH pad printing, laser fiber/CO2, delivery policies (Gal Delivery), and official endpoints.",
        "operationId": "getCapabilities",
        "responses": {
          "200": {
            "description": "Detailed factory capabilities and official endpoints registry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/tagli-data.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Corporate Identity & Authority Registry",
        "description": "Official company registration (512945767), brand identity, Google Knowledge Graph IDs, and official communication channels.",
        "operationId": "getIdentity",
        "responses": {
          "200": {
            "description": "Corporate identity JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/kg": {
      "get": {
        "tags": [
          "KG"
        ],
        "summary": "Full Semantic Knowledge Graph (KG6)",
        "description": "Returns the complete directional semantic graph of TAGLI connecting products, materials, printing techniques, and commercial offers.",
        "operationId": "getKnowledgeGraph",
        "responses": {
          "200": {
            "description": "Knowledge Graph JSON-LD representation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/mcp-manifest": {
      "get": {
        "tags": [
          "MCP",
          "Discovery"
        ],
        "summary": "MCP Server Discovery Manifest",
        "description": "Returns the TAGLI MCP Server manifest (v2.0.0, protocol 2025-06-18) including the 10 registered MCP tools and input schemas.",
        "operationId": "getMcpManifest",
        "responses": {
          "200": {
            "description": "MCP manifest JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpManifest"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/mcp-status": {
      "get": {
        "tags": [
          "MCP",
          "Discovery"
        ],
        "summary": "MCP Server Health & Status",
        "description": "Returns live health, server version (2.0.0), transport (streamable-http), protocol version (2025-06-18), and Agentic Commerce bridge status.",
        "operationId": "getMcpStatus",
        "responses": {
          "200": {
            "description": "MCP status JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpStatus"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/mcp": {
      "get": {
        "tags": [
          "MCP"
        ],
        "summary": "MCP Streamable HTTP GET (Method Not Allowed)",
        "description": "Per MCP Streamable HTTP specification (2025-06-18), GET returns HTTP 405 because unsolicited server-to-client SSE streams are not offered.",
        "operationId": "getMcpServerMethodNotAllowed",
        "responses": {
          "405": {
            "description": "Method Not Allowed (`Allow: POST, DELETE, OPTIONS`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "MCP"
        ],
        "summary": "MCP Streamable HTTP Protocol Endpoint (JSON-RPC 2.0)",
        "description": "Model Context Protocol endpoint using Streamable HTTP (protocol 2025-06-18) over JSON-RPC 2.0. Sequence: 1) Call `initialize` (returns `Mcp-Session-Id` header); 2) Echo `Mcp-Session-Id` on `notifications/initialized`, `tools/list`, and `tools/call`. Optional agent credentials may be supplied via `X-Tagli-Agent-Key` or `X-Tagli-Delegation-Token` headers. Active tools: `search_products`, `get_product`, `get_business_profile`, `get_capabilities`, `get_commercial_offer`, `agentic_handshake`, `agentic_estimate`, `agentic_quote` (write), `agentic_order_status`. Restricted/HOLD tool: `agentic_order_intent` (returns HOLD).",
        "operationId": "callMcpServer",
        "x-tagli-mcp-tools": [
          {
            "name": "search_products",
            "mode": "read",
            "status": "ACTIVE"
          },
          {
            "name": "get_product",
            "mode": "read",
            "status": "ACTIVE"
          },
          {
            "name": "get_business_profile",
            "mode": "read",
            "status": "ACTIVE"
          },
          {
            "name": "get_capabilities",
            "mode": "read",
            "status": "ACTIVE"
          },
          {
            "name": "get_commercial_offer",
            "mode": "read",
            "status": "ACTIVE"
          },
          {
            "name": "agentic_handshake",
            "mode": "read",
            "status": "ACTIVE"
          },
          {
            "name": "agentic_estimate",
            "mode": "read",
            "status": "ACTIVE"
          },
          {
            "name": "agentic_quote",
            "mode": "write",
            "status": "ACTIVE"
          },
          {
            "name": "agentic_order_intent",
            "mode": "write",
            "status": "HOLD"
          },
          {
            "name": "agentic_order_status",
            "mode": "read",
            "status": "ACTIVE"
          }
        ],
        "parameters": [
          {
            "name": "Mcp-Session-Id",
            "in": "header",
            "required": false,
            "description": "Session identifier returned by `initialize`; required on subsequent calls.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "MCP-Protocol-Version",
            "in": "header",
            "required": false,
            "description": "Supported protocol version (`2025-06-18` or `2025-03-26`).",
            "schema": {
              "type": "string",
              "enum": [
                "2025-06-18",
                "2025-03-26"
              ]
            }
          }
        ],
        "security": [
          {},
          {
            "TagliAgentKey": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpJsonRpcRequest"
              },
              "examples": {
                "initialize": {
                  "summary": "Initialize MCP session",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "initialize",
                    "params": {
                      "protocolVersion": "2025-06-18",
                      "capabilities": {},
                      "clientInfo": {
                        "name": "example-agent",
                        "version": "1.0"
                      }
                    }
                  }
                },
                "tools_list": {
                  "summary": "List available MCP tools",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 2,
                    "method": "tools/list",
                    "params": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response (either result or error).",
            "headers": {
              "Mcp-Session-Id": {
                "description": "Issued or active MCP session ID.",
                "schema": {
                  "type": "string"
                }
              },
              "MCP-Protocol-Version": {
                "description": "Negotiated MCP protocol version.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpJsonRpcResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted JSON-RPC notification (empty body)."
          },
          "400": {
            "description": "Invalid JSON-RPC request, batch array, or missing session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpJsonRpcResponse"
                }
              }
            }
          },
          "401": {
            "description": "Revoked MCP session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Disallowed browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or expired MCP session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "406": {
            "description": "Unsupported Accept header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type (requires application/json).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "MCP initialization rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpJsonRpcResponse"
                }
              }
            }
          },
          "503": {
            "description": "MCP session store unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "MCP"
        ],
        "summary": "Terminate MCP Session",
        "description": "Explicitly terminates an active MCP session identified by `Mcp-Session-Id`.",
        "operationId": "deleteMcpSession",
        "parameters": [
          {
            "name": "Mcp-Session-Id",
            "in": "header",
            "required": true,
            "description": "Active MCP session ID to terminate.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Session terminated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "session_terminated"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing `Mcp-Session-Id` header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Session already revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Session not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Session store error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/agent/handshake": {
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "Agent Handshake & Policy Discovery",
        "description": "Initializes an Agentic Commerce session. Without credentials, authenticates as a public anonymous agent (Tier A) allowed to browse, estimate, and create official quotes. With `X-Tagli-Agent-Key` or `Authorization: Bearer` plus `principal` and `mandate`, issues a partner `session_token`.",
        "operationId": "agentHandshake",
        "security": [
          {},
          {
            "TagliAgentKey": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "principal": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "mandate": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Handshake accepted (public Tier A or verified partner session).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentHandshake"
                }
              }
            }
          },
          "401": {
            "description": "Invalid agent credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized delegation mandate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid legal entity details for partner handshake.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/agent/estimate": {
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "Server-Validated Price Estimate (Read-Only)",
        "description": "Calculates a server-validated B2B price estimate (all-inclusive in ILS: product, branding, VAT, and delivery) for either a single product (`product_id` + `quantity`) or multiple products (`items` array, default max 25 lines). When `items` is provided, the server processes `items` with priority over single-item fields. Does not persist a quote or send emails.",
        "operationId": "agentEstimate",
        "security": [
          {},
          {
            "TagliAgentKey": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EstimateRequest"
              },
              "examples": {
                "single_standard_v2": {
                  "summary": "Single standard product (1175 calculator, qty 100)",
                  "value": {
                    "product_id": 1175,
                    "quantity": 100,
                    "options": {
                      "variation_id": 1176
                    }
                  }
                },
                "multi_item_v2_and_v3": {
                  "summary": "Multi-item estimate (1175 + 6668 red V2 + 3990 red apparel V3)",
                  "value": {
                    "items": [
                      {
                        "product_id": 1175,
                        "quantity": 100,
                        "options": {
                          "variation_id": 1176
                        }
                      },
                      {
                        "product_id": 6668,
                        "quantity": 100,
                        "options": {
                          "color": "אדום"
                        }
                      },
                      {
                        "product_id": 3990,
                        "quantity": 25,
                        "options": {
                          "color": "אדום",
                          "branding": "front",
                          "sleeve": 0,
                          "sizes": {
                            "S": 5,
                            "M": 8,
                            "L": 7,
                            "XL": 4,
                            "XXL": 1
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Server-validated price estimate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request parameters or exceeded max items per quote.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Business validation error (invalid quantity tier, color, branding, or apparel size sum).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/agent/quote": {
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "Create Official Persisted Multi-Item B2B Quote (WRITE ACTION)",
        "description": "WRITE OPERATION: Creates a persisted, HMAC-signed official quote in TAGLI Quote Builder and returns `quote_id`, `quote_number`, `qb_share_url`, and `qb_pdf_url`. Requires either `items` (prioritized if present) or (`product_id` + `quantity`). Public anonymous callers are permitted (rate-limited to 15 quotes per 10 minutes per IP). Do NOT invoke during read-only discovery checks. Email dispatch occurs only if `customer_contact.email_dispatch_consent` is true.",
        "operationId": "agentQuote",
        "security": [
          {},
          {
            "TagliSession": []
          },
          {
            "TagliAgentKey": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              },
              "examples": {
                "multi_item_quote": {
                  "summary": "Official multi-item quote (1175 + 6668 + 3990)",
                  "value": {
                    "idempotency_key": "example-quote-2026-11-14-001",
                    "items": [
                      {
                        "product_id": 1175,
                        "quantity": 100,
                        "options": {
                          "variation_id": 1176
                        }
                      },
                      {
                        "product_id": 6668,
                        "quantity": 100,
                        "options": {
                          "color": "אדום"
                        }
                      },
                      {
                        "product_id": 3990,
                        "quantity": 25,
                        "options": {
                          "color": "אדום",
                          "branding": "front",
                          "sleeve": 0,
                          "sizes": {
                            "S": 5,
                            "M": 8,
                            "L": 7,
                            "XL": 4,
                            "XXL": 1
                          }
                        }
                      }
                    ],
                    "customer_contact": {
                      "name": "Example Contact",
                      "company": "Example Corp Ltd",
                      "email_dispatch_consent": false
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Official locked quote created.",
            "headers": {
              "X-Tagli-Session": {
                "description": "Active or assigned session ID.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or too many quote items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid/expired `X-Tagli-Session` or invalid agent key when provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key collision or payload mismatch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Business validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Public quote rate limit exceeded (15 quotes per 10 minutes per IP).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/agent/status": {
      "get": {
        "tags": [
          "Quotes"
        ],
        "summary": "Query Quote / Transaction Status (GET)",
        "description": "Returns sanitized lifecycle status for a quote created by the authenticated agent/session. Requires `X-Tagli-Session` or registered agent credentials (`X-Tagli-Agent-Key` / `Bearer`). Payment URLs, OTP codes, and private tokens are withheld.",
        "operationId": "getAgentStatus",
        "security": [
          {
            "TagliSession": []
          },
          {
            "TagliAgentKey": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "quote_id",
            "in": "query",
            "required": true,
            "description": "Agentic `quote_id` to inspect.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized transaction status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentStatus"
                }
              }
            }
          },
          "400": {
            "description": "Missing `quote_id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid session / registered agent key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — quote belongs to a different agent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Quote not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "Query Quote / Transaction Status (POST)",
        "description": "POST variant of `/agent/status`. Accepts `quote_id` in the JSON body. Requires `X-Tagli-Session` or registered agent credentials (`X-Tagli-Agent-Key` / `Bearer`).",
        "operationId": "postAgentStatus",
        "security": [
          {
            "TagliSession": []
          },
          {
            "TagliAgentKey": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "quote_id"
                ],
                "properties": {
                  "quote_id": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sanitized transaction status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentStatus"
                }
              }
            }
          },
          "400": {
            "description": "Missing `quote_id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid session / registered agent key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — quote belongs to a different agent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Quote not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/public-quote/{quote_id}/pdf": {
      "get": {
        "tags": [
          "PDF"
        ],
        "summary": "Download Official Quote PDF",
        "description": "Serves the binary PDF document for an official TAGLI Quote Builder quote via the public REST route. Authentication uses the `QuotePdfToken` security scheme (`token` query parameter) to prevent duplicate parameter transmission in OpenAPI clients. Note: External non-Israeli network acceptance testing is pending verification (NOT VERIFIED).",
        "operationId": "getPublicQuotePdf",
        "security": [
          {
            "QuotePdfToken": []
          }
        ],
        "parameters": [
          {
            "name": "quote_id",
            "in": "path",
            "required": true,
            "description": "Numeric Quote Builder post ID (`qb_quote_id`).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Binary PDF document (`%PDF-`).",
            "headers": {
              "Cache-Control": {
                "description": "Private no-store cache directive.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Robots-Tag": {
                "description": "noindex, nofollow directive.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "description": "Inline PDF filename.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "description": "Missing or invalid quote access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Quote not found or failed origin validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "PDF generation failed or produced invalid output.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Public PDF engine hook is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/agent/order-intent": {
      "post": {
        "tags": [
          "Restricted/HOLD"
        ],
        "summary": "Autonomous Order Intent (CURRENTLY ON HOLD)",
        "description": "OPERATIONAL STATUS: ON HOLD. Registered in REST index, but autonomous ordering is disabled by TAGLI management policy. Calling this endpoint returns HTTP 403 with `status: hold` and `code: autonomous_ordering_on_hold`.",
        "operationId": "agentOrderIntent",
        "security": [
          {
            "TagliSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderIntentRequest"
              }
            }
          }
        },
        "responses": {
          "403": {
            "description": "Autonomous ordering is currently ON HOLD.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HoldResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid `X-Tagli-Session` (when HOLD is lifted in future).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/human/request-otp": {
      "post": {
        "tags": [
          "Restricted/HOLD"
        ],
        "summary": "Human Verification: Request OTP (Restricted Human Flow)",
        "description": "Restricted human-in-the-loop verification step. Not an autonomous AI agent action. Requires a valid `order_id` and `review_token` from an authorized human review page.",
        "operationId": "humanRequestOtp",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HumanRequestOtpRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP dispatched to authorized officer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HumanActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing `order_id` or `review_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "OTP request rejected (invalid token, rate limit, or state).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/human/approve": {
      "post": {
        "tags": [
          "Restricted/HOLD"
        ],
        "summary": "Human Verification: Approve Order (Restricted Human Flow)",
        "description": "Restricted human-in-the-loop approval step. Not an autonomous AI agent action. Requires `order_id`, `review_token`, and human `otp_code`.",
        "operationId": "humanApprove",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HumanApproveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Human approval recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HumanActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields (`order_id`, `review_token`, `otp_code`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "OTP verification failed or invalid order state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/tagli/v1/human/reject": {
      "post": {
        "tags": [
          "Restricted/HOLD"
        ],
        "summary": "Human Verification: Reject or Request Revision (Restricted Human Flow)",
        "description": "Restricted human-in-the-loop rejection step. Not an autonomous AI agent action. Requires `order_id`, `review_token`, and human `otp_code`.",
        "operationId": "humanReject",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HumanRejectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rejection or revision request recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HumanActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields (`order_id`, `review_token`, `otp_code`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "OTP verification failed or invalid order state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "TagliAgentKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Tagli-Agent-Key",
        "description": "Optional registered agent API key (`tak_...`). Preferred over Authorization header on Basic-Auth-protected environments."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Optional registered agent Bearer token."
      },
      "TagliSession": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Tagli-Session",
        "description": "Session token (`SES-...`) issued by `/agent/handshake` for partner/authenticated flows."
      },
      "QuotePdfToken": {
        "type": "apiKey",
        "in": "query",
        "name": "token",
        "description": "Secret per-quote access token required for `/public-quote/{quote_id}/pdf`."
      }
    },
    "schemas": {
      "ProductIdentity": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "product_entity_id": {
            "type": "string",
            "format": "uri"
          },
          "status": {
            "type": "string"
          },
          "catalog_visibility": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "ProductClassification": {
        "type": "object",
        "properties": {
          "commercial_type": {
            "type": "string",
            "description": "e.g. 'standard' (V2) or 'apparel' (V3)."
          },
          "woo_type": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "ProductOffer": {
        "type": "object",
        "description": "Commercial offer tier (BuyAction V2 standard variation offer or V3 apparel package offer).",
        "properties": {
          "offer_id": {
            "type": "string"
          },
          "variation_id": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "quantity": {
            "type": [
              "integer",
              "null"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "base_unit_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "unit_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "box_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "branding_id": {
            "type": "string"
          },
          "branding_label": {
            "type": "string"
          },
          "sleeve_available": {
            "type": "boolean"
          },
          "sleeve_surcharge_per_unit": {
            "type": "number"
          },
          "size_surcharges": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "currency": {
            "type": "string",
            "const": "ILS"
          },
          "availability": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "attributes": {
            "type": [
              "object",
              "array"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "valid_from": {
            "type": "string"
          },
          "valid_through": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "BuyAction": {
        "type": "object",
        "description": "Executable BuyAction contract (Schema.org BuyAction for V2 standard, or `tagli_apparel_configurator_url_v1` for V3 apparel).",
        "properties": {
          "@type": {
            "type": "string"
          },
          "@id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "target": {
            "type": "object",
            "additionalProperties": true
          },
          "url_templates": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "parameters": {
            "type": "object",
            "additionalProperties": true
          },
          "rules": {
            "type": "object",
            "additionalProperties": true
          },
          "agent_instructions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": true
      },
      "ProductCommercial": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "const": "ILS"
          },
          "price_min": {
            "type": "number"
          },
          "price_max": {
            "type": "number"
          },
          "stock_status": {
            "type": "string"
          },
          "offer_count": {
            "type": "integer"
          },
          "price_policy": {
            "$ref": "#/components/schemas/PricePolicy"
          },
          "apparel": {
            "type": "object",
            "description": "Present on V3 apparel products: colors, sizes, quantity_targets, branding_packages, addons, specifications.",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "Product": {
        "type": "object",
        "properties": {
          "schema_version": {
            "type": "string"
          },
          "identity": {
            "$ref": "#/components/schemas/ProductIdentity"
          },
          "classification": {
            "$ref": "#/components/schemas/ProductClassification"
          },
          "content": {
            "type": "object",
            "additionalProperties": true
          },
          "taxonomy": {
            "type": "object",
            "additionalProperties": true
          },
          "media": {
            "type": "object",
            "additionalProperties": true
          },
          "commercial": {
            "$ref": "#/components/schemas/ProductCommercial"
          },
          "offers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductOffer"
            }
          },
          "buy_actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BuyAction"
            }
          },
          "svc": {
            "type": [
              "object",
              "array"
            ]
          },
          "entity_links": {
            "type": "object",
            "additionalProperties": true
          },
          "source_state": {
            "type": "object",
            "additionalProperties": true
          },
          "diagnostics": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "ProductCatalogResponse": {
        "type": "object",
        "required": [
          "type",
          "products"
        ],
        "properties": {
          "@context": {
            "type": "object",
            "additionalProperties": true
          },
          "type": {
            "type": "string",
            "const": "ProductDataFeed"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "brand": {
            "type": "object",
            "additionalProperties": true
          },
          "organization": {
            "type": "object",
            "additionalProperties": true
          },
          "source_of_truth": {
            "type": "boolean"
          },
          "generated_at": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "const": "ILS"
          },
          "products_count": {
            "type": "integer"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          }
        },
        "additionalProperties": true
      },
      "SingleProductResponse": {
        "type": "object",
        "required": [
          "type",
          "product"
        ],
        "properties": {
          "@context": {
            "type": "object",
            "additionalProperties": true
          },
          "type": {
            "type": "string",
            "const": "ProductDataItem"
          },
          "source_of_truth": {
            "type": "boolean"
          },
          "generated_at": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "const": "ILS"
          },
          "product": {
            "$ref": "#/components/schemas/Product"
          }
        },
        "additionalProperties": true
      },
      "MachineSearchResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "numberOfItems": {
            "type": "integer"
          },
          "generated_at": {
            "type": "string"
          },
          "itemListElement": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "ProductOptions": {
        "type": "object",
        "description": "Product configuration options. For standard products (BuyAction V2): use `variation_id` and/or attribute `color` (e.g. cap color). For apparel products (BuyAction V3): use `color`, `branding` (`front`, `back`, `front_back`), `sleeve` (`0` or `1`), and `sizes` (non-negative integers whose sum must equal the line `quantity`).",
        "properties": {
          "variation_id": {
            "type": "integer",
            "minimum": 1
          },
          "color": {
            "type": "string"
          },
          "branding": {
            "type": "string"
          },
          "sleeve": {
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          "sizes": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "additionalProperties": false
      },
      "ValidatedOptions": {
        "type": "object",
        "description": "Server-validated and normalized product options.",
        "properties": {
          "variation_id": {
            "type": "integer"
          },
          "color": {
            "type": "string"
          },
          "color_name": {
            "type": "string"
          },
          "branding": {
            "type": "string"
          },
          "sleeve": {
            "type": "integer"
          },
          "sizes": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "additionalProperties": true
      },
      "QuoteItem": {
        "type": "object",
        "required": [
          "product_id",
          "quantity"
        ],
        "properties": {
          "product_id": {
            "type": "integer",
            "minimum": 1
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          },
          "options": {
            "$ref": "#/components/schemas/ProductOptions"
          }
        }
      },
      "CustomerContact": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phone": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "email_dispatch_consent": {
            "type": "boolean",
            "description": "Must be true on `/agent/quote` to dispatch an email copy to `email`."
          }
        },
        "additionalProperties": true
      },
      "PricePolicy": {
        "type": "object",
        "properties": {
          "all_inclusive": {
            "type": "boolean"
          },
          "includes_vat": {
            "type": "boolean"
          },
          "includes_branding": {
            "type": "boolean"
          },
          "includes_shipping_to_business": {
            "type": "boolean"
          },
          "currency": {
            "type": "string",
            "const": "ILS"
          },
          "note": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "EstimateRequest": {
        "type": "object",
        "description": "Requires either `items` (non-empty array, prioritized if present; default server max 25 lines) or both `product_id` and `quantity` (positive integers).",
        "properties": {
          "product_id": {
            "type": "integer",
            "minimum": 1
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          },
          "options": {
            "$ref": "#/components/schemas/ProductOptions"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
              "$ref": "#/components/schemas/QuoteItem"
            }
          },
          "customer_contact": {
            "$ref": "#/components/schemas/CustomerContact"
          }
        },
        "oneOf": [
          {
            "required": [
              "items"
            ]
          },
          {
            "required": [
              "product_id",
              "quantity"
            ],
            "not": {
              "required": [
                "items"
              ]
            }
          }
        ]
      },
      "EstimateResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "is_multi_item": {
            "type": "boolean"
          },
          "product_id": {
            "type": "integer"
          },
          "variation_id": {
            "type": "integer"
          },
          "product_name": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "item_count": {
            "type": "integer"
          },
          "total_quantity": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "validated_options": {
            "$ref": "#/components/schemas/ValidatedOptions"
          },
          "pricing_model": {
            "type": "string"
          },
          "estimated_total_ils": {
            "type": "number"
          },
          "estimated_unit_ils": {
            "type": "number"
          },
          "price_policy": {
            "$ref": "#/components/schemas/PricePolicy"
          },
          "dispatch": {
            "type": "object",
            "properties": {
              "email_dispatched": {
                "type": "boolean"
              },
              "dispatched_to": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "notice": {
                "type": "string"
              }
            }
          },
          "note": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "QuoteRequest": {
        "type": "object",
        "description": "Requires either `items` (non-empty array, prioritized if present; default server max 25 lines) or both `product_id` and `quantity` (positive integers).",
        "properties": {
          "product_id": {
            "type": "integer",
            "minimum": 1
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          },
          "options": {
            "$ref": "#/components/schemas/ProductOptions"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
              "$ref": "#/components/schemas/QuoteItem"
            }
          },
          "customer_contact": {
            "$ref": "#/components/schemas/CustomerContact"
          },
          "idempotency_key": {
            "type": "string"
          }
        },
        "oneOf": [
          {
            "required": [
              "items"
            ]
          },
          {
            "required": [
              "product_id",
              "quantity"
            ],
            "not": {
              "required": [
                "items"
              ]
            }
          }
        ]
      },
      "QuoteResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "quote_id": {
            "type": "string"
          },
          "quote_number": {
            "type": "string"
          },
          "qb_quote_id": {
            "type": "integer"
          },
          "is_multi_item": {
            "type": "boolean"
          },
          "item_count": {
            "type": "integer"
          },
          "total_quantity": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "product_id": {
            "type": "integer"
          },
          "variation_id": {
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "validated_options": {
            "$ref": "#/components/schemas/ValidatedOptions"
          },
          "unit_price": {
            "type": "number"
          },
          "price_total": {
            "type": "number"
          },
          "currency": {
            "type": "string",
            "const": "ILS"
          },
          "price_policy": {
            "$ref": "#/components/schemas/PricePolicy"
          },
          "qb_share_url": {
            "type": "string",
            "format": "uri"
          },
          "qb_pdf_url": {
            "type": "string",
            "format": "uri"
          },
          "dispatch": {
            "type": "object",
            "properties": {
              "email_dispatched": {
                "type": "boolean"
              },
              "dispatched_to": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "notice": {
                "type": "string"
              }
            }
          },
          "issued_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": true
      },
      "AgentHandshake": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "tier": {
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "session_token": {
            "type": "string"
          },
          "principal_verified": {
            "type": "boolean"
          },
          "authorized": {
            "type": "boolean"
          },
          "allowed_actions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "policy": {
            "type": "object",
            "additionalProperties": true
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "AgentStatus": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "identifiers": {
            "type": "object",
            "properties": {
              "agent_id": {
                "type": "string"
              },
              "principal_reg_id": {
                "type": "string"
              },
              "agentic_quote_id": {
                "type": "string"
              },
              "qb_quote_id": {
                "type": "integer"
              },
              "order_id": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "transaction_state": {
            "type": "string"
          },
          "approval_status": {
            "type": "string"
          },
          "production_status": {
            "type": "string"
          },
          "customer_feedback": {
            "type": [
              "object",
              "null"
            ]
          },
          "commercial_summary": {
            "type": "object",
            "additionalProperties": true
          },
          "withheld_fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "privacy_notice": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "HoldResponse": {
        "type": "object",
        "required": [
          "status",
          "code",
          "message"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "hold"
          },
          "code": {
            "type": "string",
            "const": "autonomous_ordering_on_hold"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "OrderIntentRequest": {
        "type": "object",
        "required": [
          "quote_id"
        ],
        "properties": {
          "quote_id": {
            "type": "string"
          },
          "server_signature": {
            "type": "string"
          }
        }
      },
      "HumanRequestOtpRequest": {
        "type": "object",
        "required": [
          "order_id",
          "review_token"
        ],
        "properties": {
          "order_id": {
            "type": "integer",
            "minimum": 1
          },
          "review_token": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "type": "string",
            "format": "email"
          }
        }
      },
      "HumanApproveRequest": {
        "type": "object",
        "required": [
          "order_id",
          "review_token",
          "otp_code"
        ],
        "properties": {
          "order_id": {
            "type": "integer",
            "minimum": 1
          },
          "review_token": {
            "type": "string",
            "minLength": 1
          },
          "otp_code": {
            "type": "string",
            "minLength": 1
          },
          "checklist": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "HumanRejectRequest": {
        "type": "object",
        "required": [
          "order_id",
          "review_token",
          "otp_code"
        ],
        "properties": {
          "order_id": {
            "type": "integer",
            "minimum": 1
          },
          "review_token": {
            "type": "string",
            "minLength": 1
          },
          "otp_code": {
            "type": "string",
            "minLength": 1
          },
          "decision": {
            "type": "string",
            "enum": [
              "reject",
              "revision"
            ]
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "HumanActionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "McpJsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string",
              "null"
            ]
          },
          "method": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "McpJsonRpcErrorObject": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "data": {}
        },
        "additionalProperties": true
      },
      "McpJsonRpcResponse": {
        "type": "object",
        "description": "JSON-RPC 2.0 response distinguishing strictly between success (`result`) and error (`error`).",
        "properties": {
          "jsonrpc": {
            "type": "string",
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string",
              "null"
            ]
          },
          "result": {
            "type": "object",
            "additionalProperties": true
          },
          "error": {
            "$ref": "#/components/schemas/McpJsonRpcErrorObject"
          }
        },
        "oneOf": [
          {
            "required": [
              "jsonrpc",
              "id",
              "result"
            ],
            "not": {
              "required": [
                "error"
              ]
            }
          },
          {
            "required": [
              "jsonrpc",
              "id",
              "error"
            ],
            "not": {
              "required": [
                "result"
              ]
            }
          }
        ]
      },
      "McpManifest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "official_domain": {
            "type": "string",
            "format": "uri"
          },
          "legal_entity": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          },
          "endpoint": {
            "type": "string",
            "format": "uri"
          },
          "discovery_url": {
            "type": "string",
            "format": "uri"
          },
          "status_url": {
            "type": "string",
            "format": "uri"
          },
          "protocol_version": {
            "type": "string"
          },
          "supported_protocol_versions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "auth_model": {
            "type": "string"
          },
          "agentic_commerce_connected": {
            "type": "boolean"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "McpStatus": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "server": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          },
          "protocol": {
            "type": "string"
          },
          "supported_protocol_versions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "agentic_commerce_connected": {
            "type": "boolean"
          },
          "endpoint": {
            "type": "string",
            "format": "uri"
          },
          "manifest_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": true
      }
    }
  }
}
