{
    "openapi": "3.0.3",
    "info": {
        "title": "İsimKayıt Agent API",
        "version": "1.2.0",
        "description": "Public JSON APIs for AI agents. Live WHMCS TRY prices. Do not scrape HTML or invent prices. Prefer POST /mcp (JSON-RPC 2.0, protocol 2024-11-05). Phase 1 checkout is a browser checkout_url (no PAN in the agent).",
        "contact": {
            "email": "destek@isimkayit.com",
            "url": "https://www.isimkayit.com/for-agents"
        },
        "license": {
            "name": "Site terms",
            "url": "https://www.isimkayit.com/sozlesmeler"
        }
    },
    "servers": [
        {
            "url": "https://www.isimkayit.com",
            "description": "Production (canonical www)"
        }
    ],
    "tags": [
        {
            "name": "MCP",
            "description": "Model Context Protocol"
        },
        {
            "name": "Catalog",
            "description": "Live product prices"
        },
        {
            "name": "Domain",
            "description": "Availability + TRY TLD prices"
        },
        {
            "name": "Checkout",
            "description": "Phase 1 browser handoff"
        },
        {
            "name": "Status",
            "description": "Health and DC status"
        }
    ],
    "components": {
        "securitySchemes": {
            "AgentKey": {
                "type": "apiKey",
                "in": "header",
                "name": "X-Agent-Api-Key",
                "description": "Optional partner key. Also accepts Authorization: Bearer."
            }
        },
        "schemas": {
            "Product": {
                "type": "object",
                "required": [
                    "product_id",
                    "name",
                    "currency_code",
                    "billing_periods",
                    "landing_url"
                ],
                "properties": {
                    "product_id": {
                        "type": "integer",
                        "example": 127
                    },
                    "pid": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "all",
                            "ssl",
                            "hosting",
                            "hostingaccount",
                            "server",
                            "cloudserver",
                            "forexservers",
                            "dedicated",
                            "dedicatedserver",
                            "ipaddress",
                            "rdpserver",
                            "sla",
                            "vpn",
                            "kurumsalmail",
                            "email",
                            "sophos",
                            "other"
                        ]
                    },
                    "currency": {
                        "type": "string",
                        "example": "TL"
                    },
                    "currency_code": {
                        "type": "string",
                        "example": "TRY"
                    },
                    "has_tax": {
                        "type": "boolean"
                    },
                    "tax_note": {
                        "type": "string"
                    },
                    "in_stock": {
                        "type": "boolean"
                    },
                    "billing_periods": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "cycle",
                                "price"
                            ],
                            "properties": {
                                "cycle": {
                                    "type": "string",
                                    "enum": [
                                        "monthly",
                                        "quarterly",
                                        "semiannually",
                                        "annually",
                                        "biennially",
                                        "triennially"
                                    ]
                                },
                                "price": {
                                    "type": "number",
                                    "example": 295
                                },
                                "period_label": {
                                    "type": "string",
                                    "example": "ay"
                                }
                            }
                        }
                    },
                    "landing_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "purchase_url": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            },
            "DomainHit": {
                "type": "object",
                "properties": {
                    "domain": {
                        "type": "string",
                        "example": "example.com.tr"
                    },
                    "status": {
                        "type": "string",
                        "example": "registered"
                    },
                    "available": {
                        "type": "boolean"
                    },
                    "currency_code": {
                        "type": "string",
                        "example": "TRY"
                    },
                    "register_1y": {
                        "type": "number",
                        "example": 155
                    },
                    "transfer_1y": {
                        "type": "number"
                    },
                    "renew_1y": {
                        "type": "number"
                    },
                    "prices": {
                        "type": "object",
                        "properties": {
                            "register": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "required": [
                                        "years",
                                        "price",
                                        "currency_code"
                                    ],
                                    "properties": {
                                        "years": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "price": {
                                            "type": "number",
                                            "example": 155
                                        },
                                        "currency": {
                                            "type": "string",
                                            "example": "TL"
                                        },
                                        "currency_code": {
                                            "type": "string",
                                            "example": "TRY"
                                        },
                                        "period_label": {
                                            "type": "string",
                                            "example": "yıl"
                                        }
                                    }
                                }
                            },
                            "transfer": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "required": [
                                        "years",
                                        "price",
                                        "currency_code"
                                    ],
                                    "properties": {
                                        "years": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "price": {
                                            "type": "number",
                                            "example": 155
                                        },
                                        "currency": {
                                            "type": "string",
                                            "example": "TL"
                                        },
                                        "currency_code": {
                                            "type": "string",
                                            "example": "TRY"
                                        },
                                        "period_label": {
                                            "type": "string",
                                            "example": "yıl"
                                        }
                                    }
                                }
                            },
                            "renew": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "required": [
                                        "years",
                                        "price",
                                        "currency_code"
                                    ],
                                    "properties": {
                                        "years": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "price": {
                                            "type": "number",
                                            "example": 155
                                        },
                                        "currency": {
                                            "type": "string",
                                            "example": "TL"
                                        },
                                        "currency_code": {
                                            "type": "string",
                                            "example": "TRY"
                                        },
                                        "period_label": {
                                            "type": "string",
                                            "example": "yıl"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "landing_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "purchase_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "requires_document": {
                        "type": "boolean"
                    },
                    "price": {
                        "type": "object",
                        "description": "Raw WHMCS map (compat). Prefer prices / register_1y."
                    }
                }
            },
            "McpRequest": {
                "type": "object",
                "required": [
                    "jsonrpc",
                    "method"
                ],
                "properties": {
                    "jsonrpc": {
                        "type": "string",
                        "enum": [
                            "2.0"
                        ]
                    },
                    "id": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "method": {
                        "type": "string",
                        "enum": [
                            "initialize",
                            "tools/list",
                            "tools/call",
                            "ping"
                        ]
                    },
                    "params": {
                        "type": "object"
                    }
                }
            }
        }
    },
    "security": [
        [],
        {
            "AgentKey": []
        }
    ],
    "paths": {
        "/mcp": {
            "get": {
                "tags": [
                    "MCP"
                ],
                "summary": "MCP manifest (same as /.well-known/mcp.json)",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "MCP"
                ],
                "summary": "JSON-RPC 2.0 MCP",
                "description": "Methods: initialize, tools/list, tools/call, ping. Protocol 2024-11-05.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/McpRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/.well-known/mcp.json": {
            "get": {
                "tags": [
                    "MCP"
                ],
                "summary": "MCP server manifest",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/.well-known/commerce.json": {
            "get": {
                "tags": [
                    "Checkout"
                ],
                "summary": "Agent commerce contract",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/ping": {
            "get": {
                "tags": [
                    "Status"
                ],
                "summary": "Health ping",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/agent_catalog": {
            "get": {
                "tags": [
                    "Catalog"
                ],
                "summary": "Live catalog with TRY billing_periods, landing_url, purchase_url",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "all",
                                "ssl",
                                "hosting",
                                "hostingaccount",
                                "server",
                                "cloudserver",
                                "forexservers",
                                "dedicated",
                                "dedicatedserver",
                                "ipaddress",
                                "rdpserver",
                                "sla",
                                "vpn",
                                "kurumsalmail",
                                "email",
                                "sophos",
                                "other"
                            ],
                            "default": "all"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "message": {
                                            "type": "object",
                                            "properties": {
                                                "currency_code": {
                                                    "type": "string",
                                                    "example": "TRY"
                                                },
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "products": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Product"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/list_products/{type}": {
            "get": {
                "tags": [
                    "Catalog"
                ],
                "summary": "Alias of agent_catalog by path type",
                "parameters": [
                    {
                        "name": "type",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "all",
                                "ssl",
                                "hosting",
                                "hostingaccount",
                                "server",
                                "cloudserver",
                                "forexservers",
                                "dedicated",
                                "dedicatedserver",
                                "ipaddress",
                                "rdpserver",
                                "sla",
                                "vpn",
                                "kurumsalmail",
                                "email",
                                "sophos",
                                "other"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/tlds": {
            "get": {
                "tags": [
                    "Domain"
                ],
                "summary": "TLD list + live TRY prices",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/search_domain": {
            "post": {
                "tags": [
                    "Domain"
                ],
                "summary": "Availability + normalized TRY prices",
                "description": "Use register_1y / prices.register. Raw WHMCS map remains in price for compat.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "domain": {
                                        "type": "string"
                                    },
                                    "tld": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "domain"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "message": {
                                            "type": "object",
                                            "properties": {
                                                "currency_code": {
                                                    "type": "string",
                                                    "example": "TRY"
                                                },
                                                "domains": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/DomainHit"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/whois": {
            "post": {
                "tags": [
                    "Domain"
                ],
                "summary": "Public WHOIS / RDAP",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "domain": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "domain"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/ai_suggest": {
            "post": {
                "tags": [
                    "Domain"
                ],
                "summary": "Domain name ideas",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "prompt": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "prompt"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/agent_domain_fields": {
            "get": {
                "tags": [
                    "Domain"
                ],
                "summary": "ccTLD additional fields (.tr etc.)",
                "parameters": [
                    {
                        "name": "tld",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "tr"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/agent_cart_add": {
            "post": {
                "tags": [
                    "Checkout"
                ],
                "summary": "Create agent cart → checkout_url (24h, browser pay)",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "product_id": {
                                        "type": "integer"
                                    },
                                    "billing_cycle": {
                                        "type": "string",
                                        "enum": [
                                            "monthly",
                                            "quarterly",
                                            "semiannually",
                                            "annually",
                                            "biennially",
                                            "triennially"
                                        ]
                                    },
                                    "domain": {
                                        "type": "string"
                                    },
                                    "additional_fields": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/agent_cart/{cart_id}": {
            "get": {
                "tags": [
                    "Checkout"
                ],
                "summary": "Cart summary",
                "parameters": [
                    {
                        "name": "cart_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/agent_checkout_quote": {
            "post": {
                "tags": [
                    "Checkout"
                ],
                "summary": "15-minute locked quote",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "cart_id": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "cart_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/infrastructure_status": {
            "get": {
                "tags": [
                    "Status"
                ],
                "summary": "Live Kocaeli DC status",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}