{
    "openapi": "3.1.0",
    "info": {
        "title": "Nato Smart Mounts Agent Commerce",
        "version": "0.1.0",
        "description": "Discovery and attribution contract over the live WooCommerce Store API. The server remains authoritative for price, stock, shipping, tax, totals, order, and payment state."
    },
    "servers": [
        {
            "url": "https://natomounts.com"
        }
    ],
    "paths": {
        "/wp-json/agent-commerce/v1/session": {
            "post": {
                "summary": "Create a short-lived agent attribution session",
                "responses": {
                    "201": {
                        "description": "Session created"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            }
        },
        "/wp-json/agent-commerce/v1/capabilities": {
            "get": {
                "summary": "Read enabled and disabled capabilities",
                "responses": {
                    "200": {
                        "description": "Current capabilities"
                    }
                }
            }
        },
        "/wp-json/agent-commerce/v1/health": {
            "get": {
                "summary": "Read connector and WooCommerce health",
                "responses": {
                    "200": {
                        "description": "Health state"
                    }
                }
            }
        },
        "/wp-json/wc/store/v1/products": {
            "get": {
                "summary": "Search the live public catalog",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/AgentSession"
                    },
                    {
                        "$ref": "#/components/parameters/AgentName"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Live WooCommerce products"
                    }
                }
            }
        },
        "/wp-json/wc/store/v1/cart": {
            "get": {
                "summary": "Create or read a cart and obtain Cart-Token",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/AgentSession"
                    },
                    {
                        "$ref": "#/components/parameters/AgentName"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Current cart; preserve Cart-Token response header"
                    }
                }
            }
        },
        "/wp-json/wc/store/v1/cart/add-item": {
            "post": {
                "summary": "Add an exact product or variation to the current cart",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/AgentSession"
                    },
                    {
                        "$ref": "#/components/parameters/AgentName"
                    },
                    {
                        "$ref": "#/components/parameters/CartToken"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Updated server-calculated cart"
                    }
                }
            }
        },
        "/wp-json/wc/store/v1/checkout": {
            "post": {
                "summary": "Submit the confirmed cart to WooCommerce checkout",
                "description": "Requires explicit human confirmation. Never transmit raw payment secrets through an AI conversation. Payment-method compatibility must be tested.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/AgentSession"
                    },
                    {
                        "$ref": "#/components/parameters/AgentName"
                    },
                    {
                        "$ref": "#/components/parameters/CartToken"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "WooCommerce checkout result; a redirect or draft is not proof of payment"
                    },
                    "409": {
                        "description": "Server total differs from expected total"
                    }
                }
            }
        }
    },
    "components": {
        "parameters": {
            "AgentSession": {
                "name": "X-Agent-Session",
                "in": "header",
                "required": true,
                "schema": {
                    "type": "string",
                    "format": "uuid"
                }
            },
            "AgentName": {
                "name": "X-Agent-Name",
                "in": "header",
                "required": true,
                "schema": {
                    "type": "string",
                    "maxLength": 100
                }
            },
            "CartToken": {
                "name": "Cart-Token",
                "in": "header",
                "required": true,
                "schema": {
                    "type": "string"
                }
            }
        }
    }
}