{
  "openapi": "3.1.0",
  "info": {
    "title": "Spas.Directory GiftCards API",
    "version": "1.1.0",
    "description": "Public, read-only lookups plus a payment-link endpoint. AI agents may use it; a person always pays on Stripe (agents never take payment)."
  },
  "servers": [
    {
      "url": "https://vouchers.spas.directory"
    }
  ],
  "paths": {
    "/api/giftcards/designs": {
      "get": {
        "operationId": "listOccasionsAndDesigns",
        "summary": "Occasions (with groups) and card designs",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/festivals/upcoming": {
      "get": {
        "operationId": "upcomingFestivals",
        "summary": "Festivals and special days coming up",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/giftcards/check": {
      "get": {
        "operationId": "checkBalance",
        "summary": "Balance of a gift card",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "422": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/giftcards/checkout": {
      "post": {
        "operationId": "createPaymentLink",
        "summary": "Create a Stripe payment page for a person to pay",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amountCents"
                ],
                "properties": {
                  "amountCents": {
                    "type": "integer",
                    "minimum": 2500,
                    "maximum": 250000
                  },
                  "currency": {
                    "type": "string",
                    "default": "USD"
                  },
                  "qty": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 24
                  },
                  "occasion": {
                    "type": "string"
                  },
                  "design": {
                    "type": "string"
                  },
                  "tagline": {
                    "type": "string",
                    "maxLength": 90
                  },
                  "recipientFirst": {
                    "type": "string"
                  },
                  "buyerEmail": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{ url }: give it to the person; they pay on Stripe"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP server (JSON-RPC 2.0)",
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    }
  }
}