{
  "openapi": "3.0.1",
  "info": {
    "title": "Miguel Betancourt Art API",
    "description": "API for AI agents and ChatGPT to search original artworks, view pricing and series, and submit collector acquisition inquiries to the studio of Ecuadorian master painter Miguel Betancourt.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://localhost/miguelb",
      "description": "Local / Production WordPress Server"
    }
  ],
  "paths": {
    "/wp-json/miguelb-ai/v1/artworks": {
      "get": {
        "operationId": "searchArtworks",
        "summary": "Search available artworks by Miguel Betancourt",
        "description": "Retrieves a list of authentic original paintings, techniques (oil, mixed media), series (Palingenesia, Santuarios y Paisajes, Paisajes Íntimos), and prices in USD.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "Search keyword for artwork title, theme, or series (e.g., 'Palingenesia', 'templo', 'Andes')",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Category or series slug (e.g. 'coleccion-palingenesia', 'coleccion-santuarios-y-paisajes', 'oleos', 'tecnicas-mixtas')",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Language code: 'es' for Spanish, 'en' for English",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["es", "en"],
              "default": "es"
            }
          },
          {
            "name": "min_price",
            "in": "query",
            "description": "Minimum price in USD",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "max_price",
            "in": "query",
            "description": "Maximum price in USD",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of artworks to return (max 50)",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful retrieval of artworks list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string" },
                    "total_found": { "type": "integer" },
                    "language": { "type": "string" },
                    "artworks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": { "type": "integer" },
                          "title": { "type": "string" },
                          "artist": { "type": "string" },
                          "slug": { "type": "string" },
                          "url": { "type": "string" },
                          "price_usd": { "type": "number" },
                          "price_formatted": { "type": "string" },
                          "series_and_categories": { "type": "array" },
                          "image_url": { "type": "string" },
                          "description": { "type": "string" },
                          "authenticity": { "type": "string" },
                          "shipping": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/miguelb-ai/v1/collector-inquiry": {
      "post": {
        "operationId": "submitCollectorInquiry",
        "summary": "Submit a collector inquiry, quote request, or studio appointment",
        "description": "Submits an inquiry from a prospective collector to the studio management of Miguel Betancourt. Generates an inquiry reference ID and dispatches an instant notification.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["collector_name", "collector_email", "message"],
                "properties": {
                  "collector_name": {
                    "type": "string",
                    "description": "Full name of the collector or inquirer"
                  },
                  "collector_email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email address to receive the quote or response"
                  },
                  "collector_phone": {
                    "type": "string",
                    "description": "Phone or WhatsApp number with international country code"
                  },
                  "collector_country": {
                    "type": "string",
                    "description": "Country of residence for shipping and logistics calculations"
                  },
                  "artwork_id": {
                    "type": "integer",
                    "description": "WordPress product ID of the artwork if inquiring about a specific piece"
                  },
                  "artwork_title": {
                    "type": "string",
                    "description": "Title of the artwork of interest"
                  },
                  "message": {
                    "type": "string",
                    "description": "Details of the inquiry (e.g. shipping quote, framed vs unframed options, appointment request)"
                  },
                  "language": {
                    "type": "string",
                    "enum": ["es", "en"],
                    "default": "es",
                    "description": "Preferred language for communication"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inquiry successfully recorded and forwarded to the artist's studio",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string" },
                    "reference_id": { "type": "string" },
                    "message": { "type": "string" },
                    "details": { "type": "object" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
