{
  "openapi": "3.1.0",
  "info": {
    "title": "JUVENILE Haute Parfumerie Storefront & Concierge API",
    "version": "1.0.0",
    "description": "Public APIs for Juvenile Haute Parfumerie luxury perfume catalog, AI olfactory concierge, customer order tracking, and agent-native commerce with Machine Payment Protocol (MPP)."
  },
  "x-service-info": {
    "title": "JUVENILE Haute Parfumerie",
    "description": "Luxury haute parfumerie maison offering artisanal perfumes, AI concierge, and agent-native commerce.",
    "categories": [
      "ecommerce",
      "luxury",
      "fragrance",
      "shopping",
      "ai"
    ],
    "docs": {
      "homepage": "https://juvenileperfume.com",
      "apiReference": "https://juvenileperfume.com/docs/api",
      "llms": "https://juvenileperfume.com/llms.txt"
    }
  },
  "servers": [
    {
      "url": "https://juvenileperfume.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/api/orders": {
      "post": {
        "summary": "Create Luxury Fragrance Order",
        "description": "Submit a customer or agent order for Juvenile fragrances. Supports autonomous settlement via Machine Payment Protocol (MPP).",
        "operationId": "createOrder",
        "x-payment-info": {
          "intent": "charge",
          "method": "tempo",
          "amount": "1000000",
          "currency": "USD",
          "description": "One-time checkout payment for luxury perfume order",
          "offers": [
            {
              "method": "tempo",
              "intent": "charge",
              "amount": "1000000",
              "currency": "USD",
              "description": "Tempo stablecoin instant settlement",
              "recipient": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
              "network": "tempo"
            },
            {
              "method": "stripe",
              "intent": "charge",
              "amount": "5000",
              "currency": "USD",
              "description": "Stripe agent credit card processing"
            },
            {
              "method": "card",
              "intent": "charge",
              "amount": "5000",
              "currency": "USD",
              "description": "Credit/Debit card payment"
            },
            {
              "method": "lightning",
              "intent": "charge",
              "amount": "21000",
              "currency": "SAT",
              "description": "Bitcoin Lightning micropayment"
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer": {
                    "type": "object",
                    "properties": {
                      "firstName": { "type": "string" },
                      "lastName": { "type": "string" },
                      "phone": { "type": "string" },
                      "email": { "type": "string" }
                    },
                    "required": ["firstName", "lastName", "phone"]
                  },
                  "delivery": {
                    "type": "object",
                    "properties": {
                      "governorate": { "type": "string" },
                      "city": { "type": "string" },
                      "address": { "type": "string" }
                    },
                    "required": ["governorate", "address"]
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": { "type": "string" },
                        "name": { "type": "string" },
                        "price": { "type": "number" },
                        "quantity": { "type": "integer" }
                      },
                      "required": ["id", "name", "price", "quantity"]
                    }
                  },
                  "payment": {
                    "type": "object",
                    "properties": {
                      "method": {
                        "type": "string",
                        "enum": ["cod", "card", "tempo", "mpp", "stripe", "lightning", "instapay"]
                      }
                    },
                    "required": ["method"]
                  }
                },
                "required": ["customer", "delivery", "items", "payment"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "orderId": { "type": "string" },
                    "message": { "type": "string" }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required - MPP challenge issued via WWW-Authenticate header",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "MPP payment challenge (method, intent, amount, currency, recipient)"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": { "type": "string" },
                    "message": { "type": "string" },
                    "challenge": { "type": "object" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/checkout": {
      "post": {
        "summary": "Agent-Native MPP Fragrance Checkout",
        "description": "Autonomous AI agent checkout and payment settlement using Machine Payment Protocol (MPP).",
        "operationId": "agentCheckout",
        "x-payment-info": {
          "intent": "charge",
          "method": "tempo",
          "amount": "1000000",
          "currency": "USD",
          "description": "Autonomous agent payment for perfume purchase",
          "offers": [
            {
              "method": "tempo",
              "intent": "charge",
              "amount": "1000000",
              "currency": "USD",
              "description": "Tempo stablecoin instant settlement",
              "recipient": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
              "network": "tempo"
            },
            {
              "method": "stripe",
              "intent": "charge",
              "amount": "5000",
              "currency": "USD",
              "description": "Stripe agent credit card processing"
            },
            {
              "method": "card",
              "intent": "charge",
              "amount": "5000",
              "currency": "USD",
              "description": "Credit/Debit card payment"
            },
            {
              "method": "lightning",
              "intent": "charge",
              "amount": "21000",
              "currency": "SAT",
              "description": "Bitcoin Lightning micropayment"
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": { "type": "string" },
                        "name": { "type": "string" },
                        "price": { "type": "number" },
                        "quantity": { "type": "integer" }
                      },
                      "required": ["id", "price", "quantity"]
                    }
                  },
                  "customer": {
                    "type": "object",
                    "properties": {
                      "name": { "type": "string" },
                      "phone": { "type": "string" },
                      "address": { "type": "string" }
                    },
                    "required": ["name", "phone", "address"]
                  }
                },
                "required": ["items", "customer"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment accepted and order dispatched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "orderId": { "type": "string" },
                    "receipt": { "type": "object" }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required - MPP challenge issued via WWW-Authenticate header",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "MPP payment challenge (method, intent, amount, currency, recipient)"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": { "type": "string" },
                    "message": { "type": "string" },
                    "challenge": { "type": "object" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/bot/chat": {
      "post": {
        "summary": "AI Fragrance Concierge Chat",
        "description": "Conversational olfactory concierge providing recommendations, notes analysis, and answers based on Juvenile fragrance database.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": { "type": "string", "enum": ["user", "assistant"] },
                        "content": { "type": "string" }
                      },
                      "required": ["role", "content"]
                    }
                  },
                  "locale": { "type": "string", "enum": ["ar", "en"], "default": "ar" }
                },
                "required": ["messages"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI response generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reply": { "type": "string" },
                    "suggestedProducts": { "type": "array", "items": { "type": "object" } },
                    "quickReplies": { "type": "array", "items": { "type": "string" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/search/ai": {
      "post": {
        "summary": "AI Semantic Fragrance Search",
        "description": "Semantic search for perfumes by desired mood, notes, season, or occasion.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": { "type": "string" },
                  "locale": { "type": "string", "enum": ["ar", "en"], "default": "ar" }
                },
                "required": ["query"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching products and AI insight",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "aiInsight": { "type": "string" },
                    "products": { "type": "array", "items": { "type": "object" } },
                    "suggestedQueries": { "type": "array", "items": { "type": "string" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/orders/track": {
      "get": {
        "summary": "Track Order Status",
        "description": "Track status and delivery details of orders by phone number or order ID.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Customer phone number or Order ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Order tracking details"
          }
        }
      }
    }
  }
}
