{
  "openapi": "3.1.0",
  "info": {
    "title": "Sparkoo Public APIs",
    "version": "1.0.0",
    "description": "Public HTTP APIs for the Sparkoo Bangladesh educational-toys storefront. Catalog discovery: /.well-known/api-catalog (RFC 9727).",
    "contact": {
      "name": "Sparkoo",
      "url": "https://sparkoobd.com"
    }
  },
  "servers": [
    {
      "url": "https://sparkoobd.com",
      "description": "Storefront (Next.js)"
    },
    {
      "url": "https://api.sparkoobd.com",
      "description": "Saleor GraphQL API"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Storefront liveness (includes Saleor reachability)",
        "responses": {
          "200": {
            "description": "Healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "apiUrl": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string"
                    },
                    "productCount": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Upstream Saleor unreachable"
          }
        }
      }
    },
    "/api/bd/thanas": {
      "get": {
        "operationId": "listThanas",
        "summary": "Bangladesh thanas / upazilas for a district",
        "parameters": [
          {
            "name": "district",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Dhaka"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Thana list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "district": {
                      "type": "string"
                    },
                    "thanas": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing district"
          },
          "404": {
            "description": "Unknown district"
          }
        }
      }
    },
    "/graphql/": {
      "post": {
        "operationId": "saleorGraphQL",
        "summary": "Saleor GraphQL (catalog, checkout, account)",
        "servers": [
          {
            "url": "https://api.sparkoobd.com"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string"
                  },
                  "variables": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "operationName": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "GraphQL response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}