{ "openapi": "3.0.3", "info": { "title": "AI Order Management API", "version": "1.0.0", "description": "Authenticated order management actions available to the local agent." }, "servers": [ { "url": "https://hnsuxguzwibnxhumedhs.supabase.co/functions/v1", "description": "Supabase Edge Functions backend for WebMCP tool execution" } ], "security": [ { "bearerAuth": [] } ], "x-webmcp-ui": { "routes": { "dashboard": "/dashboard", "orders": "/orders", "admin": "/admin" }, "actions": { "createOrder": { "route": "/orders", "fields": { "customer_name": [ "Customer name", "Customer" ], "amount": [ "Amount", "Order amount" ] }, "submit": [ "Create order" ], "notes": "Create orders from the orders page form." }, "searchOrders": { "route": "/orders", "fields": { "query": [ "Search orders", "Customer name", "Status", "Order id" ] }, "submit": [ "Search" ], "notes": "Search by customer name, status, order id, or partial text." }, "listOrders": { "route": "/orders", "submit": [ "List orders" ], "notes": "List the latest orders for filtering or duplicate checks." }, "getOrderStatus": { "route": "/orders", "fields": { "id": [ "Order id", "Order UUID" ] }, "submit": [ "Get status" ], "notes": "Resolve the order first if the user only provided a name." }, "updateOrderStatus": { "route": "/orders", "fields": { "status": [ "Status" ], "id": [ "Order id", "Order UUID" ] }, "submit": [ "Update status" ], "notes": "Select the target order row before changing its status." }, "deleteOrder": { "route": "/admin", "fields": { "id": [ "Order id", "Order UUID" ] }, "submit": [ "Delete" ], "notes": "Delete the selected order from the admin page." }, "approveRefund": { "route": "/admin", "fields": { "id": [ "Order id", "Order UUID" ] }, "submit": [ "Approve refund" ], "notes": "Approve the refund for the selected order." }, "updateQuota": { "route": "/admin", "fields": { "user_id": [ "User id", "Application user UUID" ], "quota": [ "Quota" ] }, "submit": [ "Update quota" ], "notes": "Adjust customer quota from the admin page." } } }, "paths": { "/create-order": { "post": { "operationId": "createOrder", "summary": "Create an order", "description": "Create a customer order with a name and amount.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrderInput" } } } }, "responses": { "200": { "description": "Order created" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/update-order-status": { "post": { "operationId": "updateOrderStatus", "summary": "Update order status", "description": "Update an order selected by UUID. Resolve the order through searchOrders or listOrders before calling this action.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateOrderStatusInput" } } } }, "responses": { "200": { "description": "Order updated" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/search-orders": { "post": { "operationId": "searchOrders", "summary": "Search orders", "description": "Search orders by customer name. An empty query returns the latest matching records.", "x-webmcp": { "readOnlyHint": true }, "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchOrdersInput" } } } }, "responses": { "200": { "description": "Matching orders" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/list-orders": { "post": { "operationId": "listOrders", "summary": "List orders", "description": "List the latest orders for filtering, counting, comparison, or duplicate analysis.", "x-webmcp": { "readOnlyHint": true }, "responses": { "200": { "description": "Latest orders" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/get-order-status": { "post": { "operationId": "getOrderStatus", "summary": "Get order status", "description": "Get one order by UUID. Resolve the order through searchOrders or listOrders before calling this action.", "x-webmcp": { "readOnlyHint": true }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrderIdInput" } } } }, "responses": { "200": { "description": "Order details" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/delete-order": { "post": { "operationId": "deleteOrder", "summary": "Delete an order", "description": "Permanently delete an order selected by UUID. Resolve the order through searchOrders or listOrders before calling this action.", "x-webmcp": { "destructiveHint": true }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrderIdInput" } } } }, "responses": { "200": { "description": "Order deleted" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/approve-refund": { "post": { "operationId": "approveRefund", "summary": "Approve an order refund", "description": "Approve the refund for an order selected by UUID. Resolve the order through searchOrders or listOrders before calling this action.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrderIdInput" } } } }, "responses": { "200": { "description": "Refund approved" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/update-quota": { "post": { "operationId": "updateQuota", "summary": "Update customer quota", "description": "Update the quota for an application user UUID.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateQuotaInput" } } } }, "responses": { "200": { "description": "Quota updated" }, "default": { "$ref": "#/components/responses/Error" } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": { "OrderId": { "type": "string", "format": "uuid", "description": "Order UUID returned by searchOrders or listOrders" }, "OrderStatus": { "type": "string", "description": "New order status", "enum": [ "pending", "processing", "fulfilled", "cancelled" ] }, "OrderIdInput": { "type": "object", "additionalProperties": false, "required": [ "id" ], "properties": { "id": { "$ref": "#/components/schemas/OrderId" } } }, "CreateOrderInput": { "type": "object", "additionalProperties": false, "required": [ "customer_name", "amount" ], "properties": { "customer_name": { "type": "string", "minLength": 1, "description": "Customer or account name" }, "amount": { "type": "number", "exclusiveMinimum": 0, "description": "Order amount in dollars" } } }, "UpdateOrderStatusInput": { "type": "object", "additionalProperties": false, "required": [ "id", "status" ], "properties": { "id": { "$ref": "#/components/schemas/OrderId" }, "status": { "$ref": "#/components/schemas/OrderStatus" } } }, "SearchOrdersInput": { "type": "object", "additionalProperties": false, "properties": { "query": { "type": "string", "description": "Customer name or partial customer name" } } }, "UpdateQuotaInput": { "type": "object", "additionalProperties": false, "required": [ "user_id", "quota" ], "properties": { "user_id": { "type": "string", "format": "uuid", "description": "Application user UUID" }, "quota": { "type": "number", "minimum": 0, "description": "New quota value" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string" } } } }, "responses": { "Error": { "description": "Authentication, authorization, validation, or execution error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "x-webmcp-headers": { "apikey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imhuc3V4Z3V6d2libnhodW1lZGhzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzk3Mjc3MTQsImV4cCI6MjA5NTMwMzcxNH0.Pq7iHMDryjYkYDqueUldAyKO93OyuzGIOmunrt-dwbw" } }