{
  "openapi": "3.0.3",
  "info": {
    "title": "Birthday Gift Finder – curated gift wishlist API",
    "version": "1.0.0",
    "description": "Create a gift wishlist for birthday in seconds from curated amazon.se and amazon.com products — carefully selected, hand-picked 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, födelsedag. Quickstart: POST /api/v1/agent/create-and-fill → shopUrl. Birthday gift ideas and shareable wishlists (recipient + gift-giver shopper). Agents MUST pass marketplace + locale. amazon.se product buyUrl uses Associates tag sw-fodelsedag-21 (?tag=sw-fodelsedag-21). amazon.com product buyUrl uses tag sw-fodelsedag-20 (?tag=sw-fodelsedag-20); US shoppers pass marketplace=amazon.com + locale=en-US. Other storefronts stay untagged. Prefer buyUrl / trackingTag. Remote MCP at /api/mcp. CORS *. Store selection: marketplace=amazon.com (US, English, USD, tag sw-fodelsedag-20) or amazon.se (Sweden, tag sw-fodelsedag-21). If omitted: marketplace/store param, then country, then Accept-Language (en-US → amazon.com), else amazon.se. Never an error when missing; responses include marketplaceSource."
  },
  "servers": [
    {
      "url": "https://birthday-gift-finder.vercel.app"
    }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Health & marketplaces",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "searchAmazon",
        "summary": "Search birthday gifts",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "amazon.com"
            },
            "description": "amazon.com (US, en-US) or amazon.se (Sweden). Optional: omitted → country, then Accept-Language en-US → amazon.com, else amazon.se."
          },
          {
            "name": "locale",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "occasion",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "budgetBand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "giftCategory",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ageBand",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "kids",
                "teens",
                "20s",
                "30s",
                "40s-plus"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "search results"
          }
        }
      }
    },
    "/api/v1/catalog": {
      "get": {
        "operationId": "getCatalog",
        "summary": "Curated birthday gift catalog",
        "parameters": [
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "amazon.com"
            },
            "description": "amazon.com (US, en-US) or amazon.se (Sweden). Optional: omitted → country, then Accept-Language en-US → amazon.com, else amazon.se."
          },
          {
            "name": "locale",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "occasion",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "giftCategory",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "giftCategories",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "budgetBand",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "catalog items"
          }
        }
      }
    },
    "/api/v1/products/resolve": {
      "post": {
        "operationId": "resolveProduct",
        "summary": "Resolve buy link",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "marketplace": {
                    "type": "string",
                    "description": "Amazon storefront for the end user. amazon.se (Sweden, tag sw-fodelsedag-21) and amazon.com (United States, tag sw-fodelsedag-20) have curated catalogs with /dp buy links."
                  },
                  "locale": {
                    "type": "string"
                  },
                  "asin": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "keywords": {
                    "type": "string"
                  },
                  "occasion": {
                    "type": "string"
                  },
                  "giftCategory": {
                    "type": "string"
                  },
                  "budgetBand": {
                    "type": "string"
                  },
                  "ageBand": {
                    "type": "string",
                    "enum": [
                      "kids",
                      "teens",
                      "20s",
                      "30s",
                      "40s-plus"
                    ],
                    "description": "Optional age band for birthday gift cues"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "resolved link"
          }
        }
      }
    },
    "/api/v1/wishlists": {
      "post": {
        "operationId": "createWishlist",
        "summary": "Create wishlist",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "occasion": {
                    "type": "string"
                  },
                  "budgetBand": {
                    "type": "string"
                  },
                  "giftCategories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "marketplace": {
                    "type": "string",
                    "description": "Amazon storefront for the end user. amazon.se (Sweden, tag sw-fodelsedag-21) and amazon.com (United States, tag sw-fodelsedag-20) have curated catalogs with /dp buy links."
                  },
                  "locale": {
                    "type": "string"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "ageBand": {
                    "type": "string",
                    "enum": [
                      "kids",
                      "teens",
                      "20s",
                      "30s",
                      "40s-plus"
                    ],
                    "description": "Optional age band for birthday gift cues"
                  },
                  "recipientName": {
                    "type": "string",
                    "description": "Birthday person / wishlist owner name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "created"
          }
        }
      }
    },
    "/api/v1/wishlists/{id}": {
      "get": {
        "operationId": "getWishlist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "wishlist"
          }
        }
      },
      "patch": {
        "operationId": "patchWishlist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Edit-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "updated"
          }
        }
      }
    },
    "/api/v1/wishlists/{id}/items": {
      "post": {
        "operationId": "addWishlistItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Edit-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "item added"
          }
        }
      }
    },
    "/api/v1/agent/create-and-fill": {
      "post": {
        "operationId": "agentCreateAndFill",
        "summary": "One-shot create and fill",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "occasion": {
                    "type": "string"
                  },
                  "budgetBand": {
                    "type": "string"
                  },
                  "giftCategories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "marketplace": {
                    "type": "string",
                    "description": "Amazon storefront for the end user. amazon.se (Sweden, tag sw-fodelsedag-21) and amazon.com (United States, tag sw-fodelsedag-20) have curated catalogs with /dp buy links."
                  },
                  "locale": {
                    "type": "string"
                  },
                  "itemAsins": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "itemKeywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "itemQueries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "ageBand": {
                    "type": "string",
                    "enum": [
                      "kids",
                      "teens",
                      "20s",
                      "30s",
                      "40s-plus"
                    ],
                    "description": "Optional age band for birthday gift cues"
                  },
                  "recipientName": {
                    "type": "string",
                    "description": "Birthday person / wishlist owner name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "created"
          }
        }
      }
    },
    "/api/mcp": {
      "get": {
        "summary": "Remote MCP (Streamable HTTP)",
        "responses": {
          "200": {
            "description": "MCP"
          }
        }
      },
      "post": {
        "summary": "Remote MCP",
        "responses": {
          "200": {
            "description": "MCP"
          }
        }
      },
      "options": {
        "summary": "CORS preflight",
        "responses": {
          "204": {
            "description": "ok"
          }
        }
      }
    }
  }
}