{
  "openapi": "3.0.3",
  "info": {
    "title": "Fitness Starter – curated gift wishlist API",
    "version": "0.1.0",
    "description": "Create a gift wishlist for starting running, strength or yoga in seconds from hand-picked amazon.se (Sweden) and amazon.com (United States) products — carefully selected gift ideas with shareable owner + shopper links. Curated by us (no customer reviews or ratings). Keywords: gift ideas, wishlist, gift list, shopping list, presenttips, önskelista, träning. Quickstart: POST /api/v1/agent/create-and-fill → shopUrl. US shoppers: pass marketplace=amazon.com for amazon.com/dp/ASIN?tag=sw-fitness-20 links (English titles, USD prices). Sweden: marketplace=amazon.se (tag sw-fitness-21). Store selection: marketplace and locale are optional and a missing store never returns an error. Order: marketplace (or domain / X-Amazon-Marketplace) > country (or X-Country; US → amazon.com) > Accept-Language (starts with en-US → amazon.com) > default amazon.se. amazon.com search links use English keywords. MCP at /api/mcp. CORS *."
  },
  "servers": [
    {
      "url": "https://fitness-starter.vercel.app"
    }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "summary": "Health",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "summary": "Open Amazon fitness gear search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Search query (optional; defaults to fitness starter gear; use English for amazon.com)"
          },
          {
            "name": "goal",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Goal"
            }
          },
          {
            "name": "level",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Level"
            }
          },
          {
            "name": "budgetBand",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/BudgetBand"
            }
          },
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "amazon.se",
                "amazon.com"
              ]
            },
            "description": "Optional Amazon storefront: amazon.com (United States, tag sw-fitness-20) or amazon.se (Sweden, tag sw-fitness-21); each has its own hand-picked /dp/ catalog. If omitted: country, then Accept-Language (en-US → amazon.com), else amazon.se."
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional end-user locale, e.g. en-US or sv-SE. Defaults from Accept-Language or the store."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "US"
            },
            "description": "Optional ISO country code (US → amazon.com, SE → amazon.se). Used when marketplace is omitted."
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "en-US,en;q=0.9"
            },
            "description": "When marketplace and country are omitted, en-US → amazon.com; anything else → amazon.se."
          }
        ],
        "responses": {
          "200": {
            "description": "Search results"
          }
        }
      }
    },
    "/api/v1/catalog": {
      "get": {
        "summary": "Curated starter catalog",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "goal",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Goal"
            }
          },
          {
            "name": "level",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Level"
            }
          },
          {
            "name": "budgetBand",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/BudgetBand"
            }
          },
          {
            "name": "marketplace",
            "in": "query",
            "schema": {
              "type": "string",
              "examples": [
                "amazon.se",
                "amazon.com"
              ]
            },
            "description": "Optional Amazon storefront: amazon.com (United States, tag sw-fitness-20) or amazon.se (Sweden, tag sw-fitness-21); each has its own hand-picked /dp/ catalog. If omitted: country, then Accept-Language (en-US → amazon.com), else amazon.se.",
            "required": false
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Optional end-user locale, e.g. en-US or sv-SE. Defaults from Accept-Language or the store."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "US"
            },
            "description": "Optional ISO country code (US → amazon.com, SE → amazon.se). Used when marketplace is omitted."
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "en-US,en;q=0.9"
            },
            "description": "When marketplace and country are omitted, en-US → amazon.com; anything else → amazon.se."
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog page"
          }
        }
      }
    },
    "/api/v1/wishlists": {
      "post": {
        "summary": "Create gear pack",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePackBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/api/v1/wishlists/{id}": {
      "get": {
        "summary": "Get pack",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pack"
          }
        }
      },
      "patch": {
        "summary": "Patch pack",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      }
    },
    "/api/v1/wishlists/{id}/items": {
      "post": {
        "summary": "Add item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Added"
          }
        }
      }
    },
    "/api/v1/agent/create-and-fill": {
      "post": {
        "summary": "Create pack and fill items",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePackBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/api/v1/products/resolve": {
      "post": {
        "summary": "Resolve ASIN/URL/keywords to buy URL",
        "responses": {
          "200": {
            "description": "Resolved"
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "summary": "MCP JSON-RPC endpoint",
        "description": "tools: search_gear, create_pack, add_item, resolve_product",
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      },
      "get": {
        "summary": "MCP discovery",
        "responses": {
          "200": {
            "description": "Server info + tools"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Goal": {
        "type": "string",
        "enum": [
          "run",
          "lift",
          "yoga"
        ]
      },
      "Level": {
        "type": "string",
        "enum": [
          "starter",
          "building",
          "serious"
        ]
      },
      "BudgetBand": {
        "type": "string",
        "enum": [
          "under-500",
          "500-1500",
          "1500-3000",
          "3000-plus"
        ]
      },
      "CreatePackBody": {
        "type": "object",
        "properties": {
          "athleteName": {
            "type": "string"
          },
          "goal": {
            "$ref": "#/components/schemas/Goal"
          },
          "level": {
            "$ref": "#/components/schemas/Level"
          },
          "budgetBand": {
            "$ref": "#/components/schemas/BudgetBand"
          },
          "marketplace": {
            "type": "string",
            "description": "Optional Amazon storefront: amazon.com (United States, tag sw-fitness-20) or amazon.se (Sweden, tag sw-fitness-21); each has its own hand-picked /dp/ catalog. If omitted: country, then Accept-Language (en-US → amazon.com), else amazon.se.",
            "examples": [
              "amazon.se",
              "amazon.com"
            ]
          },
          "locale": {
            "type": "string"
          },
          "itemAsins": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "itemKeywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "itemQueries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}