{
  "openapi": "3.1.0",
  "info": {
    "title": "Randevuo API",
    "version": "1.0.0",
    "description": "Multi-tenant salon appointment booking and AI agent communication API with agent-native payments.",
    "contact": {
      "name": "Randevuo Destek",
      "url": "https://randevuo.com.tr",
      "email": "destek@randevuo.com.tr"
    }
  },
  "servers": [
    {
      "url": "https://randevuo.com.tr",
      "description": "Randevuo Production API Gateway"
    }
  ],
  "x-service-info": {
    "categories": [
      "booking",
      "appointments",
      "scheduling",
      "salon",
      "ai-agent"
    ]
  },
  "paths": {
    "/api/agent/booking-quote": {
      "post": {
        "summary": "Request appointment quote or hold a time slot with agent payment",
        "description": "Generates an appointment reservation quote. Requires machine-native payment fulfillment per MPP or x402 protocol.",
        "operationId": "createAgentBookingQuote",
        "x-payment-info": {
          "intent": "charge",
          "method": "stripe",
          "amount": "100",
          "currency": "usd",
          "description": "Agent booking query fee",
          "offers": [
            {
              "intent": "charge",
              "method": "stripe",
              "amount": "100",
              "currency": "usd",
              "description": "Card / Stripe payment"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "1000000",
              "currency": "usdc",
              "description": "USDC micropayment via Tempo"
            },
            {
              "intent": "charge",
              "method": "card",
              "amount": "100",
              "currency": "usd",
              "description": "Direct card charge"
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "serviceName": {
                    "type": "string"
                  },
                  "preferredDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "customerPhone": {
                    "type": "string"
                  }
                },
                "required": [
                  "serviceName",
                  "preferredDate"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quote generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quoteId": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — machine payment required via MPP or x402",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                },
                "description": "Base64 encoded payment requirement object per x402"
              }
            }
          }
        }
      },
      "get": {
        "summary": "Check agent booking quote status and payment requirements",
        "description": "Returns HTTP 402 with machine-readable payment challenge if unpaid.",
        "operationId": "getAgentBookingQuoteStatus",
        "x-payment-info": {
          "intent": "charge",
          "method": "stripe",
          "amount": "100",
          "currency": "usd",
          "description": "Agent booking query fee"
        },
        "responses": {
          "200": {
            "description": "Status retrieved"
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "summary": "Service Health Check",
        "responses": {
          "200": {
            "description": "System operational"
          }
        }
      }
    }
  }
}