{
  "openapi": "3.1.0",
  "info": {
    "title": "OpenCart Greece Support Site API",
    "version": "1.0.0",
    "description": "Public JSON API for support.opencartgreece.gr: Greek postcode and place lookups (ELTA data), team availability, URL checks and plugin versions. Public endpoints need no authentication. Protected dashboard APIs use Clerk OAuth/OIDC metadata published under the site's .well-known discovery endpoints. AI agents can also use the MCP server at https://support.opencartgreece.gr/mcp."
  },
  "servers": [
    {
      "url": "https://support.opencartgreece.gr",
      "description": "Production"
    }
  ],
  "paths": {
    "/.well-known/api-catalog": {
      "get": {
        "operationId": "getApiCatalog",
        "summary": "Return RFC 9727 API catalog for public support-site endpoints",
        "responses": {
          "200": {
            "description": "API catalog returned",
            "content": {
              "application/linkset+json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "linkset"
                  ],
                  "properties": {
                    "linkset": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "anchor",
                          "service-desc",
                          "service-doc",
                          "status"
                        ],
                        "properties": {
                          "anchor": {
                            "type": "string",
                            "format": "uri"
                          },
                          "service-desc": {
                            "type": "array"
                          },
                          "service-doc": {
                            "type": "array"
                          },
                          "status": {
                            "type": "array"
                          },
                          "describedby": {
                            "type": "array"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/agent-card.json": {
      "get": {
        "operationId": "getA2aAgentCard",
        "summary": "Return the public A2A agent discovery card",
        "responses": {
          "200": {
            "description": "A2A agent card returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "description",
                    "supportedInterfaces",
                    "version",
                    "capabilities",
                    "defaultInputModes",
                    "defaultOutputModes",
                    "skills"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "supportedInterfaces": {
                      "type": "array"
                    },
                    "capabilities": {
                      "type": "object"
                    },
                    "defaultInputModes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "defaultOutputModes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "skills": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "operationId": "getOauthProtectedResourceMetadata",
        "summary": "Return OAuth protected resource metadata for the support-site origin",
        "responses": {
          "200": {
            "description": "Protected resource metadata returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "resource",
                    "authorization_servers",
                    "scopes_supported"
                  ],
                  "properties": {
                    "resource": {
                      "description": "The RFC 9728 resource identifier published by the support-site origin.",
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_servers": {
                      "description": "OAuth/OIDC issuer URLs that can mint access tokens for authenticated site access.",
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "scopes_supported": {
                      "description": "Advertised OAuth scopes for authenticated access.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "bearer_methods_supported": {
                      "description": "Supported bearer-token transport methods from RFC 6750.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Clerk issuer discovery is unavailable"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getApiHealth",
        "summary": "Return API health and discovery links",
        "responses": {
          "200": {
            "description": "Health status returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "apiCatalog",
                    "openidConfiguration",
                    "oauthAuthorizationServer",
                    "oauthProtectedResource",
                    "serviceDesc",
                    "serviceDoc",
                    "timestamp"
                  ],
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "apiCatalog": {
                      "description": "RFC 9727 API catalog for the support-site API surface.",
                      "type": "string",
                      "format": "uri"
                    },
                    "openidConfiguration": {
                      "description": "OpenID Connect discovery metadata for the production Clerk issuer used by protected APIs.",
                      "type": "string",
                      "format": "uri"
                    },
                    "oauthAuthorizationServer": {
                      "description": "RFC 8414 authorization server metadata for the production Clerk issuer used by protected APIs.",
                      "type": "string",
                      "format": "uri"
                    },
                    "oauthProtectedResource": {
                      "description": "RFC 9728 protected resource metadata for the support-site origin.",
                      "type": "string",
                      "format": "uri"
                    },
                    "serviceDesc": {
                      "description": "OpenAPI document for the browser-facing support-site endpoints.",
                      "type": "string",
                      "format": "uri"
                    },
                    "serviceDoc": {
                      "description": "Human-readable API reference for the support-site endpoints.",
                      "type": "string",
                      "format": "uri"
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/availability": {
      "get": {
        "operationId": "getAvailability",
        "summary": "Return localized public team availability status",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Response language. Defaults to request language or Greek.",
            "schema": {
              "type": "string",
              "enum": [
                "el",
                "en"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Availability status returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "language",
                    "supportedLanguages",
                    "status",
                    "generatedAt"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "language": {
                      "type": "string",
                      "enum": [
                        "el",
                        "en"
                      ]
                    },
                    "supportedLanguages": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "el",
                          "en"
                        ]
                      }
                    },
                    "status": {
                      "type": "object",
                      "required": [
                        "isOpen",
                        "variant",
                        "reason",
                        "message",
                        "dismissKey"
                      ],
                      "properties": {
                        "isOpen": {
                          "type": "boolean"
                        },
                        "variant": {
                          "type": "string",
                          "enum": [
                            "open",
                            "warning",
                            "closed"
                          ]
                        },
                        "reason": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "dismissKey": {
                          "type": "string"
                        },
                        "nextOpenAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "nextOpenAtEpochMs": {
                          "type": "number"
                        },
                        "nextOpenLabel": {
                          "type": "string"
                        },
                        "openTimeLabel": {
                          "type": "string"
                        },
                        "timeZoneLabel": {
                          "type": "string"
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/postcode/{postcode}": {
      "get": {
        "operationId": "lookupPostcode",
        "summary": "Look up a Greek postcode",
        "description": "Returns the places and streets that ELTA assigns to a five-digit Greek postcode.",
        "parameters": [
          {
            "name": "postcode",
            "in": "path",
            "required": true,
            "description": "Five-digit Greek postcode, for example 10431.",
            "schema": {
              "type": "string",
              "example": "10431"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Postcode found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "type",
                    "query",
                    "count",
                    "results"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "postcode"
                      ]
                    },
                    "query": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "postcode",
                          "place",
                          "streets"
                        ],
                        "properties": {
                          "postcode": {
                            "type": "string",
                            "pattern": "^\\d{5}$"
                          },
                          "place": {
                            "type": "string"
                          },
                          "streets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "street",
                                "numberRange"
                              ],
                              "properties": {
                                "street": {
                                  "type": "string"
                                },
                                "numberRange": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The postcode is not five digits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "type",
                    "query",
                    "error",
                    "message"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "postcode"
                      ]
                    },
                    "query": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Postcode not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "type",
                    "query",
                    "error",
                    "message"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "postcode"
                      ]
                    },
                    "query": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Postcode data unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "type",
                    "query",
                    "error",
                    "message"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "postcode"
                      ]
                    },
                    "query": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/place/{place}": {
      "get": {
        "operationId": "searchPlaces",
        "summary": "Search Greek places by name prefix",
        "description": "Returns up to 25 places whose Greek name equals or starts with the query, with their postcodes and streets. Accents and case are ignored.",
        "parameters": [
          {
            "name": "place",
            "in": "path",
            "required": true,
            "description": "Greek place name or prefix, URL-encoded, for example ΑΘΗΝΑ.",
            "schema": {
              "type": "string",
              "example": "ΑΘΗΝΑ"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Places found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "type",
                    "query",
                    "count",
                    "results"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "place"
                      ]
                    },
                    "query": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "postcode",
                          "place",
                          "streets"
                        ],
                        "properties": {
                          "postcode": {
                            "type": "string",
                            "pattern": "^\\d{5}$"
                          },
                          "place": {
                            "type": "string"
                          },
                          "streets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "street",
                                "numberRange"
                              ],
                              "properties": {
                                "street": {
                                  "type": "string"
                                },
                                "numberRange": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Empty place query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "type",
                    "query",
                    "error",
                    "message"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "place"
                      ]
                    },
                    "query": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Place not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "type",
                    "query",
                    "error",
                    "message"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "place"
                      ]
                    },
                    "query": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Postcode data unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "type",
                    "query",
                    "error",
                    "message"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "place"
                      ]
                    },
                    "query": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/check-url": {
      "post": {
        "operationId": "checkUrl",
        "summary": "Fetch status information for a target URL",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status lookup completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "statusText",
                    "finalUrl",
                    "headers"
                  ],
                  "properties": {
                    "status": {
                      "type": "integer"
                    },
                    "statusText": {
                      "type": "string"
                    },
                    "finalUrl": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The submitted URL was invalid"
          },
          "502": {
            "description": "The downstream request failed"
          }
        }
      }
    },
    "/api/report-abuse": {
      "post": {
        "operationId": "reportAbuse",
        "summary": "Submit an abuse report",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reporter_email",
                  "abuse_url",
                  "description",
                  "cf-turnstile-response"
                ],
                "properties": {
                  "reporter_name": {
                    "type": "string"
                  },
                  "reporter_email": {
                    "type": "string",
                    "format": "email"
                  },
                  "abuse_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "product_name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "cf-turnstile-response": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Report submitted successfully"
          },
          "400": {
            "description": "Validation or CAPTCHA failed"
          },
          "500": {
            "description": "Server configuration or internal error"
          }
        }
      }
    },
    "/api/plugins/version": {
      "get": {
        "operationId": "getPluginVersion",
        "summary": "Return version information for a supported plugin",
        "parameters": [
          {
            "name": "plugin",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Version data returned"
          },
          "400": {
            "description": "Plugin parameter missing"
          },
          "404": {
            "description": "Unknown plugin identifier"
          },
          "503": {
            "description": "Upstream version check failed"
          }
        }
      }
    },
    "/api/stripe/create-checkout-session": {
      "post": {
        "operationId": "createCheckoutSessionRedirect",
        "summary": "Redirect to the checkout-session worker endpoint",
        "responses": {
          "307": {
            "description": "Temporary redirect to the checkout session creator"
          },
          "500": {
            "description": "Checkout worker URL is not configured"
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Developer documentation for the API and MCP server",
    "url": "https://support.opencartgreece.gr/developers/"
  }
}
